Index: src/codec/SkCodec_wbmp.cpp |
diff --git a/src/codec/SkCodec_wbmp.cpp b/src/codec/SkCodec_wbmp.cpp |
index 465c76d4dce109ed81d8c5c599ce7551d296b3c8..073165d2ca3140a3512c6323072fe2c16fcd1ad1 100644 |
--- a/src/codec/SkCodec_wbmp.cpp |
+++ b/src/codec/SkCodec_wbmp.cpp |
@@ -154,6 +154,7 @@ bool SkWbmpCodec::IsWbmp(SkStream* stream) { |
} |
SkCodec* SkWbmpCodec::NewFromStream(SkStream* stream) { |
+ SkAutoTDelete<SkStream> streamDeleter(stream); |
SkISize size; |
if (!read_header(stream, &size)) { |
return NULL; |
@@ -161,5 +162,5 @@ SkCodec* SkWbmpCodec::NewFromStream(SkStream* stream) { |
SkImageInfo info = |
SkImageInfo::Make(size.width(), size.height(), kGray_8_SkColorType, |
kOpaque_SkAlphaType); |
- return SkNEW_ARGS(SkWbmpCodec, (info, stream)); |
+ return SkNEW_ARGS(SkWbmpCodec, (info, streamDeleter.detach())); |
} |