diff options
author | Albert Astals Cid <aacid@kde.org> | 2021-01-08 13:55:40 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2021-01-08 13:55:40 +0100 |
commit | 2308e6fbb6f5afa20bb59ef3378fdb63de74c436 (patch) | |
tree | f7bd6417f5fbcf715dee328c5daee1842def72ee | |
parent | 04035f915627a7e470a5509bccffedefb845d786 (diff) |
Fix uninitialized memory read on broken files
oss-fuzz/10059
-rw-r--r-- | poppler/GfxState.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc index 8a713d8c..fc411404 100644 --- a/poppler/GfxState.cc +++ b/poppler/GfxState.cc @@ -2932,6 +2932,11 @@ void GfxDeviceNColorSpace::getGray(const GfxColor *color, GfxGray *gray) const void GfxDeviceNColorSpace::getRGB(const GfxColor *color, GfxRGB *rgb) const { + if (unlikely(nComps < func->getInputSize() || alt->getNComps() > func->getOutputSize())) { + rgb->r = rgb->g = rgb->b = 0; + return; + } + double x[gfxColorMaxComps], c[gfxColorMaxComps]; GfxColor color2; int i; |