From 957eb2323a924aa0b148927889eae581185c367b Mon Sep 17 00:00:00 2001 From: Dale Curtis Date: Tue, 7 Jan 2025 00:11:49 +0000 Subject: [PATCH] avcodec/h264dec: make slice header parse errors fatal under AV_EF_EXPLODE This fixes timeout issues and seems like it was intended since the line emits an error log. Signed-off-by: Dale Curtis Signed-off-by: Marth64 --- libavcodec/h264dec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 8feb5558aa..45ebe2656d 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -742,8 +742,10 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) nal->type, nal->size_bits); } - if (err < 0) { + if (err < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE)) { av_log(h->avctx, AV_LOG_ERROR, "decode_slice_header error\n"); + ret = err; + goto end; } }