avcodec/parser: assert that the codec id is not NONE in av_parser_parse2()
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 1 Apr 2016 16:50:45 +0000 (18:50 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 1 Apr 2016 17:08:29 +0000 (19:08 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/parser.c

index d25d261..2c8fc69 100644 (file)
@@ -141,6 +141,8 @@ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx,
     int index, i;
     uint8_t dummy_buf[AV_INPUT_BUFFER_PADDING_SIZE];
 
+    av_assert1(avctx->codec_id != AV_CODEC_ID_NONE);
+
     /* Parsers only work for the specified codec ids. */
     av_assert1(avctx->codec_id == s->parser->codec_ids[0] ||
                avctx->codec_id == s->parser->codec_ids[1] ||