pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/multimedia/dvdbackup Avoid doing unaligned accesses to...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9bcd7bb358ac
branches:  trunk
changeset: 598711:9bcd7bb358ac
user:      jakllsch <jakllsch%pkgsrc.org@localhost>
date:      Sun Jan 29 02:48:30 2012 +0000

description:
Avoid doing unaligned accesses to DVD drive when reading disc title.
PKGREVISION++

diffstat:

 multimedia/dvdbackup/Makefile                      |   3 +-
 multimedia/dvdbackup/distinfo                      |   3 +-
 multimedia/dvdbackup/patches/patch-src_dvdbackup.c |  44 ++++++++++++++++++++++
 3 files changed, 48 insertions(+), 2 deletions(-)

diffs (71 lines):

diff -r 9f35f00de0ce -r 9bcd7bb358ac multimedia/dvdbackup/Makefile
--- a/multimedia/dvdbackup/Makefile     Sun Jan 29 01:16:24 2012 +0000
+++ b/multimedia/dvdbackup/Makefile     Sun Jan 29 02:48:30 2012 +0000
@@ -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 -r 9f35f00de0ce -r 9bcd7bb358ac multimedia/dvdbackup/distinfo
--- a/multimedia/dvdbackup/distinfo     Sun Jan 29 01:16:24 2012 +0000
+++ b/multimedia/dvdbackup/distinfo     Sun Jan 29 02:48:30 2012 +0000
@@ -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 -r 9f35f00de0ce -r 9bcd7bb358ac multimedia/dvdbackup/patches/patch-src_dvdbackup.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/dvdbackup/patches/patch-src_dvdbackup.c        Sun Jan 29 02:48:30 2012 +0000
@@ -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';



Home | Main Index | Thread Index | Old Index