Hi

On Fri, Nov 07, 2025 at 10:19:27PM +0100, Reaxx via ffmpeg-devel wrote:
> Thanks for reviewing and applying the patch. Apologies for the incorrect
> commit message , I appreciate you correcting it. Thanks again

actually, can you check if my commit message is correct before i apply it ?

commit 3adc44bce403bf0841d7c1a933f2635037a762f8 (HEAD -> master)
Author: oblivionsage <[email protected]>
Date:   Fri Nov 7 18:08:14 2025 +0100

    avcodec/rv60dec: add upper bound check for qp

    The quantization parameter (qp) can exceed 63 when the base value
    from frame header (0-63) is combined with the offset from slice data
    (up to +2), resulting in qp=65. This causes out-of-bounds access to
    the rv60_qp_to_idx[64] array in decode_cbp8(), decode_cbp16(), and
    get_c4x4_set().

    Fixes: Out-of-bounds read
    Signed-off-by: oblivionsage <[email protected]>

    No testsample is available

    This is related to 61cbcaf93f3b2e10124f4c63ce7cd8dad6505fb2 and 
clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5160167345291264
    which fixed rv60_qp_to_idx[qp + 32] out of array access
    These 2 checks are not redundant and neither covers the cases of the other

    Signed-off-by: Michael Niedermayer <[email protected]>

diff --git a/libavcodec/rv60dec.c b/libavcodec/rv60dec.c
index 33728e33a06..b7b4f46512e 100644
--- a/libavcodec/rv60dec.c
+++ b/libavcodec/rv60dec.c
@@ -2265,7 +2265,7 @@ static int decode_slice(AVCodecContext *avctx, void 
*tdata, int cu_y, int thread
             ff_thread_progress_await(&s->progress[cu_y - 1], cu_x + 2);

         qp = s->qp + read_qp_offset(&gb, s->qp_off_type);
-        if (qp < 0) {
+        if (qp < 0 || qp >= 64) {
             ret = AVERROR_INVALIDDATA;
             break;


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact

Attachment: signature.asc
Description: PGP signature

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

Reply via email to