X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Frtpdec_jpeg.c;h=397b5cf56c3fbba4b4eea26fb9310d60a1ae4f77;hb=6372c9dc9972318e75a5889ad6c52500b8294099;hp=f3a2060523f2a5ec2a547676c7f46620ce125dfd;hpb=06278265239fe1aa6ef0f70d5e7db72ea5af844a;p=ffmpeg diff --git a/libavformat/rtpdec_jpeg.c b/libavformat/rtpdec_jpeg.c index f3a2060523f..397b5cf56c3 100644 --- a/libavformat/rtpdec_jpeg.c +++ b/libavformat/rtpdec_jpeg.c @@ -193,16 +193,17 @@ static void create_default_qtables(uint8_t *qtables, uint8_t q) { int factor = q; int i; + uint16_t S; factor = av_clip(q, 1, 99); if (q < 50) - q = 5000 / factor; + S = 5000 / factor; else - q = 200 - factor * 2; + S = 200 - factor * 2; for (i = 0; i < 128; i++) { - int val = (default_quantizers[i] * q + 50) / 100; + int val = (default_quantizers[i] * S + 50) / 100; /* Limit the quantizers to 1 <= q <= 255. */ val = av_clip(val, 1, 255);