aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2011-11-13 23:51:06 +0100
committerStefano Sabatini <stefasab@gmail.com>2011-11-15 00:10:15 +0100
commit2b1a4c5b3411c3030a5bdbd70d80bc606be570f7 (patch)
tree1b547573a094400fc29ef3691f3436a6037bcdef
parent81852ef5d6d749371d9314abe70b6eebab2c797f (diff)
downloadffmpeg-2b1a4c5b3411c3030a5bdbd70d80bc606be570f7.tar.gz
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).
-rw-r--r--libavfilter/src_movie.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index 206099cec0..5806339eb7 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);