Commit c2652280d8 for ffmpeg

commit c2652280d8ccf735c7c1a7deb9400aae18f518ab
Author: Michael Niedermayer <michael@niedermayer.cc>
Date:   Tue Nov 17 00:34:58 2026 +0100

    avformat/ogg/mapping/theora: handle packets of a stream without parsed headers

    NULL pointer dereference Replicated through UnModified FFmpeg with ASAN

    Fixes: NULL pointer dereference
    Fixes: 586059034/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5205241184976896
    Fixes: 0Dvf25pzuAPd
    Regression since: efae53645158208f65f4d9a5dce95712819639c0

    Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
    Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

diff --git a/libavformat/ogg/mapping/theora.c b/libavformat/ogg/mapping/theora.c
index b720de45fb..58de1fcf1d 100644
--- a/libavformat/ogg/mapping/theora.c
+++ b/libavformat/ogg/mapping/theora.c
@@ -277,7 +277,7 @@ static int theora_packet(AVFormatContext *s, int idx)
     /* A later link's headers are skipped and attached as extradata to the
      * first data packet that follows. That packet keeps its timestamp, which
      * ogg_read_packet() would clear after a stream replacement. */
-    if (type != THEORA_PACKET_DATA && type != THEORA_PACKET_RESERVED) {
+    if (thp && type != THEORA_PACKET_DATA && type != THEORA_PACKET_RESERVED) {
         int i = type - THEORA_PACKET_ID;

         os->replace = 0;
@@ -312,7 +312,8 @@ static int theora_packet(AVFormatContext *s, int idx)

         return 1;
     }
-    theora_check_packet_order(s, thp, type);
+    if (thp)
+        theora_check_packet_order(s, thp, type);

     /* first packet handling
        here we parse the duration of each packet in the first page and compare