Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix: add NaN guard in handleZoomCustomScaleChange before state update

makaradam42127e647f03
diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx
index 4f27eb207..2ccd6eb44 100644
--- a/src/components/video-editor/VideoEditor.tsx
+++ b/src/components/video-editor/VideoEditor.tsx
@@ -850,11 +850,11 @@ export default function VideoEditor() {
const handleZoomCustomScaleChange = useCallback(
(scale: number) => {
if (!selectedZoomId) return;
+ const rounded = Math.round(scale * 100) / 100;
+ if (!Number.isFinite(rounded)) return;
updateState((prev) => ({
zoomRegions: prev.zoomRegions.map((region) =>
- region.id === selectedZoomId
- ? { ...region, customScale: Math.round(scale * 100) / 100 }
- : region,
+ region.id === selectedZoomId ? { ...region, customScale: rounded } : region,
),
}));
},