diff --git a/src/serializer.h b/src/serializer.h index 17d8c970e..8b05cf9ec 100644 --- a/src/serializer.h +++ b/src/serializer.h @@ -134,6 +134,11 @@ public: } if (BeginArray(key)) { + if (isReading()) + { + int max = ArraySize(); + if (max < count) count = max; + } for (int i = 0; i < count; i++) { Serialize(*this, nullptr, obj[i], def ? &def[i] : nullptr);