D24367: Some sanity verification
This revision was automatically updated to reflect the committed changes. Closed by commit R287:8562ce18f1ab: Add some sanity and bounds checking (authored by sandsmark). CHANGED PRIOR TO COMMIT https://phabricator.kde.org/D24367?vs=79917=82450#toc REPOSITORY R287 KImageFormats CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D24367?vs=79917=82450 REVISION DETAIL https://phabricator.kde.org/D24367 AFFECTED FILES src/imageformats/exr.cpp src/imageformats/pcx.cpp src/imageformats/pic.cpp src/imageformats/psd.cpp src/imageformats/rgb.cpp src/imageformats/tga.cpp To: sandsmark, aacid, cfeck Cc: kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
D24367: Some sanity verification
aacid accepted this revision. aacid added a comment. This revision is now accepted and ready to land. Looks good to me :) REPOSITORY R287 KImageFormats REVISION DETAIL https://phabricator.kde.org/D24367 To: sandsmark, aacid, cfeck Cc: kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
D24367: Some sanity verification
sandsmark marked 2 inline comments as done. REPOSITORY R287 KImageFormats REVISION DETAIL https://phabricator.kde.org/D24367 To: sandsmark, aacid, cfeck Cc: kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
D24367: Some sanity verification
sandsmark marked an inline comment as done. sandsmark added inline comments. INLINE COMMENTS > cfeck wrote in pcx.cpp:312 > If `p` indeed could be zero, the next statements need to be in an `else` > block (or a add a `return`). good catch, thanks REPOSITORY R287 KImageFormats REVISION DETAIL https://phabricator.kde.org/D24367 To: sandsmark, aacid, cfeck Cc: kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
D24367: Some sanity verification
sandsmark updated this revision to Diff 79917. sandsmark added a comment. Added missing return. REPOSITORY R287 KImageFormats CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D24367?vs=67201=79917 REVISION DETAIL https://phabricator.kde.org/D24367 AFFECTED FILES src/imageformats/exr.cpp src/imageformats/pcx.cpp src/imageformats/pic.cpp src/imageformats/psd.cpp src/imageformats/rgb.cpp src/imageformats/tga.cpp To: sandsmark, aacid, cfeck Cc: kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
D24367: Some sanity verification
cfeck added inline comments. INLINE COMMENTS > pcx.cpp:312 > +qWarning() << "Failed to get scanline for" << y << "might be out > of bounds"; > +} > for (int x = 0; x < header.width(); ++x) { If `p` indeed could be zero, the next statements need to be in an `else` block (or a add a `return`). REPOSITORY R287 KImageFormats REVISION DETAIL https://phabricator.kde.org/D24367 To: sandsmark, aacid, cfeck Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
D24367: Some sanity verification
sandsmark created this revision. sandsmark added reviewers: aacid, cfeck. Herald added a project: Frameworks. Herald added a subscriber: kde-frameworks-devel. sandsmark requested review of this revision. REVISION 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. REPOSITORY R287 KImageFormats REVISION DETAIL https://phabricator.kde.org/D24367 AFFECTED FILES src/imageformats/exr.cpp src/imageformats/pcx.cpp src/imageformats/pic.cpp src/imageformats/psd.cpp src/imageformats/rgb.cpp src/imageformats/tga.cpp To: sandsmark, aacid, cfeck Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns