From 65081e3d3fc9ff881fa27317d61fc8eee153e510 Mon Sep 17 00:00:00 2001 From: ddennedy Date: Sun, 14 Dec 2008 05:14:34 +0000 Subject: [PATCH] producer_avformat.c: bugfix (kdenlive-432) segfault when reusing previous AVFrame (paused or idling on last frame) but the previos AVFrame was invalid (not got_picture before erroring out). git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1265 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/avformat/producer_avformat.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/src/modules/avformat/producer_avformat.c b/src/modules/avformat/producer_avformat.c index ce24483..3a9b46c 100644 --- a/src/modules/avformat/producer_avformat.c +++ b/src/modules/avformat/producer_avformat.c @@ -714,10 +714,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form // Construct an AVFrame for YUV422 conversion if ( av_frame == NULL ) - { av_frame = avcodec_alloc_frame( ); - mlt_properties_set_data( properties, "av_frame", av_frame, 0, av_free, NULL ); - } while( ret >= 0 && !got_picture ) { @@ -774,6 +771,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form mlt_properties_set_int( properties, "top_field_first", av_frame->top_field_first ); mlt_properties_set_int( properties, "_current_position", int_position ); mlt_properties_set_int( properties, "_got_picture", 1 ); + mlt_properties_set_data( properties, "av_frame", av_frame, 0, av_free, NULL ); } else { -- 1.7.4.4