Skip to content

Commit

Permalink
avm2: Minor Video improvements
Browse files Browse the repository at this point in the history
Throw RangeError when Video is initialized with negative height or width
Stub Video.clear
  • Loading branch information
Lord-McSweeney authored and adrian17 committed Sep 16, 2023
1 parent 6028505 commit 613c21a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/src/avm2/globals/flash/media/Video.as
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package flash.media
{
import __ruffle__.stub_method;

import flash.display.DisplayObject
import flash.net.NetStream

Expand All @@ -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);
Expand Down Expand Up @@ -44,5 +49,9 @@ package flash.media
}

public native function attachNetStream(netStream: NetStream);

public function clear():void {
stub_method("flash.media.Video", "clear");
}
}
}

0 comments on commit 613c21a

Please sign in to comment.