X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture3d.cpp;h=0125dd0930a16a8a5dbc6cb5fe3c025cfdaddab9;hb=4365124bd39bd6edbda6eaef64ec72a1a10565f8;hp=e48b7662011deb9b1c81ce5c73014c939ace2c52;hpb=0a359a7508a0117b055b72bcb7dc42ddcb2ed5f9;p=libs%2Fgl.git diff --git a/source/core/texture3d.cpp b/source/core/texture3d.cpp index e48b7662..0125dd09 100644 --- a/source/core/texture3d.cpp +++ b/source/core/texture3d.cpp @@ -39,11 +39,11 @@ void Texture3D::image(unsigned level, const void *data) return sub_image(level, 0, 0, 0, size.x, size.y, size.z, data); } -void Texture3D::sub_image(unsigned level, int x, int y, int z, unsigned wd, unsigned ht, unsigned dp, const void *data) +void Texture3D::sub_image(unsigned level, unsigned x, unsigned y, unsigned z, unsigned wd, unsigned ht, unsigned dp, const void *data) { if(width==0 || height==0 || depth==0) throw invalid_operation("Texture3D::sub_image"); - if(level>=levels) + if(level>=levels || x>width || x+wd>width || y>height || y+ht>height || z>depth || z+dp>depth) throw out_of_range("Texture3D::sub_image"); Texture3DBackend::sub_image(level, x, y, z, wd, ht, dp, data);