Commit a0f955c3 authored by Nathan Zabriskie's avatar Nathan Zabriskie Committed by Commit Bot

Add nullptr check to RasterDecoder::DoWritePixelsINTERNAL

Clusterfuzz picked up a potential error if we can't retrieve shared
memory when deserializing an SkColorSpace.

Bug: 1071441
Change-Id: I9cefd0cf3cee92c2ad2556e914522203f88e282f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2153344Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Commit-Queue: Nathan Zabriskie <nazabris@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#759797}
parent e4a56ee6
...@@ -2290,6 +2290,12 @@ void RasterDecoderImpl::DoWritePixelsINTERNAL(GLint x_offset, ...@@ -2290,6 +2290,12 @@ void RasterDecoderImpl::DoWritePixelsINTERNAL(GLint x_offset,
if (pixels_offset > 0) { if (pixels_offset > 0) {
void* color_space_bytes = void* color_space_bytes =
GetSharedMemoryAs<void*>(shm_id, shm_offset, pixels_offset); GetSharedMemoryAs<void*>(shm_id, shm_offset, pixels_offset);
if (!color_space_bytes) {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glWritePixels",
"Failed to retrieve serialized SkColorSpace.");
return;
}
color_space = SkColorSpace::Deserialize(color_space_bytes, pixels_offset); color_space = SkColorSpace::Deserialize(color_space_bytes, pixels_offset);
if (!color_space) { if (!color_space) {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glWritePixels", LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glWritePixels",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment