]> git.sesse.net Git - mlt/commitdiff
Fix possible divide by zero (coverity-1026781).
authorDan Dennedy <dan@dennedy.org>
Sun, 2 Jun 2013 21:33:40 +0000 (14:33 -0700)
committerDan Dennedy <dan@dennedy.org>
Sun, 2 Jun 2013 21:54:42 +0000 (14:54 -0700)
src/modules/avformat/consumer_avformat.c

index c27656e39c516e95f8be5a9d1f7db77f01603b9e..e8ea75f11df09053b129ddfef82d6fd9d5ddf5c7 100644 (file)
@@ -236,7 +236,7 @@ static void property_changed( mlt_properties owner, mlt_consumer self, char *nam
                mlt_properties_set_int( properties, "display_aspect_den", rational.den );
 
                // Now compute the sample aspect ratio
-               rational = av_d2q( ar * height / width, 255 );
+               rational = av_d2q( ar * height / FFMAX(width, 1), 255 );
 
                // Update the profile and properties as well since this is an alias
                // for mlt properties that correspond to profile settings