diff options
Diffstat (limited to 'core/image.cpp')
-rw-r--r-- | core/image.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/image.cpp b/core/image.cpp index e0b0a1f8be..5e4e0c0d0c 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -885,8 +885,8 @@ void Image::resize(int p_width, int p_height, Interpolation p_interpolation) { bool mipmap_aware = p_interpolation == INTERPOLATE_TRILINEAR /* || p_interpolation == INTERPOLATE_TRICUBIC */; - ERR_FAIL_COND_MSG(p_width <= 0, "Image width cannot be greater than 0."); - ERR_FAIL_COND_MSG(p_height <= 0, "Image height cannot be greater than 0."); + ERR_FAIL_COND_MSG(p_width <= 0, "Image width must be greater than 0."); + ERR_FAIL_COND_MSG(p_height <= 0, "Image height must be greater than 0."); ERR_FAIL_COND_MSG(p_width > MAX_WIDTH, "Image width cannot be greater than " + itos(MAX_WIDTH) + "."); ERR_FAIL_COND_MSG(p_height > MAX_HEIGHT, "Image height cannot be greater than " + itos(MAX_HEIGHT) + "."); @@ -1322,6 +1322,8 @@ void Image::expand_x2_hq2x() { PoolVector<uint8_t>::Read r = data.read(); PoolVector<uint8_t>::Write w = dest.write(); + ERR_FAIL_COND(!r.ptr()); + hq2x_resize((const uint32_t *)r.ptr(), width, height, (uint32_t *)w.ptr()); } @@ -2895,6 +2897,8 @@ void Image::bumpmap_to_normalmap(float bump_scale) { PoolVector<uint8_t>::Read rp = data.read(); PoolVector<uint8_t>::Write wp = result_image.write(); + ERR_FAIL_COND(!rp.ptr()); + unsigned char *write_ptr = wp.ptr(); float *read_ptr = (float *)rp.ptr(); |