Some sanity verification
ClosedPublic

Authored by sandsmark on Oct 2 2019, 3:45 PM.

Details

Summary

Since QImage does sanity checking for overflows and stuff wrt. dimensions and depth, check for QImage::isNull() as early as possible to see if there's some funky business going on.

Also tried to add some checks wherever we wrote to "raw" memory.

Test Plan

Unit tests pass, and tested converting some files from https://samples.ffmpeg.org/image-samples/ to pngs, and that seemed to work.

Diff Detail

Repository
R287 KImageFormats
Lint
Lint Skipped
Unit
Unit Tests Skipped
sandsmark created this revision.Oct 2 2019, 3:45 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptOct 2 2019, 3:45 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
sandsmark requested review of this revision.Oct 2 2019, 3:45 PM
cfeck added inline comments.Oct 2 2019, 5:16 PM
src/imageformats/pcx.cpp
312

If p indeed could be zero, the next statements need to be in an else block (or a add a return).

sandsmark updated this revision to Diff 79917.Apr 12 2020, 11:06 AM

Added missing return.

sandsmark marked an inline comment as done.Apr 12 2020, 11:06 AM
sandsmark added inline comments.
src/imageformats/pcx.cpp
312

good catch, thanks

sandsmark marked 2 inline comments as done.Apr 12 2020, 11:07 AM
aacid accepted this revision.Apr 26 2020, 1:59 PM

Looks good to me :)

This revision is now accepted and ready to land.Apr 26 2020, 1:59 PM
This revision was automatically updated to reflect the committed changes.