summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg4video_parser.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@googlemail.com>2019-03-11 11:32:05 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-03-12 00:48:56 +0100
commit3f086a2f665f9906e0f6197cddbfacc2f4b093a1 (patch)
tree03ea635dc6c568f53acf611cf6f6a33808b405b5 /libavcodec/mpeg4video_parser.c
parent5ab44ff20cdc0e05adecbd0cd352d25fcb930094 (diff)
downloadffmpeg-3f086a2f665f9906e0f6197cddbfacc2f4b093a1.tar.gz
avcodec/mpeg4videodec: Fix nonsense warning
Since db772308941a2a338c7809f90d347219a6a93074 parsing of mpeg4-extradata lead to a "Failed to parse extradata" warning, because ff_mpeg4_decode_picture_header returns AVERROR_INVALIDDATA in case that no VOP was found. This patch adds a parameter to signify whether a header (where the absence of a VOP does not raise an error) or not is parsed. The first mode is of course used for parsing headers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mpeg4video_parser.c')
-rw-r--r--libavcodec/mpeg4video_parser.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c
index 9ebb09a63e..9ca0f14976 100644
--- a/libavcodec/mpeg4video_parser.c
+++ b/libavcodec/mpeg4video_parser.c
@@ -89,13 +89,13 @@ static int mpeg4_decode_header(AVCodecParserContext *s1, AVCodecContext *avctx,
if (avctx->extradata_size && pc->first_picture) {
init_get_bits(gb, avctx->extradata, avctx->extradata_size * 8);
- ret = ff_mpeg4_decode_picture_header(dec_ctx, gb);
- if (ret < -1)
+ ret = ff_mpeg4_decode_picture_header(dec_ctx, gb, 1);
+ if (ret < 0)
av_log(avctx, AV_LOG_WARNING, "Failed to parse extradata\n");
}
init_get_bits(gb, buf, 8 * buf_size);
- ret = ff_mpeg4_decode_picture_header(dec_ctx, gb);
+ ret = ff_mpeg4_decode_picture_header(dec_ctx, gb, 0);
if (s->width && (!avctx->width || !avctx->height ||
!avctx->coded_width || !avctx->coded_height)) {
ret = ff_set_dimensions(avctx, s->width, s->height);