Index: third_party/ktx/ktx.cpp |
diff --git a/third_party/ktx/ktx.cpp b/third_party/ktx/ktx.cpp |
index d62833fac4f1863425ba92b20497cc4aee9af924..2391bafcf84e9ec161518475dca001c947fbdaad 100644 |
--- a/third_party/ktx/ktx.cpp |
+++ b/third_party/ktx/ktx.cpp |
@@ -256,6 +256,11 @@ bool SkKTXFile::readKTXFile(const uint8_t* data, size_t dataLen) { |
if (fHeader.fNumberOfFaces > 1) { |
return false; |
} |
+ |
+ // We don't support width and/or height <= 0 |
+ if (fHeader.fPixelWidth <= 0 || fHeader.fPixelHeight <= 0) { |
+ return false; |
+ } |
} |
// Make sure that we have enough bytes left for the key/value |