HaxeFoundation / HaxeFoundation/format

Eof exception when reading data from SWF file

Open
#99 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
139
Forks
65
PR merge metrics
No merged PRs in 30d

Description

I attempted to read data from the following SWF files:

http://i.flipline.com/gamefiles/cactusmccoycot/cactusmccoy_v2_1.swf
http://i.flipline.com/gamefiles/cactusmccoy2/cactusmccoy2_v2_1.swf

with the following code:
```haxe
final handle = File.read(swfPath, true);
final swfReader = new Reader(handle);
trace(swfReader.read().tags.length);
```
using the --interp target with Haxe 4.2.2 and format 3.5.0.

This resulted in the following error for cactusmccoy_v2_1.swf:
```
C:\HaxeToolkit\haxe\std/haxe/io/BytesInput.hx:101: characters 4-9 : Uncaught exception Eof
C:\HaxeToolkit\haxe\std/haxe/io/Input.hx:244: characters 13-23 : Called from here
C:\HaxeToolkit\haxe\lib\format/3,5,0/format/swf/Reader.hx:963: characters 29-43 : Called from here
C:\HaxeToolkit\haxe\lib\format/3,5,0/format/swf/Reader.hx:1354: characters 18-39 : Called from here
C:\HaxeToolkit\haxe\lib\format/3,5,0/format/swf/Reader.hx:608: characters 12-21 : Called from here
C:\HaxeToolkit\haxe\lib\format/3,5,0/format/swf/Reader.hx:1360: characters 15-28 : Called from here
C:\HaxeToolkit\haxe\lib\format/3,5,0/format/swf/Reader.hx:608: characters 12-21 : Called from here
C:\HaxeToolkit\haxe\lib\format/3,5,0/format/swf/Reader.hx:1423: characters 11-24 : Called from here
src/export/CMCoyExporter.hx:37: characters 15-31 : Called from here
src/export/CMCoyExporter.hx:16: characters 9-52 : Called from here
```
and the following error for cactusmccoy2_v2_1.swf:
```
C:\HaxeToolkit\haxe\std/haxe/io/BytesInput.hx:101: characters 4-9 : Uncaught exception Eof
C:\HaxeToolkit\haxe\lib\format/3,5,0/format/swf/Reader.hx:59: characters 12-24 : Called from here
C:\HaxeToolkit\haxe\lib\format/3,5,0/format/swf/Reader.hx:961: characters 68-83 : Called from here
C:\HaxeToolkit\haxe\lib\format/3,5,0/format/swf/Reader.hx:1354: characters 18-39 : Called from here
C:\HaxeToolkit\haxe\lib\format/3,5,0/format/swf/Reader.hx:608: characters 12-21 : Called from here
C:\HaxeToolkit\haxe\lib\format/3,5,0/format/swf/Reader.hx:1360: characters 15-28 : Called from here
C:\HaxeToolkit\haxe\lib\format/3,5,0/format/swf/Reader.hx:608: characters 12-21 : Called from here
C:\HaxeToolkit\haxe\lib\format/3,5,0/format/swf/Reader.hx:1423: characters 11-24 : Called from here
src/export/CMCoyExporter.hx:37: characters 15-31 : Called from here
src/export/CMCoyExporter.hx:16: characters 9-53 : Called from here
```

What might be causing this and can it be fixed?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.