Commit ceebd297 authored by Eirik Aavitsland's avatar Eirik Aavitsland
Browse files

tiff handler: ensure valid value of the compression option


Bound the value of the compression setting to the possible values of
the QTiffHandler::Compression enum.

Change-Id: I50e1eb8014654d8b4403d7f06e6099661e57562c
Reviewed-by: default avatarAllan Sandfeld Jensen <allan.jensen@qt.io>
parent c2cb9d28
Branches
Tags v5.12.0-beta1
No related merge requests found
Showing with 1 addition and 1 deletion
......@@ -815,7 +815,7 @@ QVariant QTiffHandler::option(ImageOption option) const
void QTiffHandler::setOption(ImageOption option, const QVariant &value)
{
if (option == CompressionRatio && value.type() == QVariant::Int)
d->compression = value.toInt();
d->compression = qBound(0, value.toInt(), 1);
if (option == ImageTransformation) {
int transformation = value.toInt();
if (transformation > 0 && transformation < 8)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment