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

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new ec4608d8fc avcodec/pngdec: preserve packet metadata
ec4608d8fc is described below

commit ec4608d8fc08e224074693d7151c65c3ababa429
Author:     qaq03101 <[email protected]>
AuthorDate: Tue Aug 11 15:54:32 2026 +0800
Commit:     michaelni <[email protected]>
CommitDate: Wed Sep 16 21:20:25 2026 +0000

    avcodec/pngdec: preserve packet metadata
    
    Swapping metadata dictionaries drops entries already copied from
    packet side data, including image2 source path metadata.
    
    Copy PNG metadata into the output frame instead.
    
    Reported-by: Icecream95
    Fixes #23390.
    Signed-off-by: qaq03101 <[email protected]>
---
 libavcodec/pngdec.c               | 6 +++++-
 tests/fate/image.mak              | 3 ++-
 tests/ref/fate/png-frame-metadata | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 0030fa5615..3af36f47e1 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -1865,7 +1865,11 @@ static int output_frame(PNGDecContext *s, AVFrame *f)
         stereo3d->flags = s->stereo_mode ? 0 : AV_STEREO3D_FLAG_INVERT;
     }
 
-    FFSWAP(AVDictionary*, f->metadata, s->frame_metadata);
+    ret = av_dict_copy(&f->metadata, s->frame_metadata, 0);
+    if (ret < 0)
+        goto fail;
+
+    av_dict_free(&s->frame_metadata);
 
     return 0;
 fail:
diff --git a/tests/fate/image.mak b/tests/fate/image.mak
index a20fe183dc..b855588fb5 100644
--- a/tests/fate/image.mak
+++ b/tests/fate/image.mak
@@ -415,7 +415,8 @@ FATE_PNG += fate-png-int-rgb24
 fate-png-int-rgb24: CMD = framecrc -i 
$(TARGET_SAMPLES)/png1/lena-int_rgb24.png -sws_flags +accurate_rnd+bitexact
 
 FATE_PNG_PROBE += fate-png-frame-metadata
-fate-png-frame-metadata: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries 
frame_tags \
+fate-png-frame-metadata: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -f image2 \
+    -export_path_metadata 1 -show_entries 
frame_tags=gamma,Software,lavf.image2dec.source_basename \
     -i $(TARGET_SAMPLES)/filter/pixelart0.png
 
 FATE_PNG_PROBE += fate-png-side-data
diff --git a/tests/ref/fate/png-frame-metadata 
b/tests/ref/fate/png-frame-metadata
index 7c6d1916eb..faae1348f5 100644
--- a/tests/ref/fate/png-frame-metadata
+++ b/tests/ref/fate/png-frame-metadata
@@ -1,4 +1,5 @@
 [FRAME]
+TAG:lavf.image2dec.source_basename=pixelart0.png
 TAG:gamma=45455/100000
 TAG:Software=GLDPNG ver 3.4
 [/FRAME]

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to