Index: src/images/SkImageDecoder_libbmp.cpp |
diff --git a/src/images/SkImageDecoder_libbmp.cpp b/src/images/SkImageDecoder_libbmp.cpp |
index 1dcea8ad64c38bc7b8cbc06ec9a3ad6e7b5fabc6..488eddce1edb203065ce063db82e449c169db99f 100644 |
--- a/src/images/SkImageDecoder_libbmp.cpp |
+++ b/src/images/SkImageDecoder_libbmp.cpp |
@@ -37,12 +37,11 @@ DEFINE_DECODER_CREATOR(BMPImageDecoder); |
static SkImageDecoder* sk_libbmp_dfactory(SkStream* stream) { |
static const char kBmpMagic[] = { 'B', 'M' }; |
- size_t len = stream->getLength(); |
+ |
char buffer[sizeof(kBmpMagic)]; |
- if (len > sizeof(kBmpMagic) && |
- stream->read(buffer, sizeof(kBmpMagic)) == sizeof(kBmpMagic) && |
- !memcmp(buffer, kBmpMagic, sizeof(kBmpMagic))) { |
+ if (stream->read(buffer, sizeof(kBmpMagic)) == sizeof(kBmpMagic) && |
+ !memcmp(buffer, kBmpMagic, sizeof(kBmpMagic))) { |
return SkNEW(SkBMPImageDecoder); |
} |
return NULL; |