PR #22556 opened by Zhao Zhili (quink) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22556 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22556.patch
>From eadce304028d59e6280715c5b87736dafe09ab5d Mon Sep 17 00:00:00 2001 From: Zhao Zhili <[email protected]> Date: Fri, 20 Mar 2026 10:37:34 +0800 Subject: [PATCH 1/2] avformat/lcevc: merge duplicate IDR and NON_IDR branches Signed-off-by: Zhao Zhili <[email protected]> --- libavformat/lcevc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libavformat/lcevc.c b/libavformat/lcevc.c index 341d8d1694..f6a5bf1aaa 100644 --- a/libavformat/lcevc.c +++ b/libavformat/lcevc.c @@ -224,11 +224,8 @@ int ff_lcvec_parse_config_record(LCEVCDecoderConfigurationRecord *lvcc, for (int i = 0; i < h2645_pkt.nb_nals; i++) { const H2645NAL *nal = &h2645_pkt.nals[i]; - if (nal->type == LCEVC_IDR_NUT) { - ret = write_nalu(lvcc, pb, nal); - if (ret < 0) - goto fail; - } else if (nal->type == LCEVC_NON_IDR_NUT) { + if (nal->type == LCEVC_IDR_NUT || + nal->type == LCEVC_NON_IDR_NUT) { ret = write_nalu(lvcc, pb, nal); if (ret < 0) goto fail; -- 2.52.0 >From 163b9b6c7ef66428f06f197ee56395f832545816 Mon Sep 17 00:00:00 2001 From: Zhao Zhili <[email protected]> Date: Fri, 20 Mar 2026 10:38:19 +0800 Subject: [PATCH 2/2] avformat/lcevc: return error when no valid NAL units are found ff_lcvec_parse_config_record() returns success before this patch when no IDR or NON_IDR NAL units are found. Signed-off-by: Zhao Zhili <[email protected]> --- libavformat/lcevc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libavformat/lcevc.c b/libavformat/lcevc.c index f6a5bf1aaa..85ea96d22e 100644 --- a/libavformat/lcevc.c +++ b/libavformat/lcevc.c @@ -183,6 +183,7 @@ int ff_lcvec_parse_config_record(LCEVCDecoderConfigurationRecord *lvcc, H2645Packet h2645_pkt = { 0 }; AVIOContext *pb; int ret; + int found; if (size <= 0) return AVERROR_INVALIDDATA; @@ -221,6 +222,7 @@ int ff_lcvec_parse_config_record(LCEVCDecoderConfigurationRecord *lvcc, goto fail; /* look for IDR or NON_IDR */ + found = 0; for (int i = 0; i < h2645_pkt.nb_nals; i++) { const H2645NAL *nal = &h2645_pkt.nals[i]; @@ -229,9 +231,15 @@ int ff_lcvec_parse_config_record(LCEVCDecoderConfigurationRecord *lvcc, ret = write_nalu(lvcc, pb, nal); if (ret < 0) goto fail; + found = 1; } } + if (!found) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + ret = 0; fail: ffio_close_null_buf(pb); -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
