If a textfield has word wrapping enabled, is very small in size and
tries to layout a single character onto it, the layout code can run into
an endless loop where it's creating new lines and trying to fit the text
again.
If text doesn't fit at the start of a line, it won't fit on the next
either, so abort and display the whole text span on the line. Text will
be cut-off.
This can be reproduced with a AS2 file like this:
class Test {
static var app : Test;
function Test() {
_root.createTextField("tf",0,0,0,6,20);
_root.tf.text = "0";
_root.tf.wordWrap = true;
}
static function main(mc) {
app = new Test();
}
}
Build it with `mtasc -main -header 100💯30 test.as -swf test.swf`
Both InitArray and InitObject should bail-out without popping anything
off the stack when the elements/properties count is negative or greater
than or equals 2147483648.
Previously, if the arguments count was greater than the actual
stack size, then a stack underflow occurred which resulted in a
sequence of undefined values. That didn't match Flash's behavior.
Also, this prevents potential huge allocations that hang Ruffle.
In addition, num_args seems like it should use coerce_to_u32
(wraps at 4294967297). This also means that -1 ends up acting like
u32::MAX and would pop all values off of the stack.
The string will now be surrounded with quotes (`"`), non-ASCII characters (UTF-8 or not) will be escaped in hexadecimal form (`\xNN`) and ASCII control characters will be escaped (`\x01`, `\n`, `\t`).
Toss out any shared objects that contain ".." in the name
to avoid accessing files outside of the Ruffle data directory.
The DiskStorageBackend also will fail any requests with a ".."
component as an extra precaution.
Fixes#3961.
Also, prefix the shared object name with # if it contains a
slash, (e.g. `#mygame/foo`). This matches Flash's directory
structure and makes it easier to transfer saved data to Ruffle.
If a textfield was created with a variable binding, and the variable
already existed, the initial text of the textfield is set to the
variable value. However, this was not obeying the HTML setting of
the text field, so HTML tags were mistakenly shown in some content.
Fixes#3522.
This adds two optional parameters, --width and --height, which
allow the user to specify a desired physical window width and
height to be used. If only one of the two parameters is present,
the other will be deduced from it and the movie's aspect ratio.
If neither are present, the window's size is set to the movie's
logical size, in accordance with the behaviour before this change.
MovieClip.getBytesLoaded and getBytesTotal return the size of that
specific clip, even if it's not a loaded SWF. The previous logic
only returned the size of the parent SWF.
If the clip is an SWF, the uncompressed size of the SWF is returned.
Otherwise, the length of the tag list inside the clip's DefineSprite
tag is returned.
This allows `regressions_tests.rs` to depend on other crates in the
workspace, such as `render`, without introducing a cyclic dependency.
Split out from #4054