Commit 0d7032c5 authored by conrad's avatar conrad

add workaround for 0 numerator in theora fps, to avoid divide by zero for

very old or very broken ogg theora files.


git-svn-id: http://svn.annodex.net/liboggz/trunk@790 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent 498c292e
...@@ -167,6 +167,12 @@ auto_theora (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data) ...@@ -167,6 +167,12 @@ auto_theora (OGGZ * oggz, ogg_packet * op, long serialno, void * user_data)
tdata->fps_numerator = INT32_BE_AT(&header[22]); tdata->fps_numerator = INT32_BE_AT(&header[22]);
tdata->fps_denominator = INT32_BE_AT(&header[26]); tdata->fps_denominator = INT32_BE_AT(&header[26]);
/* Very old theora versions used a value of 0 to mean 1.
* Unfortunately theora hasn't incremented its version field,
* hence we hardcode this workaround for old or broken streams.
*/
if (tdata->fps_numerator == 0) tdata->fps_numerator = 1;
#if USE_THEORA_PRE_ALPHA_3_FORMAT #if USE_THEORA_PRE_ALPHA_3_FORMAT
/* old header format, used by Theora alpha2 and earlier */ /* old header format, used by Theora alpha2 and earlier */
keyframe_granule_shift = (header[36] & 0xf8) >> 3; keyframe_granule_shift = (header[36] & 0xf8) >> 3;
......
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