changeset 2363:3f3a4b5fc5bb libavformat

ensure that the aspect ratio is spec compliant
author michael
date Fri, 10 Aug 2007 14:23:18 +0000
parents 6d50c1518d8a
children 7c31128b23f8
files nutenc.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/nutenc.c	Fri Aug 10 13:34:56 2007 +0000
+++ b/nutenc.c	Fri Aug 10 14:23:18 2007 +0000
@@ -301,8 +301,14 @@
     case CODEC_TYPE_VIDEO:
         put_v(bc, codec->width);
         put_v(bc, codec->height);
-        put_v(bc, codec->sample_aspect_ratio.num);
-        put_v(bc, codec->sample_aspect_ratio.den);
+
+        if(codec->sample_aspect_ratio.num<=0 || codec->sample_aspect_ratio.den<=0){
+            put_v(bc, 0);
+            put_v(bc, 0);
+        }else{
+            put_v(bc, codec->sample_aspect_ratio.num);
+            put_v(bc, codec->sample_aspect_ratio.den);
+        }
         put_v(bc, 0); /* csp type -- unknown */
         break;
     default: