Commit 4d614fd8 by Greg Hartman

Detect undersize buffers being delivered by ANativeWindow

Change-Id: I02f328e7a2ad46877d00d5bc1de1439bebb23802 Reviewed-on: https://swiftshader-review.googlesource.com/3012Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarGreg Hartman <ghartman@google.com>
parent 05e0cd36
......@@ -32,7 +32,6 @@ namespace sw
{
copy(source, format);
nativeWindow->queueBuffer(nativeWindow, buffer, -1);
if (buffer && locked)
{
locked = 0;
......@@ -65,6 +64,13 @@ namespace sw
return NULL;
}
if ((buffer->width < width) || (buffer->height < height))
{
ALOGI("lock failed: buffer of %dx%d too small for window of %dx%d",
buffer->width, buffer->height, width, height);
return NULL;
}
switch(buffer->format)
{
default: ALOGE("Unsupported buffer format %d", buffer->format); ASSERT(false);
......
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