PR #22892 opened by Ramiro Polla (ramiro)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22892
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22892.patch


>From f090849f425acd9d6c9589e0ed62f8e29a614ca8 Mon Sep 17 00:00:00 2001
From: Ramiro Polla <[email protected]>
Date: Mon, 20 Apr 2026 20:54:31 +0200
Subject: [PATCH 1/2] avcodec/webp: use av_fourcc2str() to print fourccs

---
 libavcodec/webp.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 62967a394d..68f843139c 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -1374,8 +1374,6 @@ static int webp_decode_frame(AVCodecContext *avctx, 
AVFrame *p,
     }
 
     while (bytestream2_get_bytes_left(&gb) > 8) {
-        char chunk_str[5] = { 0 };
-
         chunk_type = bytestream2_get_le32(&gb);
         chunk_size = bytestream2_get_le32(&gb);
         if (chunk_size == UINT32_MAX)
@@ -1516,15 +1514,13 @@ exif_end:
         case MKTAG('A', 'N', 'I', 'M'):
         case MKTAG('A', 'N', 'M', 'F'):
         case MKTAG('X', 'M', 'P', ' '):
-            AV_WL32(chunk_str, chunk_type);
             av_log(avctx, AV_LOG_WARNING, "skipping unsupported chunk: %s\n",
-                   chunk_str);
+                   av_fourcc2str(chunk_type));
             bytestream2_skip(&gb, chunk_size);
             break;
         default:
-            AV_WL32(chunk_str, chunk_type);
             av_log(avctx, AV_LOG_VERBOSE, "skipping unknown chunk: %s\n",
-                   chunk_str);
+                   av_fourcc2str(chunk_type));
             bytestream2_skip(&gb, chunk_size);
             break;
         }
-- 
2.52.0


>From 4774a0ef8454775750b374f8ed754e73bab627a2 Mon Sep 17 00:00:00 2001
From: Ramiro Polla <[email protected]>
Date: Thu, 9 Apr 2026 18:48:12 +0200
Subject: [PATCH 2/2] avcodec/webp: remove write-only lossless field from
 WebPContext

---
 libavcodec/webp.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 68f843139c..39fdd961a1 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -207,7 +207,6 @@ typedef struct WebPContext {
     int has_iccp;                       /* set after an ICCP chunk has been 
processed */
     int width;                          /* image width */
     int height;                         /* image height */
-    int lossless;                       /* indicates lossless or lossy */
 
     int nb_transforms;                  /* number of transforms */
     enum TransformType transforms[4];   /* transformations used in the image, 
in order */
@@ -1093,10 +1092,8 @@ static int vp8_lossless_decode_frame(AVCodecContext 
*avctx, AVFrame *p,
     WebPContext *s = avctx->priv_data;
     int w, h, ret, i, used;
 
-    if (!is_alpha_chunk) {
-        s->lossless = 1;
+    if (!is_alpha_chunk)
         avctx->pix_fmt = AV_PIX_FMT_ARGB;
-    }
 
     ret = init_get_bits8(&s->gb, data_start, data_size);
     if (ret < 0)
@@ -1309,7 +1306,6 @@ static int vp8_lossy_decode_frame(AVCodecContext *avctx, 
AVFrame *p,
         s->v.actually_webp = 1;
     }
     avctx->pix_fmt = s->has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
-    s->lossless = 0;
 
     if (data_size > INT_MAX) {
         av_log(avctx, AV_LOG_ERROR, "unsupported chunk size\n");
-- 
2.52.0

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

Reply via email to