Check ICDecompressGetFormatSize to avoid crashes.

Based on patch by Gianluigi Tiesi (mplayer netfarm it).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24829 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2007-10-21 13:15:48 +00:00
parent bd543ced4c
commit bcc10e0961
1 changed files with 5 additions and 0 deletions

View File

@ -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);