[MPlayer-cvslog] r21579 - trunk/libmpcodecs/vd_realvid.c

reimar subversion at mplayerhq.hu
Sun Dec 10 19:59:28 CET 2006


Author: reimar
Date: Sun Dec 10 19:59:28 2006
New Revision: 21579

Modified:
   trunk/libmpcodecs/vd_realvid.c

Log:
Only increase buffer size to avoid crashes when seeking in
multi-resolution video files.


Modified: trunk/libmpcodecs/vd_realvid.c
==============================================================================
--- trunk/libmpcodecs/vd_realvid.c	(original)
+++ trunk/libmpcodecs/vd_realvid.c	Sun Dec 10 19:59:28 2006
@@ -60,6 +60,7 @@
 static void *rv_handle=NULL;
 static int inited=0;
 static uint8_t *buffer = NULL;
+static int bufsz = 0;
 #ifdef USE_WIN32DLL
 static int dll_type = 0; /* 0 = unix dlopen, 1 = win32 dll */
 #endif
@@ -300,6 +301,7 @@
 	if (buffer)
 	    free(buffer);
 	buffer = NULL;
+	bufsz = 0;
 }
 
 // copypaste from demux_real.c - it should match to get it working!
@@ -330,9 +332,10 @@
 
 	if(len<=0 || flags&2) return NULL; // skipped frame || hardframedrop
 
-	if (!inited) {
+	if (bufsz < sh->disp_w*sh->disp_h*3/2) {
 	    if (buffer) free(buffer);
-	    buffer=malloc(sh->disp_w*sh->disp_h*3/2);
+	    bufsz = sh->disp_w*sh->disp_h*3/2;
+	    buffer=malloc(bufsz);
 	    if (!buffer) return 0;
 	}
 	



More information about the MPlayer-cvslog mailing list