FCDODiffControl doesn't properly account for lists of differing size.
The issues are marked in the following code:
int IterOld = 0; int IterNew = 0; while (IterOld != OldProperties.Num() || IterNew != NewProperties.Num()) { ... else { if (IterOld != OldProperties.Num()) { bool bFoundDifference = false; if (const FSingleObjectDiffEntry* OldDiffering = FindDiffering(DifferingProperties, OldProperties[IterOld])) { bFoundDifference = true; ... } else if (IterNew != NewProperties.Num()) { if (const FSingleObjectDiffEntry* NewDiffering = FindDiffering(DifferingProperties, NewProperties[IterNew])) { bFoundDifference = true; ... } } // !!!! This will be hit if the first check fails (no diff from OlderProperties) // !!!! and IterNew == NewProperties.Num() // !!!! It causes IterNew to be incremented, meaning IterNew != NewProperties.Num() anymore; if (!bFoundDifference) { ++IterOld; ++IterNew; } } else { // !!!! This check is missed (because IterNew > NewProperties.Num()) check(IterNew != NewProperties.Num()); // !!!! Error is thrown for array index out of bounds. if (const FSingleObjectDiffEntry* Differing = FindDiffering(DifferingProperties, NewProperties[IterNew])) { OrderedProperties.Push(Differing); } ++IterNew; } } }
One approach may be to do checks of < instead of !=.
TODO
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-36263 in the post.
0 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 4.13, 4.14 |
Target Fix | 4.14 |
Created | Sep 21, 2016 |
---|---|
Resolved | Sep 21, 2016 |
Updated | Apr 27, 2018 |