X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fbuffer.cpp;fp=source%2Fcore%2Fbuffer.cpp;h=240fcd72754b67babe7a28b9ee2fe42a80f1fe4b;hb=4365124bd39bd6edbda6eaef64ec72a1a10565f8;hp=557e576d2ac929e256646c0a3cdc59bd3887a962;hpb=0a359a7508a0117b055b72bcb7dc42ddcb2ed5f9;p=libs%2Fgl.git diff --git a/source/core/buffer.cpp b/source/core/buffer.cpp index 557e576d..240fcd72 100644 --- a/source/core/buffer.cpp +++ b/source/core/buffer.cpp @@ -33,6 +33,8 @@ 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) + throw out_of_range("Buffer::sub_data"); BufferBackend::sub_data(off, sz, d); }