summaryrefslogtreecommitdiff
path: root/modules/webp/image_loader_webp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/webp/image_loader_webp.cpp')
-rw-r--r--modules/webp/image_loader_webp.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/webp/image_loader_webp.cpp b/modules/webp/image_loader_webp.cpp
index 928a0dcbd3..630c15f140 100644
--- a/modules/webp/image_loader_webp.cpp
+++ b/modules/webp/image_loader_webp.cpp
@@ -71,7 +71,7 @@ static PoolVector<uint8_t> _webp_lossy_pack(const Ref<Image> &p_image, float p_q
w[3] = 'P';
copymem(&w[4], dst_buff, dst_size);
free(dst_buff);
- w = PoolVector<uint8_t>::Write();
+ w.release();
return dst;
}
@@ -110,7 +110,7 @@ static Ref<Image> _webp_lossy_unpack(const PoolVector<uint8_t> &p_buffer) {
//ERR_EXPLAIN("Error decoding webp! - "+p_file);
ERR_FAIL_COND_V(errdec, Ref<Image>());
- dst_w = PoolVector<uint8_t>::Write();
+ dst_w.release();
Ref<Image> img = memnew(Image(features.width, features.height, 0, features.has_alpha ? Image::FORMAT_RGBA8 : Image::FORMAT_RGB8, dst_image));
return img;
@@ -137,7 +137,7 @@ Error webp_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p
} else {
errdec = WebPDecodeRGBInto(p_buffer, p_buffer_len, dst_w.ptr(), datasize, 3 * features.width) == NULL;
}
- dst_w = PoolVector<uint8_t>::Write();
+ dst_w.release();
//ERR_EXPLAIN("Error decoding webp!");
ERR_FAIL_COND_V(errdec, ERR_FILE_CORRUPT);
@@ -171,8 +171,6 @@ Error ImageLoaderWEBP::load_image(Ref<Image> p_image, FileAccess *f, bool p_forc
Error err = webp_load_image_from_buffer(p_image.ptr(), w.ptr(), src_image_len);
- w = PoolVector<uint8_t>::Write();
-
return err;
}