Closed Bug 1225137 Opened 10 years ago Closed 10 years ago

ScrollbarActivity segfaults on a division-by-zero if the scrollbar fade pref is set to zer0

Categories

(Core :: Layout, defect)

All
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: kats, Assigned: kats)

References

Details

Attachments

(1 file)

In bug 1223928 I enabled the gecko scrollbar for Fennec and copied over the relevant prefs from B2G. However it crashed because of the division-by-zero at [1]. This same line runs on B2G also, but the division by zero returns infinity instead. I assume this is because TimeDuration is kept as an int on Fennec but turned into a float on B2G. Still, this seems bad and we should avoid the division by zero. [1] https://dxr.mozilla.org/mozilla-central/rev/bc74dbdea094059d5f1d353a2585b4f6352b6ec4/layout/generic/ScrollbarActivity.cpp#366
Attached patch PatchSplinter Review
Attachment #8687953 - Flags: review?(spohl.mozilla.bugs)
OS: Unspecified → Android
Hardware: Unspecified → All
Comment on attachment 8687953 [details] [diff] [review] Patch Review of attachment 8687953 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/generic/ScrollbarActivity.cpp @@ +366,5 @@ > + // Avoid division by zero if mScrollbarFadeDuration is zero, just jump > + // to the end of the fade animation > + double progress = mScrollbarFadeDuration > + ? ((aTime - mFadeBeginTime) / FadeDuration()) > + : 1.0f; nit: we can drop the 'f' here
Attachment #8687953 - Flags: review?(spohl.mozilla.bugs) → review+
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #0) \> at [1]. This same line runs on B2G also, but the division by zero returns > infinity instead. I assume this is because TimeDuration is kept as an int on > Fennec but turned into a float on B2G. Still, this seems bad and we should > avoid the division by zero. I had pushed this same pref flip to try a while back when I looked into fennec scrollbars. I had assumed the div by zero was because the scrollbars are styled display: none on fennec, but I never looked into it, so I could be totally wrong.
In my case I made the gecko scrollbars display on fennec, so I don't think it's related to display:none.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: