mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-06-03 17:08:08 -04:00
heif: reject invalid files with zero size
This commit is contained in:
parent
4c6d2b92b6
commit
c1c57d9a11
@ -449,6 +449,14 @@ bool HEIFHandler::ensureDecoder()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((heif_image_handle_get_width(handle) == 0) || (heif_image_handle_get_height(handle) == 0)) {
|
||||||
|
m_parseState = ParseHeicError;
|
||||||
|
heif_image_handle_release(handle);
|
||||||
|
heif_context_free(ctx);
|
||||||
|
qWarning() << "HEIC image has zero dimension";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const bool hasAlphaChannel = heif_image_handle_has_alpha_channel(handle);
|
const bool hasAlphaChannel = heif_image_handle_has_alpha_channel(handle);
|
||||||
const int bit_depth = heif_image_handle_get_luma_bits_per_pixel(handle);
|
const int bit_depth = heif_image_handle_get_luma_bits_per_pixel(handle);
|
||||||
heif_chroma chroma;
|
heif_chroma chroma;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user