Skip to content

Fix random heap as pixels noise#297

Open
kukuruzka165 wants to merge 1 commit intodesktop-app:masterfrom
kukuruzka165:noisefix
Open

Fix random heap as pixels noise#297
kukuruzka165 wants to merge 1 commit intodesktop-app:masterfrom
kukuruzka165:noisefix

Conversation

@kukuruzka165
Copy link
Copy Markdown
Contributor

if (!reader.read(&result.image) || result.image.isNull()) {
return {};
}
if (reader.error() != QImageReader::UnknownError) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has no sense, if there's any error, QImageReader::read checked in the previous condition will return false

result.format = reader.format().toLower();
result.animated = reader.supportsAnimation()
&& (reader.imageCount() > 1);
result.image = QImage(size, QImage::Format_ARGB32_Premultiplied);
Copy link
Copy Markdown
Contributor

@ilya-fedin ilya-fedin Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which format we're fixing for? If it's JPEG, I checked QJpegHandler code and it always re-allocates the image if either size or format isn't expected. And it never expects QImage::Format_ARGB32_Premultiplied. So if we're fixing for jpeg, this has no sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants