diff options
author | 2016-04-12 07:41:22 -0700 | |
---|---|---|
committer | 2016-04-12 07:41:22 -0700 | |
commit | b8e0960de41be52b3e6c85f08fdc722925c70941 (patch) | |
tree | 3107dcb1dbb04574321c079f54d5ee36a81ee479 /src/gpu | |
parent | 37798fbd82a7d064c5cc1516f120546a3408044b (diff) |
Make is_ktx safer
Rather than assuming the data passed to ktx at least
KTX_FILE_IDENTIFIER_SIZE, pass the length of the data to is_ktx and
compare it.
Splitting off from crrev.com/1862133002, which no longer depends on
is_ktx.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1882593002
Review URL: https://codereview.chromium.org/1882593002
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/SkGr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index 716909133a..84023ecbb6 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -87,7 +87,7 @@ GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data, *outStartOfDataToUpload = bytes + ETC_PKM_HEADER_SIZE; return kETC1_GrPixelConfig; - } else if (SkKTXFile::is_ktx(bytes)) { + } else if (SkKTXFile::is_ktx(bytes, data->size())) { SkKTXFile ktx(data); // Is it actually an ETC1 texture? |