Commit ba6d9a5ccc for ffmpeg

commit ba6d9a5ccc2cd5e4b701fcdd3ac703e31c9709ac
Author: Michael Niedermayer <michael@niedermayer.cc>
Date:   Tue Oct 6 23:35:27 2026 +0200

    avformat/rtpenc_vc2hq: Stop at the picture end in the quantization matrix loop

    Fixes: Timeout
    Fixes: 6xQwaeAd0XlH
    Timeout Replicated through UnModified FFmpeg (-strict experimental) with time measurement
    Found during triage of the security report nd3rLqSpKgo5

diff --git a/libavformat/rtpenc_vc2hq.c b/libavformat/rtpenc_vc2hq.c
index a48526b61b..754e2098d5 100644
--- a/libavformat/rtpenc_vc2hq.c
+++ b/libavformat/rtpenc_vc2hq.c
@@ -80,6 +80,8 @@ static int send_picture(AVFormatContext *ctx, const uint8_t *buf, int size, int
     get_interleaved_ue_golomb(&gc);
     for(lvl = 0; lvl < wavelet_depth; lvl++)
     {
+        if (get_bits_left(&gc) < 0)
+            return AVERROR_INVALIDDATA;
         get_interleaved_ue_golomb(&gc);
         get_interleaved_ue_golomb(&gc);
         get_interleaved_ue_golomb(&gc);