From 504ca6644c9f65c9db26b5ab06f6863aaecbfaa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Tue, 22 Apr 2025 20:58:45 +0200 Subject: [PATCH] Fixed: AS3 - AIR float support incorrectly writes float values to output stream --- CHANGELOG.md | 1 + .../src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db80d3c03..4f83a08b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ All notable changes to this project will be documented in this file. - [#2444] SVG importer - improper stroke width when using width/height with viewBox - [#2444] SVG importer - stroke width not respecting transforms - [#2415] AS3 direct editation - nested functions - prefer callstack variables over prototype chain +- AS3 - AIR float support incorrectly writes float values to output stream ## [22.0.2] - 2025-01-17 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java index f172174bb..3259eef56 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java @@ -248,7 +248,11 @@ public class ABCOutputStream extends OutputStream { * @throws IOException On I/O error */ public void writeFloat(float value) throws IOException { - writeU16(Float.floatToIntBits(value)); + int val = Float.floatToIntBits(value); + write(val & 0xFF); + write((val >> 8) & 0xFF); + write((val >> 16) & 0xFF); + write((val >> 24) & 0xFF); } /**