PR #21796 opened by toots
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21796
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21796.patch


>From 835881b39dd7c3de01c68011762b67eebde68aca Mon Sep 17 00:00:00 2001
From: Romain Beauxis <[email protected]>
Date: Thu, 19 Feb 2026 09:35:58 -0600
Subject: [PATCH] libavformat/oggdec.c: fix ogg_{save,restore,reset} w.r.t.
 new_extradata.

---
 libavformat/oggdec.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 18ca3a6f68..04fe15aa94 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -105,8 +105,10 @@ static int ogg_save(AVFormatContext *s)
             memcpy(os->buf, ost->streams[i].buf, os->bufpos);
         else
             ret = AVERROR(ENOMEM);
-        os->new_metadata      = NULL;
-        os->new_metadata_size = 0;
+        os->new_metadata       = NULL;
+        os->new_metadata_size  = 0;
+        os->new_extradata      = NULL;
+        os->new_extradata_size = 0;
     }
 
     ogg->state = ost;
@@ -133,6 +135,7 @@ static int ogg_restore(AVFormatContext *s)
             struct ogg_stream *stream = &ogg->streams[i];
             av_freep(&stream->buf);
             av_freep(&stream->new_metadata);
+           av_freep(&stream->new_extradata);
 
             if (i >= ost->nstreams || !ost->streams[i].private) {
                 free_stream(s, i);
@@ -183,6 +186,8 @@ static int ogg_reset(AVFormatContext *s)
         os->end_trimming = 0;
         av_freep(&os->new_metadata);
         os->new_metadata_size = 0;
+        av_freep(&os->new_extradata);
+        os->new_extradata_size = 0;
     }
 
     ogg->page_pos = -1;
-- 
2.52.0

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

Reply via email to