[FFmpeg-devel] [PATCH v2 2/2] avcodec/hevcdec: detect non-conformant missing refs

Xiaolei Yu dreifachstein at gmail.com
Sat Apr 16 11:31:48 EEST 2022


For cases which prefer rejecting broken bitstreams.
---
 libavcodec/hevc_refs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c
index 84a21991c7..9f8b6022c4 100644
--- a/libavcodec/hevc_refs.c
+++ b/libavcodec/hevc_refs.c
@@ -439,6 +439,8 @@ static int add_candidate_ref(HEVCContext *s, RefPicList *list,
             return 0;
 
         av_log(s->avctx, AV_LOG_ERROR, "Could not find ref with POC %d\n", poc);
+        if (s->avctx->err_recognition & AV_EF_COMPLIANT)
+            return AVERROR_INVALIDDATA;
 
         ref = generate_missing_ref(s, poc);
         if (!ref)
-- 
2.35.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x22AEF7EFBDCEFF03.asc
Type: application/pgp-keys
Size: 656 bytes
Desc: OpenPGP public key
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20220416/b72a3760/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20220416/b72a3760/attachment.sig>


More information about the ffmpeg-devel mailing list