Commit 932aae73 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

AVI: fix a crash in palette handling

This happen when p_vids->p_bih->biSize - sizeof( BITMAPINFOHEADER ) = 0
and the data is in p_vids->i_chunk_size, because then p_extra == NULL.

This solves the fruity sample crash but doesn't fix the palette
parent 468bb565
......@@ -557,7 +557,7 @@ static int Open( vlc_object_t * p_this )
{
/* The palette is not always included in biSize */
fmt.i_extra = p_vids->i_chunk_size - sizeof(BITMAPINFOHEADER);
if( fmt.i_extra > 0 )
if( fmt.i_extra > 0 && fmt.p_extra )
{
const uint8_t *p_pal = fmt.p_extra;
......
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