]> git.sesse.net Git - mlt/commitdiff
fix segfault accessing possible null frame
authorDan Dennedy <dan@dennedy.org>
Mon, 16 Jan 2012 17:32:54 +0000 (09:32 -0800)
committerDan Dennedy <dan@dennedy.org>
Mon, 16 Jan 2012 17:32:54 +0000 (09:32 -0800)
(only when real_time > 0?)

Patch-by: Maksym Veremeyenko
src/modules/avformat/consumer_avformat.c

index 07e80ea9ff8175518f65ef16c077cb6ba840d587..f96640aa74eb9ae10e19611727c6d221ac5d3030 100644 (file)
@@ -1275,13 +1275,16 @@ static void *consumer_thread( void *arg )
        frame = mlt_consumer_rt_frame( consumer );
 
        // Set the timecode from the MLT metadata if available.
-       const char *timecode = mlt_properties_get( MLT_FRAME_PROPERTIES(frame), "meta.attr.vitc.markup" );
-       if ( timecode && strcmp( timecode, "" ) )
-       {
-               mlt_properties_set( properties, "timecode", timecode );
-               if ( strchr( timecode, ';' ) )
-                       mlt_properties_set_int( properties, "drop_frame_timecode", 1 );
-       }
+    if ( frame )
+    {
+        const char *timecode = mlt_properties_get( MLT_FRAME_PROPERTIES(frame), "meta.attr.vitc.markup" );
+        if ( timecode && strcmp( timecode, "" ) )
+        {
+            mlt_properties_set( properties, "timecode", timecode );
+            if ( strchr( timecode, ';' ) )
+                mlt_properties_set_int( properties, "drop_frame_timecode", 1 );
+        }
+    }
 
        // Add audio and video streams
        if ( video_codec_id != CODEC_ID_NONE )