[FFmpeg-devel] [PATCH] amovie: avoid crash in amovie_request_frame() if no samplesref is available

Stefano Sabatini stefasab at gmail.com
Sun Nov 13 23:53:16 CET 2011


The crash occurrs when a frame is successfully decoded, but no decoded
data is immediately available (typically happens with ogg/vorbis).
---
 libavfilter/src_movie.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index 206099c..fbd2bec 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -446,8 +446,12 @@ static int amovie_request_frame(AVFilterLink *outlink)
 
     if (movie->is_done)
         return AVERROR_EOF;
-    if ((ret = amovie_get_samples(outlink)) < 0)
-        return ret;
+    while (1) {
+        if ((ret = amovie_get_samples(outlink)) < 0)
+            return ret;
+        if (movie->samplesref)
+            break;
+    }
 
     avfilter_filter_samples(outlink, avfilter_ref_buffer(movie->samplesref, ~0));
     avfilter_unref_buffer(movie->samplesref);
-- 
1.7.4.1



More information about the ffmpeg-devel mailing list