diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2011-11-14 02:51:06 +0400 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2011-11-15 03:10:15 +0400 |
commit | 2b1a4c5b3411c3030a5bdbd70d80bc606be570f7 (patch) | |
tree | 1b547573a094400fc29ef3691f3436a6037bcdef /libavfilter/src_movie.c | |
parent | 81852ef5d6d749371d9314abe70b6eebab2c797f (diff) |
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).
Diffstat (limited to 'libavfilter/src_movie.c')
-rw-r--r-- | 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 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); |