diff options
authorGiuseppe D'Angelo <>2019-10-10 16:07:55 +0200
committerGiuseppe D'Angelo <>2019-10-11 19:57:28 +0200
commit58c4fa1061d07d35805bbb5cc8af7b36129d4509 (patch)
parent7fbadeddc14304d595aeaaaa6d398dcb21d86404 (diff)
JPEG image handler: drop a use of "volatile"
The reading code protects a local variable with volatile. In this case the only possible reason to apply volatile seems to be protecting the variable across the subsequent setjmp/longjmp. However, the variable is never accessed after the longjmp (the function returns). So, drop the volatile. Change-Id: Ibecb11a9edcc6027b2fd52b555287ad53375a5d0 Reviewed-by: Allan Sandfeld Jensen <> Reviewed-by: Edward Welbourne <>
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
index 1f1675e490..a09e6dfd5a 100644
--- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp
+++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
@@ -248,13 +248,12 @@ static bool ensureValidImage(QImage *dest, struct jpeg_decompress_struct *info,
static bool read_jpeg_image(QImage *outImage,
QSize scaledSize, QRect scaledClipRect,
- QRect clipRect, volatile int inQuality,
+ QRect clipRect, int quality,
Rgb888ToRgb32Converter converter,
j_decompress_ptr info, struct my_error_mgr* err )
if (!setjmp(err->setjmp_buffer)) {
// -1 means default quality.
- int quality = inQuality;
if (quality < 0)
quality = 75;