summaryrefslogtreecommitdiff
path: root/libs/ultrahdr/jpegdecoderhelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ultrahdr/jpegdecoderhelper.cpp')
-rw-r--r--libs/ultrahdr/jpegdecoderhelper.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/ultrahdr/jpegdecoderhelper.cpp b/libs/ultrahdr/jpegdecoderhelper.cpp
index fac90c503d..2a9bc9ac1e 100644
--- a/libs/ultrahdr/jpegdecoderhelper.cpp
+++ b/libs/ultrahdr/jpegdecoderhelper.cpp
@@ -213,6 +213,12 @@ bool JpegDecoderHelper::decode(const void* image, int length, bool decodeToRGBA)
}
}
+ if (cinfo.image_width > kMaxWidth || cinfo.image_height > kMaxHeight) {
+ // constraint on max width and max height is only due to alloc constraints
+ // tune these values basing on the target device
+ return false;
+ }
+
mWidth = cinfo.image_width;
mHeight = cinfo.image_height;