[MPlayer-cvslog] r24829 - trunk/libmpcodecs/vd_vfw.c

reimar subversion at mplayerhq.hu
Sun Oct 21 15:15:48 CEST 2007


Author: reimar
Date: Sun Oct 21 15:15:48 2007
New Revision: 24829

Log:
Check ICDecompressGetFormatSize to avoid crashes.
Based on patch by Gianluigi Tiesi (mplayer netfarm it).


Modified:
   trunk/libmpcodecs/vd_vfw.c

Modified: trunk/libmpcodecs/vd_vfw.c
==============================================================================
--- trunk/libmpcodecs/vd_vfw.c	(original)
+++ trunk/libmpcodecs/vd_vfw.c	Sun Oct 21 15:15:48 2007
@@ -172,6 +172,11 @@ static int init(sh_video_t *sh){
 
     o_bih_len = ICDecompressGetFormatSize(priv->handle, sh->bih);
   
+    if(o_bih_len < sizeof(BITMAPINFOHEADER)){
+       mp_msg(MSGT_WIN32,MSGL_ERR,"ICDecompressGetFormatSize returned a bogus value: %d\n", o_bih_len);
+       return 0;
+    }
+
     priv->o_bih = malloc(o_bih_len);
     memset(priv->o_bih, 0, o_bih_len);
 



More information about the MPlayer-cvslog mailing list