[MPlayer-cvslog] r30567 - trunk/libmpcodecs/vd_theora.c

reimar subversion at mplayerhq.hu
Sun Feb 14 12:13:21 CET 2010


Author: reimar
Date: Sun Feb 14 12:13:20 2010
New Revision: 30567

Log:
Change aspect calculation code to switch to floating point earlier so integer
overflows are not possible.

Modified:
   trunk/libmpcodecs/vd_theora.c

Modified: trunk/libmpcodecs/vd_theora.c
==============================================================================
--- trunk/libmpcodecs/vd_theora.c	Sun Feb 14 12:13:01 2010	(r30566)
+++ trunk/libmpcodecs/vd_theora.c	Sun Feb 14 12:13:20 2010	(r30567)
@@ -117,8 +117,8 @@ static int init(sh_video_t *sh){
 
     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");


More information about the MPlayer-cvslog mailing list