Index: src/codec/SkWebpCodec.cpp |
diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp |
index 041bfb6b63aa191443805a702adc8263ec2e1b3a..624ff74fa0af86e24bc1aa6fa0a38938d21b3232 100644 |
--- a/src/codec/SkWebpCodec.cpp |
+++ b/src/codec/SkWebpCodec.cpp |
@@ -153,16 +153,8 @@ bool SkWebpCodec::onGetValidSubset(SkIRect* desiredSubset) const { |
SkCodec::Result SkWebpCodec::onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t rowBytes, |
const Options& options, SkPMColor*, int*) { |
- switch (this->rewindIfNeeded()) { |
- case kCouldNotRewind_RewindState: |
- return kCouldNotRewind; |
- case kRewound_RewindState: |
- // Rewound to the beginning. Since creation only does a peek, the stream is at the |
- // correct position. |
- break; |
- case kNoRewindNecessary_RewindState: |
- // Already at the right spot for decoding. |
- break; |
+ if (!this->rewindIfNeeded()) { |
+ return kCouldNotRewind; |
} |
if (!conversion_possible(dstInfo, this->getInfo())) { |