[FFmpeg-cvslog] avformat/latmenc: Add assert to avoid coverity warning

Michael Niedermayer git at videolan.org
Thu Sep 3 11:41:16 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Sep  3 10:37:13 2015 +0200| [879603fa3f8d99d084ae470f7c804df8373da0b6] | committer: Michael Niedermayer

avformat/latmenc: Add assert to avoid coverity warning

Fixes CID1322323

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=879603fa3f8d99d084ae470f7c804df8373da0b6
---

 libavformat/latmenc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/latmenc.c b/libavformat/latmenc.c
index 17dbf33..db6977e 100644
--- a/libavformat/latmenc.c
+++ b/libavformat/latmenc.c
@@ -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);
             }



More information about the ffmpeg-cvslog mailing list