Ensure the quantizer value does not exceed 107 to prevent the qscale 
calculation from underflowing or producing invalid results.

Signed-off-by: 0xBat <[email protected]>
---
 libavcodec/eatqi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c
index 421ed51009..2d74139d24 100644
--- a/libavcodec/eatqi.c
+++ b/libavcodec/eatqi.c
@@ -111,6 +111,8 @@ static inline void tqi_idct_put(AVCodecContext *avctx, 
AVFrame *frame,
 
 static void tqi_calculate_qtable(TqiContext *t, int quant)
 {
+    if (quant > 107)
+        quant = 107;
     const int64_t qscale = (215 - 2*quant)*5;
     int i;
 
-- 
2.52.0.windows.1

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

Reply via email to