diff libmpcodecs/vd_theora.c @ 30525:956bdcb944aa

Change aspect calculation code to switch to floating point earlier so integer overflows are not possible.
author reimar
date Sun, 14 Feb 2010 11:13:20 +0000
parents 9ac2056fc4df
children 68e260df472b
line wrap: on
line diff
--- a/libmpcodecs/vd_theora.c	Sun Feb 14 11:13:01 2010 +0000
+++ b/libmpcodecs/vd_theora.c	Sun Feb 14 11:13:20 2010 +0000
@@ -117,8 +117,8 @@
 
     if(sh->aspect==0.0 && context->inf.aspect_denominator!=0)
     {
-       sh->aspect = (float)(context->inf.aspect_numerator * context->inf.frame_width)/
-          (context->inf.aspect_denominator * context->inf.frame_height);
+       sh->aspect = ((double)context->inf.aspect_numerator * context->inf.frame_width)/
+          ((double)context->inf.aspect_denominator * context->inf.frame_height);
     }
 
     mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Theora video init ok!\n");