From 0380da9a54681a5a134902c8fb115f3e41fd3824 Mon Sep 17 00:00:00 2001 From: Dan Glastonbury Date: Tue, 11 Mar 2014 11:01:00 +1000 Subject: [PATCH] Bug 982475 - Prevent SwapRAndBComponents derefencing NULL pointer. r=jgilbert --- gfx/gl/GLReadTexImageHelper.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gfx/gl/GLReadTexImageHelper.cpp b/gfx/gl/GLReadTexImageHelper.cpp index 778a441411e..9925baf5cb4 100644 --- a/gfx/gl/GLReadTexImageHelper.cpp +++ b/gfx/gl/GLReadTexImageHelper.cpp @@ -209,6 +209,10 @@ GetActualReadFormats(GLContext* gl, static void SwapRAndBComponents(DataSourceSurface* surf) { uint8_t *row = surf->GetData(); + if (!row) { + MOZ_ASSERT(false, "SwapRAndBComponents: Failed to get data from DataSourceSurface."); + return; + } size_t rowBytes = surf->GetSize().width*4; size_t rowHole = surf->Stride() - rowBytes;