[Mplayer-cvslog] CVS: main/libmpdemux demux_mkv.cpp,1.44,1.45

Moritz Bunkus CVS mosu at mplayerhq.hu
Thu Oct 30 15:51:23 CET 2003


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv9532

Modified Files:
	demux_mkv.cpp 
Log Message:
Fixed wrong allocation of the BITMAPINFOHEADER structure which would crash mplayer in some cases.

Index: demux_mkv.cpp
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mkv.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- demux_mkv.cpp	29 Oct 2003 18:09:20 -0000	1.44
+++ demux_mkv.cpp	30 Oct 2003 14:50:04 -0000	1.45
@@ -2020,12 +2020,12 @@
     BITMAPINFOHEADER *bih;
 
     idesc = NULL;
-    bih = (BITMAPINFOHEADER *)safemalloc(track->private_size);
-    memset(bih, 0, sizeof(BITMAPINFOHEADER));
 
     if (track->ms_compat) {         // MS compatibility mode
       BITMAPINFOHEADER *src;
       src = (BITMAPINFOHEADER *)track->private_data;
+      bih = (BITMAPINFOHEADER *)safemalloc(track->private_size);
+      memset(bih, 0, track->private_size);
       bih->biSize = get_uint32(&src->biSize);
       bih->biWidth = get_uint32(&src->biWidth);
       bih->biHeight = get_uint32(&src->biHeight);
@@ -2042,6 +2042,8 @@
              track->private_size - sizeof(BITMAPINFOHEADER));
 
     } else {
+      bih = (BITMAPINFOHEADER *)safemalloc(sizeof(BITMAPINFOHEADER));
+      memset(bih, 0, sizeof(BITMAPINFOHEADER));
       bih->biSize = sizeof(BITMAPINFOHEADER);
       bih->biWidth = track->v_width;
       bih->biHeight = track->v_height;



More information about the MPlayer-cvslog mailing list