X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/374ca955a76ecab1204ca8bfa63ff9238d998416..08b89b0a244153b9f5bbb2f49c55ab0f7298122e:/icuSources/layout/LEInsertionList.cpp diff --git a/icuSources/layout/LEInsertionList.cpp b/icuSources/layout/LEInsertionList.cpp index b92cc474..c64b8a19 100644 --- a/icuSources/layout/LEInsertionList.cpp +++ b/icuSources/layout/LEInsertionList.cpp @@ -1,6 +1,6 @@ /* ********************************************************************** - * Copyright (C) 1998-2004, International Business Machines + * Copyright (C) 1998-2008, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** */ @@ -51,9 +51,17 @@ le_int32 LEInsertionList::getGrowAmount() return growAmount; } -LEGlyphID *LEInsertionList::insert(le_int32 position, le_int32 count) +LEGlyphID *LEInsertionList::insert(le_int32 position, le_int32 count, LEErrorCode &success) { + if (LE_FAILURE(success)) { + return 0; + } + InsertionRecord *insertion = (InsertionRecord *) LE_NEW_ARRAY(char, sizeof(InsertionRecord) + (count - ANY_NUMBER) * sizeof (LEGlyphID)); + if (insertion == NULL) { + success = LE_MEMORY_ALLOCATION_ERROR; + return 0; + } insertion->position = position; insertion->count = count;