Null check to fix crash

Need to make sure that img is not zero.

bug: 6864545
Change-Id: I2a2c5440347681b462abaa5ac9101ddb6137c8c4
merge in jb-mr0-release history after reset to jb-dev
DO NOT MERGE Fix memory leak

 Cherry pick

 Bug: 6952980
 GraphicsContext::createOffscreenContext creates an instance of both
 PlatformGraphicsSkia and GraphicsContext for ImageBuffer. However,
 ImageBuffer will only call delete on the GraphicsContext. In normal
 GC usage, the PlatformGraphicsContext's lifecycle is longer than the
 GCs, and is cleaned up by itself. This will result in leaking the
 PlatformGraphicsSkia context, though. We need to make sure to call
 delete on the PlatformGraphicsSkia context if we were initialized
 with the deleteUs() flag, which is used to indicate just this scenario.

Change-Id: If908dcb44e99568b92ee63d6337ce9f84adc9adf
merge in jb-mr0-release history after reset to jb-dev
DO NOT MERGE Null check

 Cherry pick

 Bug: 6975836
 Fixes a crash in find on page

Change-Id: I20e1597f2f3a381ee693c1bcef944243ca654110
merge in jb-mr0-release history after reset to jb-dev
Merge branch 'jb-mr0-release' of https://android.googlesource.com/platform/external/webkit into aosp-merge
[WebKit] Browsermark DomAdvSearch and DomSearch optimizations

        This patch is a combination of the following optimizations.

        Optimize appendCharactersReplacingEntities

        [Performance] Optimize innerHTML and outerHTML
        https://bugs.webkit.org/show_bug.cgi?id=81214

        Optimize Dromaeo/dom-query.html by caching NodeRareData on Document
        https://bugs.webkit.org/show_bug.cgi?id=90059

        Optimize Dromaeo/dom-attr.html by speeding up Element::getAttribute()
        https://bugs.webkit.org/show_bug.cgi?id=90174

        Change argument types of Element::getAttribute*() from String to AtomicString
        https://bugs.webkit.org/show_bug.cgi?id=90246

Change-Id: Icfb91db2dd02fad36e6ec5edf9c16138da8e6316
[WebKit] Add board specific configuration to enable/disable PLD DOM traversal optimization

Change-Id: I0602b8484ee92333df0498d080452657e39ad211
external/webkit: check element object for NULL

Change-Id: I11ff74169b4ec0017400e9ef9451868ae00c6b1b
avoid memcpy in cpu-upload

Have RasterRenderer render directly onto the
bitmaps in the TransferQueue to avoid a memcpy.

Change-Id: Ib90d13d5b15cee29faf1d3704e4b61f01468c240
Performance enhancement.  Don't process non-visible lines for layout.

Change-Id: Ie2b594afb4f5244e18719e4feea51966ad4745cd
Merge remote-tracking branch 'origin/jellybean' into jb

Conflicts:
	Android.mk