diff mbox series

[FFmpeg-devel,29/38] avcodec/webp: respect side data preference

Message ID 20240223143115.16521-30-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/38] lavu/opt: cosmetics, change option flags to (1 << N) style | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Feb. 23, 2024, 1:58 p.m. UTC
From: Niklas Haas <git@haasn.dev>

---
 libavcodec/webp.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 54b3fde6dc..9308ea2b69 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -1500,11 +1500,16 @@  exif_end:
                        "VP8X header\n");
 
             s->has_iccp = 1;
-            sd = av_frame_new_side_data(p, AV_FRAME_DATA_ICC_PROFILE, chunk_size);
-            if (!sd)
-                return AVERROR(ENOMEM);
 
-            bytestream2_get_buffer(&gb, sd->data, chunk_size);
+            ret = ff_frame_new_side_data(avctx, p, AV_FRAME_DATA_ICC_PROFILE, chunk_size, &sd);
+            if (ret < 0)
+                return ret;
+
+            if (sd) {
+                bytestream2_get_buffer(&gb, sd->data, chunk_size);
+            } else {
+                bytestream2_skip(&gb, chunk_size);
+            }
             break;
         }
         case MKTAG('A', 'N', 'I', 'M'):