OLD | NEW |
| (Empty) |
1 diff --git a/source/common/ubidi.c b/source/common/ubidi.c | |
2 index 8c0d64b..c43c41c 100644 | |
3 --- a/source/common/ubidi.c | |
4 +++ b/source/common/ubidi.c | |
5 @@ -1,7 +1,7 @@ | |
6 /* | |
7 ****************************************************************************** | |
8 * | |
9 -* Copyright (C) 1999-2014, International Business Machines | |
10 +* Copyright (C) 1999-2015, International Business Machines | |
11 * Corporation and others. All Rights Reserved. | |
12 * | |
13 ****************************************************************************** | |
14 @@ -2138,7 +2138,7 @@ resolveImplicitLevels(UBiDi *pBiDi, | |
15 /* The isolates[] entries contain enough information to | |
16 resume the bidi algorithm in the same state as it was | |
17 when it was interrupted by an isolate sequence. */ | |
18 - if(dirProps[start]==PDI) { | |
19 + if(dirProps[start]==PDI && pBiDi->isolateCount >= 0) { | |
20 levState.startON=pBiDi->isolates[pBiDi->isolateCount].startON; | |
21 start1=pBiDi->isolates[pBiDi->isolateCount].start1; | |
22 stateImp=pBiDi->isolates[pBiDi->isolateCount].stateImp; | |
23 @@ -2340,7 +2340,7 @@ setParaSuccess(UBiDi *pBiDi) { | |
24 static void | |
25 setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length, | |
26 UBiDiLevel paraLevel, UErrorCode *pErrorCode) { | |
27 - void *runsOnlyMemory; | |
28 + void *runsOnlyMemory = NULL; | |
29 int32_t *visualMap; | |
30 UChar *visualText; | |
31 int32_t saveLength, saveTrailingWSStart; | |
32 @@ -2514,12 +2514,13 @@ setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t
length, | |
33 } | |
34 uprv_memcpy(pBiDi->levels, saveLevels, saveLength*sizeof(UBiDiLevel)); | |
35 pBiDi->trailingWSStart=saveTrailingWSStart; | |
36 - /* free memory for mapping table and visual text */ | |
37 - uprv_free(runsOnlyMemory); | |
38 if(pBiDi->runCount>1) { | |
39 pBiDi->direction=UBIDI_MIXED; | |
40 } | |
41 cleanup3: | |
42 + /* free memory for mapping table and visual text */ | |
43 + uprv_free(runsOnlyMemory); | |
44 + | |
45 pBiDi->reorderingMode=UBIDI_REORDER_RUNS_ONLY; | |
46 } | |
47 | |
48 diff --git a/source/common/ubidiimp.h b/source/common/ubidiimp.h | |
49 index 20ab9b9..14d7b99 100644 | |
50 --- a/source/common/ubidiimp.h | |
51 +++ b/source/common/ubidiimp.h | |
52 @@ -1,7 +1,7 @@ | |
53 /* | |
54 ****************************************************************************** | |
55 * | |
56 -* Copyright (C) 1999-2014, International Business Machines | |
57 +* Copyright (C) 1999-2015, International Business Machines | |
58 * Corporation and others. All Rights Reserved. | |
59 * | |
60 ****************************************************************************** | |
61 @@ -184,8 +184,8 @@ typedef struct BracketData { | |
62 typedef struct Isolate { | |
63 int32_t startON; | |
64 int32_t start1; | |
65 + int32_t state; | |
66 int16_t stateImp; | |
67 - int16_t state; | |
68 } Isolate; | |
69 | |
70 typedef struct Run { | |
OLD | NEW |