X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fbuffer.cpp;fp=source%2Fcore%2Fbuffer.cpp;h=ed0c552360ac8fad2345236e2024d17455200334;hb=6d2e2a0bb28496a8c25b441009bdd2a1a1e72d81;hp=4a36937e7b745d1dd32f8c1e9ce19df0766037d7;hpb=5003bcfeb0832ec2d0f74f4149bc97888a70a900;p=libs%2Fgl.git diff --git a/source/core/buffer.cpp b/source/core/buffer.cpp index 4a36937e..ed0c5523 100644 --- a/source/core/buffer.cpp +++ b/source/core/buffer.cpp @@ -34,7 +34,7 @@ void Buffer::sub_data(size_t off, size_t sz, const void *d) { if(size==0) throw invalid_operation("Buffer::sub_data"); - if(off>size || off+sz>size) + if(off>get_total_size() || off%size+sz>size) throw out_of_range("Buffer::sub_data"); BufferBackend::sub_data(off, sz, d);