aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-06-01 13:49:32 +0200
committerAnton Khirnov <anton@khirnov.net>2024-06-11 17:39:35 +0200
commit90fc331b0fc6f7d9c31f9e6d543102ba7fe02daf (patch)
treec971a8cc5e65d31c2618ea17842a53b6e07d8035
parent8eb134f4f9449fef6f1a992361e46a7f321f3b1d (diff)
downloadffmpeg-90fc331b0fc6f7d9c31f9e6d543102ba7fe02daf.tar.gz
lavc/hevcdec: only ignore INVALIDDATA in decode_nal_unit()
All other errors should cause a failure, regardless of the value of err_recognition. Also, print a warning message when skipping invalid NAL units.
-rw-r--r--libavcodec/hevc/hevcdec.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index d599373c9d..2c26d397df 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -3206,9 +3206,13 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal)
return 0;
fail:
- if (s->avctx->err_recognition & AV_EF_EXPLODE)
- return ret;
- return 0;
+ if (ret == AVERROR_INVALIDDATA &&
+ !(s->avctx->err_recognition & AV_EF_EXPLODE)) {
+ av_log(s->avctx, AV_LOG_WARNING,
+ "Skipping invalid undecodable NALU: %d\n", s->nal_unit_type);
+ return 0;
+ }
+ return ret;
}
static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)