[FFmpeg-cvslog] avfilter/af_surround: add missing error check

Paul B Mahol git at videolan.org
Mon Nov 20 14:54:51 EET 2017


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Nov 20 13:23:07 2017 +0100| [200f497997a123066f18eafe0c706516da2f1d4c] | committer: Paul B Mahol

avfilter/af_surround: add missing error check

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavfilter/af_surround.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libavfilter/af_surround.c b/libavfilter/af_surround.c
index e1cb2b3854..460e18cd5a 100644
--- a/libavfilter/af_surround.c
+++ b/libavfilter/af_surround.c
@@ -1350,18 +1350,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     AVFilterContext *ctx = inlink->dst;
     AVFilterLink *outlink = ctx->outputs[0];
     AudioSurroundContext *s = ctx->priv;
+    int ret;
 
-    av_audio_fifo_write(s->fifo, (void **)in->extended_data,
-                        in->nb_samples);
-
-    if (s->pts == AV_NOPTS_VALUE)
+    ret = av_audio_fifo_write(s->fifo, (void **)in->extended_data,
+                              in->nb_samples);
+    if (ret >= 0 && s->pts == AV_NOPTS_VALUE)
         s->pts = in->pts;
 
     av_frame_free(&in);
+    if (ret < 0)
+        return ret;
 
     while (av_audio_fifo_size(s->fifo) >= s->buf_size) {
         AVFrame *out;
-        int ret;
 
         ret = av_audio_fifo_peek(s->fifo, (void **)s->input->extended_data, s->buf_size);
         if (ret < 0)



More information about the ffmpeg-cvslog mailing list