Commit e23be4d5a1 for ffmpeg
commit e23be4d5a11f380cb842622a08416af95b8e523b
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Tue Oct 6 07:31:52 2026 +0200
avformat/rtpenc_vc2hq: Limit the bit reader to the transform parameters
Fixes: NULL pointer dereference
Fixes: nd3rLqSpKgo5
Fixes: AISLE-2026-0111-00571
NULL pointer dereference Replicated through UnModified FFmpeg with ASAN,UBSAN
Found-by: Joshua Rogers <joshua.rogers@aisle.com>
diff --git a/libavformat/rtpenc_vc2hq.c b/libavformat/rtpenc_vc2hq.c
index eb48233598..a48526b61b 100644
--- a/libavformat/rtpenc_vc2hq.c
+++ b/libavformat/rtpenc_vc2hq.c
@@ -69,7 +69,7 @@ static int send_picture(AVFormatContext *ctx, const uint8_t *buf, int size, int
size -= DIRAC_PIC_NR_SIZE;
second_field = interlaced && (pic_nr & 0x01);
- init_get_bits(&gc, buf, 8 * size);
+ init_get_bits8(&gc, buf, FFMIN(size, UINT16_MAX));
get_interleaved_ue_golomb(&gc); /* wavelet_idx */
wavelet_depth = get_interleaved_ue_golomb(&gc);
get_interleaved_ue_golomb(&gc); /* num_x */