[libav-commits] libopusenc: check return value

Vittorio Giovara git at libav.org
Thu Nov 13 01:46:53 CET 2014


Module: libav
Branch: master
Commit: b09cf8afc5199d359ac985ad7cea72a6a9f20e4e

Author:    Vittorio Giovara <vittorio.giovara at gmail.com>
Committer: Vittorio Giovara <vittorio.giovara at gmail.com>
Date:      Tue Nov 11 13:26:54 2014 +0100

libopusenc: check return value

CC: libav-stable at libav.org
Bug-Id: CID 739870

---

 libavcodec/libopusenc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c
index ee9655b..8447206 100644
--- a/libavcodec/libopusenc.c
+++ b/libavcodec/libopusenc.c
@@ -308,7 +308,9 @@ static int libopus_encode(AVCodecContext *avctx, AVPacket *avpkt,
     int ret;
 
     if (frame) {
-        ff_af_queue_add(&opus->afq, frame);
+        ret = ff_af_queue_add(&opus->afq, frame);
+        if (ret < 0)
+            return ret;
         if (frame->nb_samples < opus->opts.packet_size) {
             audio = opus->samples;
             memcpy(audio, frame->data[0], frame->nb_samples * sample_size);



More information about the libav-commits mailing list