[FFmpeg-devel] [PATCH 07/12] cngenc: Add missing error check

Derek Buitenhuis derek.buitenhuis at gmail.com
Thu Jul 6 21:28:37 EEST 2017


Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
---
 libavcodec/cngenc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/cngenc.c b/libavcodec/cngenc.c
index 302c703f72..b7207fd5f6 100644
--- a/libavcodec/cngenc.c
+++ b/libavcodec/cngenc.c
@@ -92,6 +92,8 @@ static int cng_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
         qdbov = 127;
     }
     ret = ff_lpc_calc_ref_coefs(&p->lpc, p->samples32, p->order, p->ref_coef);
+    if (ret < 0)
+        return ret;
     avpkt->data[0] = qdbov;
     for (i = 0; i < p->order; i++)
         avpkt->data[1 + i] = p->ref_coef[i] * 127 + 127;
-- 
2.11.0



More information about the ffmpeg-devel mailing list