CID 1500 : Potential NULL poiner dereference.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38140 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2010-08-16 13:37:10 +00:00
parent 3eedbbbf0e
commit a20769b39c

View File

@ -815,12 +815,14 @@ BChannelSlider::_DrawThumbs()
}
}
BPoint drawHere;
BRect bounds(fBacking->Bounds());
drawHere.x = (Bounds().Width() - bounds.Width()) / 2.0;
drawHere.y = (Bounds().Height() - bounds.Height()) - kPadding - fLineFeed;
if (fBacking && fBackingView) {
BPoint drawHere;
BRect bounds(fBacking->Bounds());
drawHere.x = (Bounds().Width() - bounds.Width()) / 2.0;
drawHere.y = (Bounds().Height() - bounds.Height()) - kPadding
- fLineFeed;
if (fBacking->Lock()) {
// Clear the view's background
fBackingView->FillRect(fBackingView->Bounds(), B_SOLID_LOW);
@ -846,8 +848,8 @@ BChannelSlider::_DrawThumbs()
float thumbDelta(ThumbDeltaFor(fCurrentChannel));
if (fIsVertical) {
valueRect.OffsetTo((thumbFrame.Width() - width) / 2.0 +
fCurrentChannel * thumbFrame.Width(),
valueRect.OffsetTo((thumbFrame.Width() - width) / 2.0
+ fCurrentChannel * thumbFrame.Width(),
thumbDelta + thumbFrame.Height() + 2.0);
if (valueRect.bottom > fBackingView->Frame().bottom)
valueRect.OffsetBy(0.0, -(thumbFrame.Height() + 12.0));
@ -874,13 +876,12 @@ BChannelSlider::_DrawThumbs()
fBackingView->Sync();
fBacking->Unlock();
}
}
if (fBacking)
DrawBitmapAsync(fBacking, drawHere);
// fClickDelta is used in MouseMoved()
fClickDelta = drawHere;
// fClickDelta is used in MouseMoved()
fClickDelta = drawHere;
}
}