X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fbuffer.cpp;h=240fcd72754b67babe7a28b9ee2fe42a80f1fe4b;hp=557e576d2ac929e256646c0a3cdc59bd3887a962;hb=959efbf61663efd7879070ce0447e02c8a447ce0;hpb=be6ffe96ecb4707599fe1a6f620c348760213d46 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); }