avfilter/vf_uspp: Fix qpcount

Fixes: division by zero
Fixes: tiny_16x8.h264
Fixes: W9IyRhjCcQxd
Found-by: zhang xingxing

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer authored and michaelni committed 2026-09-16 19:02:27 +00:00
1 parent 7ac9cb4340
commit 2c05ce65e1
1 file changed
+4 -1
+4 -1
View File
@@ -314,7 +314,10 @@ static void filter(AVFilterContext *ctx, uint8_t *dst[3], uint8_t *src[3],
p->quality = p->qp * FF_QP2LAMBDA;
else {
int qpsum=0;
int qpcount = (height>>4) * (height>>4);
int qpcount = (width>>4) * (height>>4);
qpsum += !qpcount;
qpcount += !qpcount;
for (y = 0; y < (height>>4); y++) {
for (x = 0; x < (width>>4); x++)