diff mbox series

[FFmpeg-devel,1/2] avcodec/rv60: negative qp guard

Message ID e21eb89b9b108be234005c7031a6cf903f0648aa.1730860181.git.pross@xvid.org
State New
Headers show
Series [FFmpeg-devel,1/2] avcodec/rv60: negative qp guard | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Peter Ross Nov. 6, 2024, 2:29 a.m. UTC
Fixes CID 1634472
---
 libavcodec/rv60dec.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/rv60dec.c b/libavcodec/rv60dec.c
index d0cc10253b..d68fa66fa7 100644
--- a/libavcodec/rv60dec.c
+++ b/libavcodec/rv60dec.c
@@ -2270,6 +2270,8 @@  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)
+            return AVERROR_INVALIDDATA;
         sel_qp = calc_sel_qp(s->osvquant, qp);
 
         memset(thread.coded_blk, 0, sizeof(thread.coded_blk));