Merge "crash if getNativeBuffer() called on NULL GraphicBuffer" into lmp-dev

This commit is contained in:
Colin Cross 2014-07-23 19:56:38 +00:00 committed by Android (Google) Code Review
commit 45e695a248

View File

@ -126,6 +126,7 @@ void GraphicBuffer::dumpAllocationsToSystemLog()
ANativeWindowBuffer* GraphicBuffer::getNativeBuffer() const ANativeWindowBuffer* GraphicBuffer::getNativeBuffer() const
{ {
LOG_ALWAYS_FATAL_IF(this == NULL, "getNativeBuffer() called on NULL GraphicBuffer");
return static_cast<ANativeWindowBuffer*>( return static_cast<ANativeWindowBuffer*>(
const_cast<GraphicBuffer*>(this)); const_cast<GraphicBuffer*>(this));
} }