pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/multimedia/libdvdread fix some memory allocation bugs,...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/65771f9db224
branches:  trunk
changeset: 494565:65771f9db224
user:      drochner <drochner%pkgsrc.org@localhost>
date:      Wed May 25 17:07:53 2005 +0000

description:
fix some memory allocation bugs, from libdvdread CVS, and two memory
leaks, reported by Xiaoyu Fang to the ogle-devel mailing list
bump PKGREVISION

diffstat:

 multimedia/libdvdread/Makefile         |   4 +-
 multimedia/libdvdread/distinfo         |   4 ++-
 multimedia/libdvdread/patches/patch-ad |  22 +++++++++++++++++++++
 multimedia/libdvdread/patches/patch-ae |  35 ++++++++++++++++++++++++++++++++++
 4 files changed, 62 insertions(+), 3 deletions(-)

diffs (93 lines):

diff -r d05b5ca95056 -r 65771f9db224 multimedia/libdvdread/Makefile
--- a/multimedia/libdvdread/Makefile    Wed May 25 17:06:48 2005 +0000
+++ b/multimedia/libdvdread/Makefile    Wed May 25 17:07:53 2005 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.7 2005/05/22 20:08:20 jlam Exp $
+# $NetBSD: Makefile,v 1.8 2005/05/25 17:07:53 drochner Exp $
 
 DISTNAME=      libdvdread-0.9.4
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    multimedia
 MASTER_SITES=  http://www.dtek.chalmers.se/groups/dvd/dist/
 
diff -r d05b5ca95056 -r 65771f9db224 multimedia/libdvdread/distinfo
--- a/multimedia/libdvdread/distinfo    Wed May 25 17:06:48 2005 +0000
+++ b/multimedia/libdvdread/distinfo    Wed May 25 17:07:53 2005 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.5 2005/03/10 14:21:44 tv Exp $
+$NetBSD: distinfo,v 1.6 2005/05/25 17:07:53 drochner Exp $
 
 SHA1 (libdvdread-0.9.4.tar.gz) = a4b626e49ba8bd33857693c3abe8b34196bc3360
 RMD160 (libdvdread-0.9.4.tar.gz) = 9f7f82e14fb5d458686e5cb2e5f364bad19dd08e
@@ -6,3 +6,5 @@
 SHA1 (patch-aa) = d97d18c6e1ad445ed7d8e1cdb990ca58ed2d3ef9
 SHA1 (patch-ab) = a86a639adf22fe17c98db059e3fa542d0424d468
 SHA1 (patch-ac) = 971dc8802bf8f815821e8ad5f279a5148fcf26f7
+SHA1 (patch-ad) = f6d44ffc3434e79499a807daa8daa7f22eba54ab
+SHA1 (patch-ae) = 99d296d4c1c49f1ff4747109dfc8b3d07647ffc4
diff -r d05b5ca95056 -r 65771f9db224 multimedia/libdvdread/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/libdvdread/patches/patch-ad    Wed May 25 17:07:53 2005 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-ad,v 1.1 2005/05/25 17:07:53 drochner Exp $
+
+--- dvdread/dvd_input.c.orig   2005-05-24 18:41:21.000000000 +0200
++++ dvdread/dvd_input.c
+@@ -74,7 +74,7 @@ static dvd_input_t css_open(const char *
+   dvd_input_t dev;
+     
+   /* Allocate the handle structure */
+-  dev = (dvd_input_t) malloc(sizeof(dvd_input_t));
++  dev = (dvd_input_t) malloc(sizeof(struct dvd_input_s));
+   if(dev == NULL) {
+     fprintf(stderr, "libdvdread: Could not allocate memory.\n");
+     return NULL;
+@@ -154,7 +154,7 @@ static dvd_input_t file_open(const char 
+   dvd_input_t dev;
+   
+   /* Allocate the library structure */
+-  dev = (dvd_input_t) malloc(sizeof(dvd_input_t));
++  dev = (dvd_input_t) malloc(sizeof(struct dvd_input_s));
+   if(dev == NULL) {
+     fprintf(stderr, "libdvdread: Could not allocate memory.\n");
+     return NULL;
diff -r d05b5ca95056 -r 65771f9db224 multimedia/libdvdread/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/libdvdread/patches/patch-ae    Wed May 25 17:07:53 2005 +0000
@@ -0,0 +1,35 @@
+$NetBSD: patch-ae,v 1.1 2005/05/25 17:07:53 drochner Exp $
+
+--- dvdread/ifo_read.c.orig    2003-01-17 21:49:16.000000000 +0100
++++ dvdread/ifo_read.c
+@@ -257,6 +257,7 @@ void ifoClose(ifo_handle_t *ifofile) {
+   ifoFree_FP_PGC(ifofile);
+   ifoFree_PGCIT(ifofile);
+   ifoFree_VTS_PTT_SRPT(ifofile);
++  ifoFree_VTS_TMAPT(ifofile);
+ 
+   if(ifofile->vmgi_mat)
+     free(ifofile->vmgi_mat);
+@@ -1624,8 +1625,8 @@ static int ifoRead_PGCIT_internal(ifo_ha
+   }
+   ptr = data;
+   for(i = 0; i < pgcit->nr_of_pgci_srp; i++) {
+-    memcpy(&pgcit->pgci_srp[i], ptr, PGCI_LU_SIZE);
+-    ptr += PGCI_LU_SIZE;
++    memcpy(&pgcit->pgci_srp[i], ptr, PGCI_SRP_SIZE);
++    ptr += PGCI_SRP_SIZE;
+     B2N_16(pgcit->pgci_srp[i].ptl_id_mask);
+     B2N_32(pgcit->pgci_srp[i].pgc_start_byte);
+     CHECK_VALUE(pgcit->pgci_srp[i].unknown1 == 0);
+@@ -1663,8 +1664,10 @@ static int ifoRead_PGCIT_internal(ifo_ha
+ static void ifoFree_PGCIT_internal(pgcit_t *pgcit) {
+   if(pgcit) {
+     int i;
+-    for(i = 0; i < pgcit->nr_of_pgci_srp; i++)
++    for(i = 0; i < pgcit->nr_of_pgci_srp; i++) {
+       ifoFree_PGC(pgcit->pgci_srp[i].pgc);
++      free(pgcit->pgci_srp[i].pgc);
++    }
+     free(pgcit->pgci_srp);
+   }
+ }



Home | Main Index | Thread Index | Old Index