]> git.sesse.net Git - mlt/commitdiff
fix possible null pointer dereferences (coverity-709395)
authorDan Dennedy <dan@dennedy.org>
Fri, 17 Aug 2012 06:27:35 +0000 (23:27 -0700)
committerDan Dennedy <dan@dennedy.org>
Fri, 17 Aug 2012 06:27:35 +0000 (23:27 -0700)
src/modules/avformat/producer_avformat.c

index d3c9864b95a6d90df570cb3058f9c5c194b448a5..a603d1ba2cfc10c8301d61305f582dc5d3bb01c5 100644 (file)
@@ -1886,8 +1886,11 @@ static int video_codec_init( producer_avformat self, int index, mlt_properties p
 #endif
 
                // Reset some image properties
-               mlt_properties_set_int( properties, "width", self->video_codec->width );
-               mlt_properties_set_int( properties, "height", self->video_codec->height );
+               if ( self->video_codec )
+               {
+                       mlt_properties_set_int( properties, "width", self->video_codec->width );
+                       mlt_properties_set_int( properties, "height", self->video_codec->height );
+               }
                // For DV, we'll just use the saved aspect ratio
                if ( codec_context->codec_id != CODEC_ID_DVVIDEO )
                        get_aspect_ratio( properties, stream, self->video_codec, NULL );