Bug 114674 - [BlackBerry] LayerTexture: check if the graphics context is NULL
Summary: [BlackBerry] LayerTexture: check if the graphics context is NULL
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit BlackBerry (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-16 02:27 PDT by Alberto Garcia
Modified: 2013-04-16 09:14 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.51 KB, patch)
2013-04-16 02:31 PDT, Alberto Garcia
no flags Details | Formatted Diff | Diff
Patch (1.66 KB, patch)
2013-04-16 08:44 PDT, Alberto Garcia
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alberto Garcia 2013-04-16 02:27:55 PDT
lockBufferDrawable() can return a null pointer, so it should be checked first.
Comment 1 Alberto Garcia 2013-04-16 02:31:00 PDT
Created attachment 198280 [details]
Patch
Comment 2 Rob Buis 2013-04-16 04:50:48 PDT
Comment on attachment 198280 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=198280&action=review

> Source/WebCore/platform/graphics/blackberry/LayerTexture.cpp:-70
> -    gc->addFillRect(BlackBerry::Platform::FloatRect(0, 0, 1, 1));

Why was this never a problem before? Did the semantics of lockBufferDrawable change?

> Source/WebCore/platform/graphics/blackberry/LayerTexture.cpp:69
> +    if (gc) {

It is WebKit style to put the temp var declaration in the if.
Comment 3 Alberto Garcia 2013-04-16 08:44:43 PDT
Created attachment 198333 [details]
Patch

(In reply to comment #2)
> > Source/WebCore/platform/graphics/blackberry/LayerTexture.cpp:-70
> > -    gc->addFillRect(BlackBerry::Platform::FloatRect(0, 0, 1, 1));
> Why was this never a problem before? Did the semantics of
> lockBufferDrawable change?

They didn't, it can actually return a null pointer. I don't think it's
the case here anyway but see also bug 114005.

> > Source/WebCore/platform/graphics/blackberry/LayerTexture.cpp:69
> > +    if (gc) {
> It is WebKit style to put the temp var declaration in the if.

Ok, fixed.
Comment 4 Rob Buis 2013-04-16 08:46:53 PDT
Comment on attachment 198333 [details]
Patch

LGTM.
Comment 5 WebKit Commit Bot 2013-04-16 09:14:45 PDT
Comment on attachment 198333 [details]
Patch

Clearing flags on attachment: 198333

Committed r148516: <http://trac.webkit.org/changeset/148516>
Comment 6 WebKit Commit Bot 2013-04-16 09:14:47 PDT
All reviewed patches have been landed.  Closing bug.