summaryrefslogtreecommitdiff
path: root/multimedia
diff options
context:
space:
mode:
authorjakllsch <jakllsch@pkgsrc.org>2012-01-29 02:48:30 +0000
committerjakllsch <jakllsch@pkgsrc.org>2012-01-29 02:48:30 +0000
commitf29376e2235f5eef4d324f5fa79c0c8b50ad527c (patch)
tree6097d887822d7759152e5d73a3ede9c616d5b5f7 /multimedia
parentf66965259b569e89bb166117c8dc2866927c1257 (diff)
downloadpkgsrc-f29376e2235f5eef4d324f5fa79c0c8b50ad527c.tar.gz
Avoid doing unaligned accesses to DVD drive when reading disc title.
PKGREVISION++
Diffstat (limited to 'multimedia')
-rw-r--r--multimedia/dvdbackup/Makefile3
-rw-r--r--multimedia/dvdbackup/distinfo3
-rw-r--r--multimedia/dvdbackup/patches/patch-src_dvdbackup.c44
3 files changed, 48 insertions, 2 deletions
diff --git a/multimedia/dvdbackup/Makefile b/multimedia/dvdbackup/Makefile
index 6d9ff6f04e6..f6d3f5899c9 100644
--- a/multimedia/dvdbackup/Makefile
+++ b/multimedia/dvdbackup/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.7 2011/08/09 20:56:27 adam Exp $
+# $NetBSD: Makefile,v 1.8 2012/01/29 02:48:30 jakllsch Exp $
DISTNAME= dvdbackup-0.4.1
+PKGREVISION= 1
CATEGORIES= multimedia
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=dvdbackup/}
EXTRACT_SUFX= .tar.bz2
diff --git a/multimedia/dvdbackup/distinfo b/multimedia/dvdbackup/distinfo
index ab9d2e65652..8eb53a255bc 100644
--- a/multimedia/dvdbackup/distinfo
+++ b/multimedia/dvdbackup/distinfo
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.3 2011/08/09 20:56:27 adam Exp $
+$NetBSD: distinfo,v 1.4 2012/01/29 02:48:30 jakllsch Exp $
SHA1 (dvdbackup-0.4.1.tar.bz2) = d40b738917cac62a46405f6566a66359504f9a73
RMD160 (dvdbackup-0.4.1.tar.bz2) = a302bbdf6cb3b169784c326e095b1345e5f56538
Size (dvdbackup-0.4.1.tar.bz2) = 188496 bytes
+SHA1 (patch-src_dvdbackup.c) = f270dd1fdbc33dedbe7b5236fc3e4ffe5db942b7
diff --git a/multimedia/dvdbackup/patches/patch-src_dvdbackup.c b/multimedia/dvdbackup/patches/patch-src_dvdbackup.c
new file mode 100644
index 00000000000..97a7a523eae
--- /dev/null
+++ b/multimedia/dvdbackup/patches/patch-src_dvdbackup.c
@@ -0,0 +1,44 @@
+$NetBSD: patch-src_dvdbackup.c,v 1.1 2012/01/29 02:48:30 jakllsch Exp $
+
+--- src/dvdbackup.c.orig 2009-06-08 22:25:29.000000000 +0000
++++ src/dvdbackup.c
+@@ -1254,6 +1254,13 @@ int DVDGetTitleName(const char *device,
+ /* Variables for filehandel and title string interaction */
+
+ int filehandle, i, last;
++ unsigned char *buf;
++
++ buf = malloc(DVD_VIDEO_LB_LEN);
++ if (buf == NULL) {
++ fprintf(stderr, _("Cannot read title from DVD device %s\n"), device);
++ return(1);
++ }
+
+ /* Open DVD device */
+
+@@ -1264,7 +1271,7 @@ int DVDGetTitleName(const char *device,
+
+ /* Seek to title of first track, which is at (track_no * 32768) + 40 */
+
+- if ( 32808 != lseek(filehandle, 32808, SEEK_SET) ) {
++ if ( 32768 != lseek(filehandle, 32768, SEEK_SET) ) {
+ close(filehandle);
+ fprintf(stderr, _("Cannot seek DVD device %s - check your DVD device\n"), device);
+ return(1);
+@@ -1272,12 +1279,15 @@ int DVDGetTitleName(const char *device,
+
+ /* Read the DVD-Video title */
+
+- if ( 32 != read(filehandle, title, 32)) {
++ if ( DVD_VIDEO_LB_LEN != read(filehandle, buf, DVD_VIDEO_LB_LEN)) {
+ close(filehandle);
+ fprintf(stderr, _("Cannot read title from DVD device %s\n"), device);
+ return(1);
+ }
+
++ memcpy(title, &buf[40], 32);
++ free(buf);
++
+ /* Terminate the title string */
+
+ title[32] = '\0';