[FFmpeg-devel] [PATCH] avfilter/src_movi: Free packet on decoder error

Michael Niedermayer michaelni at gmx.at
Tue Jun 25 03:20:46 CEST 2013


Prevents infinite loop, see Ticket2556

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavfilter/src_movie.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index 058838a..bdbf69e 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -514,6 +514,9 @@ static int movie_push_frame(AVFilterContext *ctx, unsigned out_id)
     if (ret < 0) {
         av_log(ctx, AV_LOG_WARNING, "Decode error: %s\n", av_err2str(ret));
         av_frame_free(&movie->frame);
+        av_free_packet(&movie->pkt0);
+        pkt->size = 0; /* ready for next run */
+        pkt->data = NULL;
         return 0;
     }
     if (!ret)
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list