Commit 1530ef4f authored by Francois Cartegnie's avatar Francois Cartegnie Committed by Jean-Baptiste Kempf

demux: libavi: fix heap write ofw

(cherry picked from commit dde5f4aff32b81b6cace0a88a3a718147d0f3bf4)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent ee947974
...@@ -460,9 +460,10 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk ) ...@@ -460,9 +460,10 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk )
{ {
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;
} }
uint64_t i_extrasize = p_chk->common.i_chunk_size - sizeof(VLC_BITMAPINFOHEADER); if ( p_chk->common.i_chunk_size > sizeof(VLC_BITMAPINFOHEADER) )
if( i_extrasize > 0 )
{ {
uint64_t i_extrasize = p_chk->common.i_chunk_size - sizeof(VLC_BITMAPINFOHEADER);
/* There's a color palette appended, set up VLC_BITMAPINFO */ /* There's a color palette appended, set up VLC_BITMAPINFO */
memcpy( &p_chk->strf.vids.p_bih[1], memcpy( &p_chk->strf.vids.p_bih[1],
p_buff + 8 + sizeof(VLC_BITMAPINFOHEADER), /* 8=fourrc+size */ p_buff + 8 + sizeof(VLC_BITMAPINFOHEADER), /* 8=fourrc+size */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment