]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/parser.c
mjpegenc: Remove duplicate initializer
[ffmpeg] / libavcodec / parser.c
index 2809158c3523eb3d1357ecd490d25696e08f7ec3..d25d261acdae9cdf80946440ebc57a0bd42de9a2 100644 (file)
@@ -141,6 +141,13 @@ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx,
     int index, i;
     uint8_t dummy_buf[AV_INPUT_BUFFER_PADDING_SIZE];
 
+    /* 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] ||
+               avctx->codec_id == s->parser->codec_ids[2] ||
+               avctx->codec_id == s->parser->codec_ids[3] ||
+               avctx->codec_id == s->parser->codec_ids[4]);
+
     if (!(s->flags & PARSER_FLAG_FETCHED_OFFSET)) {
         s->next_frame_offset =
         s->cur_offset        = pos;