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

Stefano Sabatini git at videolan.org
Tue Nov 15 00:19:33 CET 2011


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Sun Nov 13 23:51:06 2011 +0100| [2b1a4c5b3411c3030a5bdbd70d80bc606be570f7] | committer: Stefano Sabatini

amovie: avoid crash in amovie_request_frame() if no samplesref is available

The crash occurrs when a frame is successfully decoded, but no decoded
data is immediately available (typically happens with ogg/vorbis).

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2b1a4c5b3411c3030a5bdbd70d80bc606be570f7
---

 libavfilter/src_movie.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

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



More information about the ffmpeg-cvslog mailing list