Bug 898028 - Fix crash @ gfxUtils::ConvertBGRAtoRGBA(). r=jgilbert
authorChris Kitching <ckitching@mozilla.com>
Mon, 29 Jul 2013 16:24:57 -0400
changeset 152725 ab6b62fd42354a6556fb15c6f79cc6dfca52fdc7
parent 152724 1774aaaad96a25a102a86bc611e113fece8755d5
child 152726 ebc3baa2b9cba97c036f55c409f32fb864116643
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs898028
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 898028 - Fix crash @ gfxUtils::ConvertBGRAtoRGBA(). r=jgilbert
gfx/thebes/gfxUtils.cpp
--- a/gfx/thebes/gfxUtils.cpp
+++ b/gfx/thebes/gfxUtils.cpp
@@ -148,18 +148,18 @@ gfxUtils::ConvertBGRAtoRGBA(gfxImageSurf
                aSourceSurface->Width()  == aDestSurface->Width() &&
                aSourceSurface->Height() == aDestSurface->Height() &&
                aSourceSurface->Stride() == aDestSurface->Stride(),
                "Source and destination surfaces don't have identical characteristics");
 
     MOZ_ASSERT(aSourceSurface->Stride() == aSourceSurface->Width() * 4,
                "Source surface stride isn't tightly packed");
 
-    MOZ_ASSERT(aSourceSurface->Format() == gfxASurface::ImageFormatARGB32,
-               "Surfaces must be ARGB32");
+    MOZ_ASSERT(aSourceSurface->Format() == gfxASurface::ImageFormatARGB32 || aSourceSurface->Format() == gfxASurface::ImageFormatRGB24,
+               "Surfaces must be ARGB32 or RGB24");
 
     uint8_t *src = aSourceSurface->Data();
     uint8_t *dst = aDestSurface->Data();
 
     uint32_t dim = aSourceSurface->Width() * aSourceSurface->Height();
     uint8_t *srcEnd = src + 4*dim;
 
     if (src == dst) {