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

Git pushed a commit to branch release/9.0
in repository ffmpeg.

commit c947607bef9494a8c229f7eeef79b5fccc731c7e
Author:     Kacper Michajłow <[email protected]>
AuthorDate: Thu Sep 10 12:57:13 2026 +0200
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Sep 17 02:53:24 2026 +0200

    avcodec/dovi_rpudec: strip zero padding
    
    ef167512ab changed to parse RPU forward as far as we can go, but also
    removed zero padding trimming, so the ext block size check on files with
    big padding could trigger now. Restore the trailing zero strip. Note
    that this does care only about zero padded NALs, while we have seen some
    files with garbage padding, they are not considered here.
    
    The only real way to find the end of RPU is to compute CRC32, as the
    0x80 byte may be ambiguous. But we don't want that, and most (all) files
    don't need that.
    
    Also adjust the ext block remaining size check to minimal possible
    (block with 0 size).
    
    Fixes: https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/24428
    Signed-off-by: Kacper Michajłow <[email protected]>
    (cherry picked from commit 22b96de8034f5441f0e407184269c60310f0142a)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/dovi_rpudec.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dovi_rpudec.c b/libavcodec/dovi_rpudec.c
index ba4e7cd214..00005049be 100644
--- a/libavcodec/dovi_rpudec.c
+++ b/libavcodec/dovi_rpudec.c
@@ -405,6 +405,9 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, 
size_t rpu_size,
         VALIDATE(rpu[0], 25, 25); /* NAL prefix */
         rpu++;
         rpu_size--;
+        /* Strip trailing padding zero bytes */
+        while (rpu_size && !rpu[rpu_size - 1])
+            rpu_size--;
     }
 
     if ((ret = init_get_bits8(gb, rpu, rpu_size)) < 0)
@@ -710,7 +713,8 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, 
size_t rpu_size,
             return ret;
         }
 
-        if (get_bits_left(gb) > 48 /* padding + CRC32 + terminator */) {
+        /* ue(1) + ue(0) + level + CRC32 + terminator */
+        if (get_bits_left(gb) >= 3 + 1 + 8 + 32 + 8) {
             if ((ret = parse_ext_blocks(s, gb, 2, dm_compression, 
err_recognition)) < 0) {
                 ff_dovi_ctx_unref(s);
                 return ret;

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to