changeset 916:259f3efebef5 libavcodec

fixing aspect (hopefully, i couldnt reproduce the bug)
author michaelni
date Fri, 06 Dec 2002 15:01:48 +0000
parents 75ee49a4a516
children d3aa313dc373
files mjpeg.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mjpeg.c	Fri Dec 06 13:30:13 2002 +0000
+++ b/mjpeg.c	Fri Dec 06 15:01:48 2002 +0000
@@ -1184,7 +1184,10 @@
 	    int y_density = get_bits(&s->gb, 16);
 
             //MN: needs to be checked
-            s->avctx->aspect_ratio= s->width*y_density/((float)s->height*x_density);
+            if(x_density)
+                s->avctx->aspect_ratio= s->width*y_density/((float)s->height*x_density);
+            else
+                s->avctx->aspect_ratio= 0.0;
 	}
 	else
 	{