[FFmpeg-devel] [PATCH] avfilter/af_asetnsamples: add missing error check
Paul B Mahol
onemda at gmail.com
Mon Nov 20 15:03:14 EET 2017
Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
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;
--
2.11.0
More information about the ffmpeg-devel
mailing list