summaryrefslogtreecommitdiff
path: root/modules/jpg
diff options
context:
space:
mode:
authorgeequlim <geequlim@gmail.com>2018-07-15 01:42:37 +0800
committergeequlim <geequlim@gmail.com>2018-07-17 12:03:45 +0800
commitc5efe5d625529af5df908808791599f8dceaf50c (patch)
tree043f176d55331ecea69eba1a4520148bcefc98fe /modules/jpg
parent1fc7973a00e17025441b6b8333e38d1606c1d304 (diff)
Add webp buffer loader for Image
Cleanup the code memory load related code for Image Fix jpeg buff load function always returns OK event failed
Diffstat (limited to 'modules/jpg')
-rw-r--r--modules/jpg/image_loader_jpegd.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/jpg/image_loader_jpegd.cpp b/modules/jpg/image_loader_jpegd.cpp
index 0168be3a26..437c0d57fa 100644
--- a/modules/jpg/image_loader_jpegd.cpp
+++ b/modules/jpg/image_loader_jpegd.cpp
@@ -121,9 +121,7 @@ static Ref<Image> _jpegd_mem_loader_func(const uint8_t *p_png, int p_size) {
Ref<Image> img;
img.instance();
Error err = jpeg_load_image_from_buffer(img.ptr(), p_png, p_size);
- if (err)
- ERR_PRINT("Couldn't initialize ImageLoaderJPG with the given resource.");
-
+ ERR_FAIL_COND_V(err, Ref<Image>());
return img;
}