Commit e460ffdeff for ffmpeg

commit e460ffdeff24460d7d9c8bd95fbc597ff2d4030d
Author: Romain Beauxis <romain.beauxis@gmail.com>
Date:   Thu Nov 26 08:20:01 2026 -0600

    avformat/ogg/muxer: factor out freeing the page list

diff --git a/libavformat/ogg/muxer.c b/libavformat/ogg/muxer.c
index ea16a3bd4d..5c9dedea13 100644
--- a/libavformat/ogg/muxer.c
+++ b/libavformat/ogg/muxer.c
@@ -58,6 +58,19 @@ typedef struct OGGContext {

 static int ogg_write_trailer(AVFormatContext *s);

+static void ogg_free_pages(AVFormatContext *s)
+{
+    OGGContext *ogg = s->priv_data;
+    OGGPageList *p = ogg->page_list;
+
+    while (p) {
+        OGGPageList *next = p->next;
+        av_free(p);
+        p = next;
+    }
+    ogg->page_list = NULL;
+}
+
 static const AVOption options[] = {
     { "serial_offset", "serial number offset, -1 to derive it from the stream headers",
         OFFSET(serial_offset), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, PARAM },
@@ -733,22 +746,13 @@ static int ogg_write_trailer(AVFormatContext *s)

 static void ogg_free(AVFormatContext *s)
 {
-    OGGContext *ogg = s->priv_data;
-    OGGPageList *p = ogg->page_list;
-    int i;
-
-    for (i = 0; i < s->nb_streams; i++) {
+    for (int i = 0; i < s->nb_streams; i++) {
         AVStream *st = s->streams[i];
         if (st->priv_data)
             ogg_cleanup_stream(st);
     }

-    while (p) {
-        OGGPageList *next = p->next;
-        av_free(p);
-        p = next;
-    }
-    ogg->page_list = NULL;
+    ogg_free_pages(s);
 }

 #if CONFIG_OGG_MUXER