Closed Bug 201596 Opened 22 years ago Closed 22 years ago

nsScrollPortView::ScrollTo could trigger a crash if new PRInt32[SMOOTH_SCROLL_FRAMES*2]; failed

Categories

(Core :: Web Painting, defect)

defect
Not set
trivial

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch minor changes to handle oom (obsolete) — Splinter Review
Attachment #120161 - Flags: superreview?(roc+moz)
Attachment #120161 - Flags: review?(roc+moz)
+ if (!mSmoothScroll->mScrollAnimationTimer || !mSmoothScroll->mVelocities) { If allocation of mScrollAnimationTimer failed, but mVelocities suceeded, then you'll leak mVelocities here. Can we just convert mVelocities to an array member of the SmoothScroll class so we don't have to allocate it?
it doesn't leak because the desctructor cleans up :) as for changing it to be a member instead of dynamically allocated, i'm not sure.
Status: NEW → ASSIGNED
Yeah, let's just make it a member. You can move the definition of "class SmoothScroll" into nsScrollingView.cpp (replace it with a toplevel "class SmoothScroll;" in nsScrollingView.h) then change the definition of "mVelocities" to "PRInt32 mVelocities[2*SMOOTH_SCROLL_FRAMES];" and remove the dynamic allocation/deallocation.
Attachment #120161 - Attachment is obsolete: true
Attachment #120161 - Flags: superreview?(roc+moz)
Attachment #120161 - Flags: review?(roc+moz)
Attachment #120738 - Flags: superreview?(roc+moz)
Attachment #120738 - Flags: review?(roc+moz)
Attachment #120738 - Flags: superreview?(roc+moz)
Attachment #120738 - Flags: superreview+
Attachment #120738 - Flags: review?(roc+moz)
Attachment #120738 - Flags: review+
checked in
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: