]> git.sesse.net Git - ffmpeg/commitdiff
avformat/latmenc: Add assert to avoid coverity warning
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 3 Sep 2015 08:37:13 +0000 (10:37 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 3 Sep 2015 09:28:29 +0000 (11:28 +0200)
Fixes CID1322323

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/latmenc.c

index 17dbf33b721df10670a19fbac320693a4616bd95..db6977e58536aabde498334301a9493e6eda5fe8 100644 (file)
@@ -124,7 +124,8 @@ static void latm_write_frame_header(AVFormatContext *s, PutBitContext *bs)
 
             if (!ctx->channel_conf) {
                 GetBitContext gb;
-                init_get_bits8(&gb, avctx->extradata, avctx->extradata_size);
+                int ret = init_get_bits8(&gb, avctx->extradata, avctx->extradata_size);
+                av_assert0(ret >= 0); // extradata size has been checked already, so this should not fail
                 skip_bits_long(&gb, ctx->off + 3);
                 avpriv_copy_pce_data(bs, &gb);
             }