gdd: fix issue when copying from an emtpy array

if the source array is empty, the index of the first element to copy (0) being equal
   to the source array size (0) does not constitute an out-of-bounds condition
This commit is contained in:
Ralph Lange
2015-01-29 14:36:55 +01:00
parent 2b950754c4
commit 6a9eccdec1

View File

@@ -1353,7 +1353,7 @@ gddStatus gdd::put ( const gdd * dd )
// clip to upper limit of source
aitUint32 srcCopySize;
const aitUint32 unusedSrcBelow = srcCopyFirst - srcFirst;
if ( srcElemCount <= unusedSrcBelow ) {
if ( srcElemCount && srcElemCount <= unusedSrcBelow ) {
return gddErrorOutOfBounds;
}