summaryrefslogtreecommitdiff
path: root/modules/jpg/image_loader_jpegd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/jpg/image_loader_jpegd.cpp')
-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;
}