[libav-stable] [PATCH] avresample: check output FIFO validity before usage

Sean McGovern gseanmcg at gmail.com
Wed Jan 17 23:36:23 CET 2018


Bug-Id: 1089
Cc: libav-stable at libav.org
---
 libavresample/utils.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavresample/utils.c b/libavresample/utils.c
index bab2153..3d959c5 100644
--- a/libavresample/utils.c
+++ b/libavresample/utils.c
@@ -754,6 +754,11 @@ int avresample_get_out_samples(AVAudioResampleContext *avr, int in_nb_samples)
 {
     int64_t samples = avresample_get_delay(avr) + (int64_t)in_nb_samples;
 
+    if (!avr->out_fifo) {
+        av_log(avr, AV_LOG_ERROR, "Output FIFO is invalid\n");
+        return AVERROR(EINVAL);
+    }
+
     if (avr->resample_needed) {
         samples = av_rescale_rnd(samples,
                                  avr->out_sample_rate,
-- 
2.7.4



More information about the libav-stable mailing list