aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/webp.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2024-02-17 21:53:14 +0100
committerAnton Khirnov <anton@khirnov.net>2024-03-08 07:37:56 +0100
commit133cbbe31e7278a13c7603e0bc367b806204d733 (patch)
treed3032fc2bf33fd8208a8f33b426b200f244d30fb /libavcodec/webp.c
parent276be6da9edbf820717448abbdcfaed6f5e19641 (diff)
downloadffmpeg-133cbbe31e7278a13c7603e0bc367b806204d733.tar.gz
avcodec/webp: respect side data preference
Diffstat (limited to 'libavcodec/webp.c')
-rw-r--r--libavcodec/webp.c13
1 files changed, 9 insertions, 4 deletions
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'):