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

Paul B Mahol git at videolan.org
Tue Nov 21 19:32:43 EET 2017


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Nov 20 14:02:28 2017 +0100| [000836c2a98e1c6a2867dd9db0371c137609acf0] | committer: Paul B Mahol

avfilter/af_asetnsamples: 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=000836c2a98e1c6a2867dd9db0371c137609acf0
---

 libavfilter/af_asetnsamples.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c
index 3c2f66b30a..ecb76e64db 100644
--- a/libavfilter/af_asetnsamples.c
+++ b/libavfilter/af_asetnsamples.c
@@ -140,11 +140,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
             return -1;
         }
     }
-    av_audio_fifo_write(asns->fifo, (void **)insamples->extended_data, nb_samples);
-    if (asns->next_out_pts == AV_NOPTS_VALUE)
+    ret = av_audio_fifo_write(asns->fifo, (void **)insamples->extended_data, nb_samples);
+    if (ret > 0 && asns->next_out_pts == AV_NOPTS_VALUE)
         asns->next_out_pts = insamples->pts;
     av_frame_free(&insamples);
 
+    if (ret < 0)
+        return ret;
+
     while (av_audio_fifo_size(asns->fifo) >= asns->nb_out_samples)
         push_samples(outlink);
     return 0;



More information about the ffmpeg-cvslog mailing list