diff --git a/src/examples/Lottie.cpp b/src/examples/Lottie.cpp index e29ac83f..02481542 100644 --- a/src/examples/Lottie.cpp +++ b/src/examples/Lottie.cpp @@ -42,6 +42,8 @@ static unique_ptr swCanvas; void lottieDirCallback(const char* name, const char* path, void* data) { + if (counter >= NUM_PER_ROW * NUM_PER_COL) return; + //ignore if not lottie file. const char *ext = name + strlen(name) - 4; if (strcmp(ext, "json")) return; diff --git a/src/examples/Svg.cpp b/src/examples/Svg.cpp index f21dc7c5..eaaf535d 100644 --- a/src/examples/Svg.cpp +++ b/src/examples/Svg.cpp @@ -37,6 +37,8 @@ static std::vector> pictures; void svgDirCallback(const char* name, const char* path, void* data) { + if (counter >= NUM_PER_ROW * NUM_PER_COL) return; + //ignore if not svgs. const char *ext = name + strlen(name) - 3; if (strcmp(ext, "svg")) return; diff --git a/src/examples/Tvg.cpp b/src/examples/Tvg.cpp index 5bee2a0a..60174c34 100644 --- a/src/examples/Tvg.cpp +++ b/src/examples/Tvg.cpp @@ -37,6 +37,8 @@ static std::vector> pictures; void tvgDirCallback(const char* name, const char* path, void* data) { + if (counter >= NUM_PER_ROW * NUM_PER_COL) return; + //ignore if not tvgs. const char *ext = name + strlen(name) - 3; if (strcmp(ext, "tvg")) return;