This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 163b9b6c7ef66428f06f197ee56395f832545816
Author:     Zhao Zhili <[email protected]>
AuthorDate: Fri Mar 20 10:38:19 2026 +0800
Commit:     Zhao Zhili <[email protected]>
CommitDate: Fri Mar 20 10:47:13 2026 +0800

    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);

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to