Commit f700641d authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/theora.c: sanity check for invalid theora header.

parent 007c8a15
...@@ -315,6 +315,21 @@ static int ProcessHeaders( decoder_t *p_dec ) ...@@ -315,6 +315,21 @@ static int ProcessHeaders( decoder_t *p_dec )
p_sys->ti.frame_width, p_sys->ti.frame_height, p_sys->ti.frame_width, p_sys->ti.frame_height,
p_sys->ti.offset_x, p_sys->ti.offset_y ); p_sys->ti.offset_x, p_sys->ti.offset_y );
/* Sanity check that seems necessary for some corrupted files */
if( p_sys->ti.width < p_sys->ti.frame_width ||
p_sys->ti.height < p_sys->ti.frame_height )
{
msg_Warn( p_dec, "trying to correct invalid theora header "
"(frame size (%dx%d) is smaller than frame content (%d,%d))",
p_sys->ti.width, p_sys->ti.height,
p_sys->ti.frame_width, p_sys->ti.frame_height );
if( p_sys->ti.width < p_sys->ti.frame_width )
p_sys->ti.width = p_sys->ti.frame_width;
if( p_sys->ti.height < p_sys->ti.frame_height )
p_sys->ti.height = p_sys->ti.frame_height;
}
/* The next packet in order is the comments header */ /* The next packet in order is the comments header */
oggpacket.b_o_s = 0; oggpacket.b_o_s = 0;
oggpacket.bytes = *(p_extra++) << 8; oggpacket.bytes = *(p_extra++) << 8;
......
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