X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fdatatype.cpp;h=4dd0b89fc2f8a2e7bd6c86bd75e9fd3465c4cbc3;hp=af7446eb1f86916e23af1c2c84cd4e57c7fcf3ca;hb=26634147dfbb5be9a4046a0d50b3b1d6857ad68d;hpb=70d9d2d28e5fe723c6b46894276e4c935f578e2d diff --git a/source/core/datatype.cpp b/source/core/datatype.cpp index af7446eb..4dd0b89f 100644 --- a/source/core/datatype.cpp +++ b/source/core/datatype.cpp @@ -88,8 +88,9 @@ namespace GL { GLenum get_gl_type(DataType type) { - const MappedType *ptr = lower_bound(type_map, type_map+type_map_size, type, type_compare); - if(ptr->type!=type) + const MappedType *end = type_map+type_map_size; + const MappedType *ptr = lower_bound(type_map, end, type, type_compare); + if(ptr==end || ptr->type!=type) throw invalid_argument("get_gl_type"); return ptr->gl_type; }