X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture1d.cpp;fp=source%2Fcore%2Ftexture1d.cpp;h=71c736f04da4ecb7971d22461434169445614f6b;hb=2b7f8e45e75bec30c1ea27fc0efd8286f67adc3f;hp=d472527c92322f4d05b0fe39640f7f91905133a9;hpb=aff68a183a4b33653750acc57a021fd7ed6c555c;p=libs%2Fgl.git diff --git a/source/core/texture1d.cpp b/source/core/texture1d.cpp index d472527c..71c736f0 100644 --- a/source/core/texture1d.cpp +++ b/source/core/texture1d.cpp @@ -64,6 +64,8 @@ void Texture1D::image(unsigned level, const void *data) { if(width==0) throw invalid_operation("Texture1D::image"); + if(level>=levels) + throw out_of_range("Texture1D::image"); unsigned w = get_level_size(level); @@ -100,7 +102,9 @@ void Texture1D::image(unsigned level, PixelComponents comp, DataType type, const void Texture1D::sub_image(unsigned level, int x, unsigned wd, const void *data) { if(width==0) - throw invalid_operation("Texture3D::image"); + throw invalid_operation("Texture1D::sub_image"); + if(level>=levels) + throw out_of_range("Texture1D::sub_image"); Conditional _bind(!ARB_direct_state_access, this); allocate(level);