diff --git a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp index a7b8d3812e6bf22ab0f779ee6ba11359ea4fda64..97b7554cfc0ffcc0e0141f12008fd484c88d2c60 100644 --- a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp +++ b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp @@ -977,8 +977,10 @@ bool ExtDecoder::CheckCodec() IMAGE_LOGE("create codec: input stream size is zero."); return false; } + uint32_t src_offset = stream_->Tell(); codec_ = SkCodec::MakeFromStream(make_unique(stream_)); if (codec_ == nullptr) { + stream_->Seek(src_offset); IMAGE_LOGE("create codec from stream failed"); return false; }