diff mbox series

[FFmpeg-devel,24/29] avcodec/h2645_sei: use ff_frame_new_side_data_from_buf

Message ID 20240304130657.30631-24-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>

For consistency, even though this cannot be overriden at the packet
level.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
 libavcodec/h2645_sei.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/h2645_sei.c b/libavcodec/h2645_sei.c
index cb6be0594b..56539608cd 100644
--- a/libavcodec/h2645_sei.c
+++ b/libavcodec/h2645_sei.c
@@ -35,6 +35,7 @@ 
 
 #include "atsc_a53.h"
 #include "avcodec.h"
+#include "decode.h"
 #include "dynamic_hdr_vivid.h"
 #include "get_bits.h"
 #include "golomb.h"
@@ -607,12 +608,11 @@  int ff_h2645_sei_to_frame(AVFrame *frame, H2645SEI *sei,
         H2645SEIUnregistered *unreg = &sei->unregistered;
 
         if (unreg->buf_ref[i]) {
-            AVFrameSideData *sd = av_frame_new_side_data_from_buf(frame,
+            int ret = ff_frame_new_side_data_from_buf(avctx, frame,
                     AV_FRAME_DATA_SEI_UNREGISTERED,
-                    unreg->buf_ref[i]);
-            if (!sd)
-                av_buffer_unref(&unreg->buf_ref[i]);
-            unreg->buf_ref[i] = NULL;
+                    &unreg->buf_ref[i], NULL);
+            if (ret < 0)
+                return ret;
         }
     }
     sei->unregistered.nb_buf_ref = 0;