[libav-devel] [PATCH] aac: Make sure to set err on the failure path

Luca Barbato lu_zero at gentoo.org
Sun Aug 23 12:01:47 CEST 2015


Bug-Id: CID 1308153
---
 libavcodec/aacdec.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index d7e0aa5..5a0991e 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -2834,9 +2834,10 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
     while ((elem_type = get_bits(gb, 3)) != TYPE_END) {
         elem_id = get_bits(gb, 4);
 
-        if (!avctx->channels && elem_type != TYPE_PCE)
+        if (!avctx->channels && elem_type != TYPE_PCE) {
+            err = AVERROR_INVALIDDATA;
             goto fail;
-
+        }
         if (elem_type < TYPE_DSE) {
             if (!(che=get_che(ac, elem_type, elem_id))) {
                 av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
-- 
2.5.0



More information about the libav-devel mailing list