This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 4b5e1d25c343cc8501653f430da9e4a82445afd5
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Wed Apr 15 16:21:28 2026 +0200
Commit:     James Almer <[email protected]>
CommitDate: Thu Apr 16 19:27:03 2026 +0000

    avcodec/decode: Short-circuit side-data processing
    
    Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libavcodec/decode.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 7ad3077521..ac654f1f4c 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1556,15 +1556,17 @@ int ff_decode_frame_props_from_pkt(const AVCodecContext 
*avctx,
     frame->pts          = pkt->pts;
     frame->duration     = pkt->duration;
 
-    ret = side_data_map(frame, pkt->side_data, pkt->side_data_elems, 
ff_sd_global_map);
-    if (ret < 0)
-        return ret;
+    if (pkt->side_data_elems) {
+        ret = side_data_map(frame, pkt->side_data, pkt->side_data_elems, 
ff_sd_global_map);
+        if (ret < 0)
+            return ret;
 
-    ret = side_data_map(frame, pkt->side_data, pkt->side_data_elems, sd);
-    if (ret < 0)
-        return ret;
+        ret = side_data_map(frame, pkt->side_data, pkt->side_data_elems, sd);
+        if (ret < 0)
+            return ret;
 
-    add_metadata_from_side_data(pkt, frame);
+        add_metadata_from_side_data(pkt, frame);
+    }
 
     if (pkt->flags & AV_PKT_FLAG_DISCARD) {
         frame->flags |= AV_FRAME_FLAG_DISCARD;

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

Reply via email to