func: static int CVE_2011_2588_PATCHED_AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk ) p_chk -> strf . auds . i_cat = AUDIO_ES; p_chk -> strf . auds . p_wf = malloc ( __MAX ( p_chk -> common . i_chunk_size , sizeof ( WAVEFORMATEX ) ) ); if ( p_chk -> strf . auds . p_wf -> wFormatTag != WAVE_FORMAT_PCM && p_chk -> common . i_chunk_size > sizeof ( WAVEFORMATEX ) )  if ( p_chk -> strf . auds . p_wf -> cbSize > p_chk -> common . i_chunk_size - sizeof ( WAVEFORMATEX ) )  p_chk -> strf . auds . p_wf -> cbSize = p_chk -> common . i_chunk_size - sizeof ( WAVEFORMATEX ); p_chk -> strf . auds . p_wf -> cbSize = 0; if ( p_chk -> strf . auds . p_wf -> cbSize > 0 )  memcpy ( & p_chk -> strf . auds . p_wf [ 1 ] , p_buff + 8 + sizeof ( WAVEFORMATEX ) , p_chk -> strf . auds . p_wf -> cbSize ); p_chk -> strf . vids . i_cat = VIDEO_ES; p_chk -> strf . vids . p_bih = malloc ( __MAX ( p_chk -> common . i_chunk_size , sizeof ( * p_chk -> strf . vids . p_bih ) ) ); if ( p_chk -> strf . vids . p_bih -> biSize > p_chk -> common . i_chunk_size )  p_chk -> strf . vids . p_bih -> biSize = p_chk -> common . i_chunk_size; if ( p_chk -> common . i_chunk_size > sizeof ( BITMAPINFOHEADER ) )  memcpy ( & p_chk -> strf . vids . p_bih [ 1 ] , p_buff + 8 + sizeof ( BITMAPINFOHEADER ) , p_chk -> common . i_chunk_size - sizeof ( BITMAPINFOHEADER ) ); p_chk -> strf . common . i_cat = UNKNOWN_ES; 