ext/theora/theoradec.c: Cool kids don't divide by zero.

Original commit message from CVS:
* ext/theora/theoradec.c:
Cool kids don't divide by zero.
Treat PAR of x:0 as 1:1.
Fixes #530719.
This commit is contained in:
Michael Smith 2008-04-30 17:06:45 +00:00
parent 5f6db60a4d
commit 0947ecf74c
2 changed files with 12 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2008-04-30 Michael Smith <msmith@songbirdnest.com>
* ext/theora/theoradec.c:
Cool kids don't divide by zero.
Treat PAR of x:0 as 1:1.
Fixes #530719.
2008-04-30 Tim-Philipp Müller <tim.muller at collabora co uk>
* gst/typefind/gsttypefindfunctions.c: (MpegVideoStreamCtx),

View file

@ -789,10 +789,13 @@ theora_handle_type_packet (GstTheoraDec * dec, ogg_packet * packet)
/* calculate par
* the info.aspect_* values reflect PAR;
* 0:0 is allowed and can be interpreted as 1:1, so correct for it */
* 0:0 is allowed and can be interpreted as 1:1, so correct for it.
* x:0 for other x isn't technically allowed, but it's seen in the wild and
* is reasonable to treat the same.
*/
par_num = dec->info.aspect_numerator;
par_den = dec->info.aspect_denominator;
if (par_num == 0 && par_den == 0) {
if (par_den == 0) {
par_num = par_den = 1;
}
/* theora has: