From c06e689e3c0b269add217452fca192e99104f7ea Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Mon, 16 Jan 2012 09:32:54 -0800 Subject: [PATCH] fix segfault accessing possible null frame (only when real_time > 0?) Patch-by: Maksym Veremeyenko --- src/modules/avformat/consumer_avformat.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c index 07e80ea9..f96640aa 100644 --- a/src/modules/avformat/consumer_avformat.c +++ b/src/modules/avformat/consumer_avformat.c @@ -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 ) -- 2.39.2