From 005c2fe91587003c83b93a2c744ac464c5824056 Mon Sep 17 00:00:00 2001 From: deepshekhardas Date: Sat, 8 Aug 2026 08:48:30 +0530 Subject: [PATCH] fix: validate saveGif duration is positive (#8710) --- src/image/loading_displaying.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/image/loading_displaying.js b/src/image/loading_displaying.js index 1f5077989a..4b6a86a806 100644 --- a/src/image/loading_displaying.js +++ b/src/image/loading_displaying.js @@ -267,6 +267,9 @@ function loadingDisplaying(p5, fn){ if (typeof duration !== 'number') { throw TypeError('Duration parameter must be a number'); } + if (duration <= 0) { + throw TypeError('Duration parameter must be greater than 0'); + } // extract variables for more comfortable use const delay = (options && options.delay) || 0; // in seconds