Fix divide-by-zero crash
ClosedPublic

Authored by ngraham on Jan 8 2020, 4:23 PM.

Details

Summary

Bug was introduced in D21398.

BUG: 414631
FIXED-IN: 19.12.2

Test Plan

Compile only and verify normal functionality only; can't reproduce the issue so can't
test the fix

Diff Detail

Repository
R260 Gwenview
Branch
fix-crash (branched from release/19.12)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 20851
Build 20869: arc lint + arc unit
ngraham created this revision.Jan 8 2020, 4:23 PM
Restricted Application added a project: Gwenview. · View Herald TranscriptJan 8 2020, 4:23 PM
ngraham requested review of this revision.Jan 8 2020, 4:23 PM
tommo added a subscriber: tommo.Jan 9 2020, 6:48 AM

Oh, good spot. I haven't considered malformed zero-size thumbnails, indeed.
In this case, you should also check for prevWidth > 0, otherwise scale
would become zero and we would have another div-by-zero.

ngraham updated this revision to Diff 73132.Jan 9 2020, 3:29 PM

Also check prevWidth

tommo added a comment.Jan 9 2020, 4:21 PM

LGTM, thx!

This revision was not accepted when it landed; it landed in state Needs Review.Jan 9 2020, 5:09 PM
This revision was automatically updated to reflect the committed changes.