summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-11-21 14:22:29 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-12-04 20:03:25 +0100
commitff66da9af457766672a3d9a7d96121d287fb8929 (patch)
tree409b6afb5fca970052a31e66b8e57a163daa3c6b
parentc2e358c520272032f67c91e1f593e08015c73302 (diff)
downloadUXP-ff66da9af457766672a3d9a7d96121d287fb8929.tar
UXP-ff66da9af457766672a3d9a7d96121d287fb8929.tar.gz
UXP-ff66da9af457766672a3d9a7d96121d287fb8929.tar.lz
UXP-ff66da9af457766672a3d9a7d96121d287fb8929.tar.xz
UXP-ff66da9af457766672a3d9a7d96121d287fb8929.zip
Fix blank pixel color for truncated GIFs
-rw-r--r--image/decoders/nsGIFDecoder2.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/image/decoders/nsGIFDecoder2.cpp b/image/decoders/nsGIFDecoder2.cpp
index efa145144..6f2be1fa1 100644
--- a/image/decoders/nsGIFDecoder2.cpp
+++ b/image/decoders/nsGIFDecoder2.cpp
@@ -212,10 +212,16 @@ nsGIFDecoder2::BeginImageFrame(const IntRect& aFrameRect,
} else {
// This is an animation frame (and not the first). To minimize the memory
// usage of animations, the image data is stored in paletted form.
+ //
+ // We should never use paletted surfaces with a draw target directly, so
+ // the only practical difference between B8G8R8A8 and B8G8R8X8 is the
+ // cleared pixel value if we get truncated. We want 0 in that case to
+ // ensure it is an acceptable value for the color map as was the case
+ // historically.
MOZ_ASSERT(Size() == OutputSize());
pipe =
SurfacePipeFactory::CreatePalettedSurfacePipe(this, Size(), aFrameRect,
- format,
+ SurfaceFormat::B8G8R8A8,
aDepth, Some(animParams),
pipeFlags);
}