Bug 775794. r=jgilbert
authorBrian R. Bondy <netzen@gmail.com>
Sat, 21 Jul 2012 13:57:35 -0400
changeset 100037 5bd9db1381a62e26aec0b1f9c294d3b34f5e9c0a
parent 100036 4c632ce7134408a1c0ab644184b10a0f8210af7b
child 100038 549e0303a2df62da04ab96f25b74924dd21696a5
push id23162
push userryanvm@gmail.com
push dateSat, 21 Jul 2012 21:38:42 +0000
treeherdermozilla-central@defbe00ca091 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs775794
milestone17.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 775794. r=jgilbert
image/decoders/nsICODecoder.cpp
--- a/image/decoders/nsICODecoder.cpp
+++ b/image/decoders/nsICODecoder.cpp
@@ -132,16 +132,18 @@ bool nsICODecoder::FillBitmapFileHeaderB
 // this difference though.
 bool
 nsICODecoder::FixBitmapHeight(PRInt8 *bih) 
 {
   // Get the height from the BMP file information header
   PRInt32 height;
   memcpy(&height, bih + 8, sizeof(height));
   height = LITTLE_TO_NATIVE32(height);
+  // BMPs can be stored inverted by having a negative height
+  height = abs(height);
 
   // The bitmap height is by definition * 2 what it should be to account for
   // the 'AND mask'. It is * 2 even if the `AND mask` is not present.
   height /= 2;
 
   if (height > 256) {
     return false;
   }