diff mbox series

[FFmpeg-devel,19/29] avcodec/tiff: respect side data preference

Message ID 20240304130657.30631-19-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/29] lavu/opt: factor per-type dispatch out of av_opt_get() | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov March 4, 2024, 1:06 p.m. UTC
From: Niklas Haas <git@haasn.dev>

---
 libavcodec/tiff.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 71cb703821..cb4d378753 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1706,11 +1706,11 @@  static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
         if (bytestream2_get_bytes_left(&gb_temp) < count)
             return AVERROR_INVALIDDATA;
 
-        sd = av_frame_new_side_data(frame, AV_FRAME_DATA_ICC_PROFILE, count);
-        if (!sd)
-            return AVERROR(ENOMEM);
-
-        bytestream2_get_bufferu(&gb_temp, sd->data, count);
+        ret = ff_frame_new_side_data(s->avctx, frame, AV_FRAME_DATA_ICC_PROFILE, count, &sd);
+        if (ret < 0)
+            return ret;
+        if (sd)
+            bytestream2_get_bufferu(&gb_temp, sd->data, count);
         break;
     case TIFF_ARTIST:
         ADD_METADATA(count, "artist", NULL);