From 613c21a5d2d377acca9b7e71d74c64946646042e Mon Sep 17 00:00:00 2001 From: Lord-McSweeney <84632019+Lord-McSweeney@users.noreply.github.com> Date: Sat, 16 Sep 2023 12:35:18 -0700 Subject: [PATCH] avm2: Minor Video improvements Throw RangeError when Video is initialized with negative height or width Stub Video.clear --- core/src/avm2/globals/flash/media/Video.as | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/avm2/globals/flash/media/Video.as b/core/src/avm2/globals/flash/media/Video.as index de1ef08e8..b64553f2a 100644 --- a/core/src/avm2/globals/flash/media/Video.as +++ b/core/src/avm2/globals/flash/media/Video.as @@ -1,5 +1,7 @@ package flash.media { + import __ruffle__.stub_method; + import flash.display.DisplayObject import flash.net.NetStream @@ -12,6 +14,9 @@ package flash.media private var _videoHeight: int; public function Video(width: int = 320, height: int = 240) { + if (width < 0 || height < 0) { + throw new RangeError("Error #2006: The supplied index is out of bounds.", 2006); + } this._videoWidth = width; this._videoHeight = height; this.init(width, height); @@ -44,5 +49,9 @@ package flash.media } public native function attachNetStream(netStream: NetStream); + + public function clear():void { + stub_method("flash.media.Video", "clear"); + } } }