diff options
author | Anton Khirnov <anton@khirnov.net> | 2017-08-05 18:36:12 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-04-10 15:49:27 +0200 |
commit | d41faffb533d899ecd67f3427914153b5a5dcffb (patch) | |
tree | 594efd21920d6392fc9bd7b02356e56c9db31e38 | |
parent | 9d6785d426be1ac045c0b6a13b7447459389c40b (diff) | |
download | ffmpeg-d41faffb533d899ecd67f3427914153b5a5dcffb.tar.gz |
h264dec: do not abort if decoding extradata fails
Such errors are not necessarily fatal and decoding might still be
possible, e.g. it happens for MVC streams where we do not handle the
subset SPS thus failing to parse its corresponding PPS.
-rw-r--r-- | libavcodec/h264dec.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index b6c51ed1e2..8673d5a2c2 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -414,10 +414,16 @@ static av_cold int h264_decode_init(AVCodecContext *avctx) ret = ff_h264_decode_extradata(avctx->extradata, avctx->extradata_size, &h->ps, &h->is_avc, &h->nal_length_size, avctx->err_recognition, avctx); - if (ret < 0) { - h264_decode_end(avctx); - return ret; - } + if (ret < 0) { + int explode = avctx->err_recognition & AV_EF_EXPLODE; + av_log(avctx, explode ? AV_LOG_ERROR: AV_LOG_WARNING, + "Error decoding the extradata\n"); + if (explode) { + h264_decode_end(avctx); + return ret; + } + ret = 0; + } } } |