32764144 Security Vulnerability - heap buffer overflow in libgiftranscode.so in colorMap->Colors[colorIndex] am: 6f763fef7a

am: 9f00add2fb

Change-Id: If555818f7f14dcfef35c57c1d3e918ac0f31959a
This commit is contained in:
Tom Taylor
2017-01-17 19:46:53 +00:00
committed by android-build-merger

View File

@@ -384,6 +384,11 @@ bool GifTranscoder::renderImage(GifFileType* gifIn,
for (int y = 0; y < gifIn->Image.Height; y++) { for (int y = 0; y < gifIn->Image.Height; y++) {
for (int x = 0; x < gifIn->Image.Width; x++) { for (int x = 0; x < gifIn->Image.Width; x++) {
GifByteType colorIndex = *getPixel(rasterBits, gifIn->Image.Width, x, y); GifByteType colorIndex = *getPixel(rasterBits, gifIn->Image.Width, x, y);
if (colorIndex >= colorMap->ColorCount) {
LOGE("Color Index %d is out of bounds (count=%d)", colorIndex,
colorMap->ColorCount);
return false;
}
// This image may be smaller than the GIF's "logical screen" // This image may be smaller than the GIF's "logical screen"
int renderX = x + gifIn->Image.Left; int renderX = x + gifIn->Image.Left;