X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexturecube.cpp;h=543bb9d40ec00e954ce894d9699e86c364405dd8;hb=2b7f8e45e75bec30c1ea27fc0efd8286f67adc3f;hp=93faa3703ab993ee29e05710347c56be82c3bca2;hpb=aff68a183a4b33653750acc57a021fd7ed6c555c;p=libs%2Fgl.git diff --git a/source/core/texturecube.cpp b/source/core/texturecube.cpp index 93faa370..543bb9d4 100644 --- a/source/core/texturecube.cpp +++ b/source/core/texturecube.cpp @@ -103,10 +103,10 @@ void TextureCube::image(TextureCubeFace face, unsigned level, const void *data) { if(size==0) throw invalid_operation("TextureCube::image"); + if(level>=levels) + throw out_of_range("TextureCube::image"); unsigned s = get_level_size(level); - if(s==0) - throw out_of_range("TextureCube::image"); if(ARB_texture_storage) return sub_image(face, level, 0, 0, s, s, data); @@ -157,6 +157,8 @@ void TextureCube::sub_image(TextureCubeFace face, unsigned level, int x, int y, { if(size==0) throw invalid_operation("TextureCube::sub_image"); + if(level>=levels) + throw out_of_range("TextureCube::sub_image"); Conditional _bind(!ARB_direct_state_acess, this); allocate(level);