Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(901)

Unified Diff: third_party/ktx/ktx.h

Issue 1882593002: Make is_ktx safer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/images/SkKTXImageEncoder.cpp ('k') | third_party/ktx/ktx.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ktx/ktx.h
diff --git a/third_party/ktx/ktx.h b/third_party/ktx/ktx.h
index 889d5aaf87bbd77d02442210b01ad670b57e70b4..6ff8a8bd37a47342ab4e3ddc497a5dcd5a8efa96 100644
--- a/third_party/ktx/ktx.h
+++ b/third_party/ktx/ktx.h
@@ -34,9 +34,7 @@ public:
// The ownership of the data remains with the caller. This class is intended
// to be used as a logical wrapper around the data in order to properly
// access the pixels.
- SkKTXFile(SkData* data)
- : fData(data), fSwapBytes(false)
- {
+ SkKTXFile(SkData* data) : fData(data), fSwapBytes(false) {
data->ref();
fValid = this->readKTXFile(fData->bytes(), fData->size());
}
@@ -62,7 +60,7 @@ public:
bool isRGBA8() const;
bool isRGB8() const;
- static bool is_ktx(const uint8_t *data);
+ static bool is_ktx(const uint8_t data[], size_t size);
static bool is_ktx(SkStreamRewindable* stream);
static bool WriteETC1ToKTX(SkWStream* stream, const uint8_t *etc1Data,
« no previous file with comments | « src/images/SkKTXImageEncoder.cpp ('k') | third_party/ktx/ktx.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698