From 6a9eccdec12a79785c8a26fc831e4195b5bf9eca Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Thu, 29 Jan 2015 14:36:55 +0100 Subject: [PATCH] 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 --- src/gdd/gdd.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gdd/gdd.cc b/src/gdd/gdd.cc index 2ff4675fe..a0f38daef 100644 --- a/src/gdd/gdd.cc +++ b/src/gdd/gdd.cc @@ -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; }