[FFmpeg-cvslog] r10056 - trunk/libavformat/nutenc.c

michael subversion
Fri Aug 10 16:23:18 CEST 2007


Author: michael
Date: Fri Aug 10 16:23:18 2007
New Revision: 10056

Log:
ensure that the aspect ratio is spec compliant


Modified:
   trunk/libavformat/nutenc.c

Modified: trunk/libavformat/nutenc.c
==============================================================================
--- trunk/libavformat/nutenc.c	(original)
+++ trunk/libavformat/nutenc.c	Fri Aug 10 16:23:18 2007
@@ -301,8 +301,14 @@ static int write_streamheader(NUTContext
     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:




More information about the ffmpeg-cvslog mailing list