The branch, master has been updated
       via  ae149301762b0a7f94400a5aa97b9ae309cb5d6a (commit)
       via  d1a7a20cb130e1028b7bf3a59ec3b02cfad169da (commit)
      from  a8097d32ae1406e55b4c4e2c746e75f326604a05 (commit)


- Log -----------------------------------------------------------------
commit ae149301762b0a7f94400a5aa97b9ae309cb5d6a
Author:     Raphaël Zumer <[email protected]>
AuthorDate: Fri Aug 22 13:32:48 2025 -0400
Commit:     Derek Buitenhuis <[email protected]>
CommitDate: Tue Aug 26 14:42:47 2025 +0000

    avcodec/webp: simplify special-case handling when building Huffman reader
    
    Signed-off-by: Raphaël Zumer <[email protected]>

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 92179ad282..5776c6d90c 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -275,17 +275,19 @@ static int huff_reader_build_canonical(HuffReader *r, 
const uint8_t *code_length
             lens[idx] = code_lengths[sym];
         }
     }
-    if (nb_codes <= 1) {
-        if (nb_codes == 1) {
-            /* special-case 1 symbol since the vlc reader cannot handle it */
-            r->nb_symbols = 1;
-            r->simple = 1;
-            r->simple_symbols[0] = syms[0];
-            return 0;
-        }
+
+    if (nb_codes == 0) {
         // No symbols
         return AVERROR_INVALIDDATA;
     }
+    if (nb_codes == 1) {
+        // Special-case 1 symbol since the VLC reader cannot handle it
+        r->nb_symbols = 1;
+        r->simple = 1;
+        r->simple_symbols[0] = syms[0];
+        return 0;
+    }
+
     ret = ff_vlc_init_from_lengths(&r->vlc, 8, nb_codes, lens, 1,
                                    syms, 2, 2, 0, VLC_INIT_OUTPUT_LE, logctx);
     if (ret < 0)

commit d1a7a20cb130e1028b7bf3a59ec3b02cfad169da
Author:     Raphaël Zumer <[email protected]>
AuthorDate: Fri Aug 22 12:44:09 2025 -0400
Commit:     Derek Buitenhuis <[email protected]>
CommitDate: Tue Aug 26 14:42:47 2025 +0000

    avcodec/webp: fix incorrectly returning AVERROR_INVALIDDATA when building 
Huffman reader
    
    This corrects an error in commit c33f16d.
    
    Signed-off-by: Raphaël Zumer <[email protected]>

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 0dca130ff3..92179ad282 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -281,6 +281,7 @@ static int huff_reader_build_canonical(HuffReader *r, const 
uint8_t *code_length
             r->nb_symbols = 1;
             r->simple = 1;
             r->simple_symbols[0] = syms[0];
+            return 0;
         }
         // No symbols
         return AVERROR_INVALIDDATA;

-----------------------------------------------------------------------

Summary of changes:
 libavcodec/webp.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)


hooks/post-receive
-- 

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

Reply via email to