mirror of
https://github.com/mpv-player/mpv
synced 2025-01-01 04:36:24 +01:00
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:
parent
bd543ced4c
commit
bcc10e0961
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user