diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-06-02 22:08:41 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-06-02 22:08:41 -0300 |
commit | 8a1097a2243a9829d5d7e61ef10133f8096aa5e2 (patch) | |
tree | 2ec55a650b676975e6ef2ed60e25d68307381269 /drivers/png | |
parent | e79d7149ea751e32312cb8625548085d4537c591 (diff) |
many fixes to image loader, voxel cone tracing, etc.
Diffstat (limited to 'drivers/png')
-rw-r--r-- | drivers/png/image_loader_png.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/png/image_loader_png.cpp b/drivers/png/image_loader_png.cpp index 25ab767bed..33d271248c 100644 --- a/drivers/png/image_loader_png.cpp +++ b/drivers/png/image_loader_png.cpp @@ -256,6 +256,7 @@ static Ref<Image> _load_mem_png(const uint8_t *p_png, int p_size) { static Ref<Image> _lossless_unpack_png(const PoolVector<uint8_t> &p_data) { int len = p_data.size(); + ERR_FAIL_COND_V(len < 4, Ref<Image>()); PoolVector<uint8_t>::Read r = p_data.read(); ERR_FAIL_COND_V(r[0] != 'P' || r[1] != 'N' || r[2] != 'G' || r[3] != ' ', Ref<Image>()); return _load_mem_png(&r[4], len - 4); |