# HG changeset patch # User reimar # Date 1192972548 0 # Node ID d555579c8c98d409ff3960966906d188f4048280 # Parent 1076f50ba2d21acedfcc54a42a5a07e2df47a0b4 Check ICDecompressGetFormatSize to avoid crashes. Based on patch by Gianluigi Tiesi (mplayer netfarm it). diff -r 1076f50ba2d2 -r d555579c8c98 libmpcodecs/vd_vfw.c --- a/libmpcodecs/vd_vfw.c Sun Oct 21 12:56:22 2007 +0000 +++ b/libmpcodecs/vd_vfw.c Sun Oct 21 13:15:48 2007 +0000 @@ -172,6 +172,11 @@ 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);