From d1010f51a2cb07ba83d71423ab740a5a0c3d0934 Mon Sep 17 00:00:00 2001 From: Juergen Keil Date: Wed, 4 Sep 2002 16:06:18 +0000 Subject: file_open was allocating too few bytes for dvd_input_t, corrupts malloc heap. It was using ``sizeof(pointer)'' instead of ``sizeof(structure)'' CVS patchset: 2605 CVS date: 2002/09/04 16:06:18 --- src/input/libdvdread/dvd_input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/input/libdvdread/dvd_input.c b/src/input/libdvdread/dvd_input.c index c2d788fdb..ccd57dd5a 100644 --- a/src/input/libdvdread/dvd_input.c +++ b/src/input/libdvdread/dvd_input.c @@ -55,7 +55,7 @@ static dvd_input_t css_open(const char *target) dvd_input_t dev; /* Allocate the handle structure */ - dev = (dvd_input_t) malloc(sizeof(dvd_input_t)); + dev = (dvd_input_t) malloc(sizeof(*dev)); if(dev == NULL) { fprintf(stderr, "libdvdread: Could not allocate memory.\n"); return NULL; @@ -134,7 +134,7 @@ static dvd_input_t file_open(const char *target) dvd_input_t dev; /* Allocate the library structure */ - dev = (dvd_input_t) malloc(sizeof(dvd_input_t)); + dev = (dvd_input_t) malloc(sizeof(*dev)); if(dev == NULL) { fprintf(stderr, "libdvdread: Could not allocate memory.\n"); return NULL; -- cgit v1.2.3