diff --git a/ChangeLog b/ChangeLog index ed42591069..fe1c7f5c03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-04-30 Michael Smith + + * 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 * gst/typefind/gsttypefindfunctions.c: (MpegVideoStreamCtx), diff --git a/ext/theora/theoradec.c b/ext/theora/theoradec.c index 5581fc7b85..0dc037ae9e 100644 --- a/ext/theora/theoradec.c +++ b/ext/theora/theoradec.c @@ -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: