## Environment
Ubuntu 22.04.3 LTS
## Compiler
clang version 11.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
## Step to reproduce
```cd libming 
./autogen.sh
./configure --disable-shared --disable-freetype
cd util
./swftophp <PoC file>
```
## Contents of PoC file
```
Unzip the file below.
```
[PoC.zip](https://github.com/libming/libming/files/13632294/PoC.zip)
## Expected behavior 
Print error or warning messages handled within swftophp.
## Current behavior
```
header indicates a filesize of 3882510954 but filesize is 113
<?php
$m = new SWFMovie(10);

ming_setscale(1.0);
$m->setRate(81.316406);
$m->setDimension(17748, 2269);

/* Note: xMin and/or yMin are not 0! */

$m->setFrames(20817);
=================================================================
==1320551==ERROR: AddressSanitizer: requested allocation size 0xfffffffffffffffe (0x800 after adjustments for alignment, red zones etc.) exceeds maximum supported size of 0x10000000000 (thread T0)
    #0 0x7fd5cdeb4887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x55f956222f17 in readBytes (/home/smb8508/Desktop/work_space/debuging/libming/util/swftophp+0x57f17)
    #2 0x55f95620c06e in parseSWF_DEFINEBITS (/home/smb8508/Desktop/work_space/debuging/libming/util/swftophp+0x4106e)
    #3 0x55f9561edee4 in blockParse (/home/smb8508/Desktop/work_space/debuging/libming/util/swftophp+0x22ee4)
    #4 0x55f9561ed3ca in readMovie (/home/smb8508/Desktop/work_space/debuging/libming/util/swftophp+0x223ca)
    #5 0x55f9561edc3d in main (/home/smb8508/Desktop/work_space/debuging/libming/util/swftophp+0x22c3d)
    #6 0x7fd5cda29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

==1320551==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: allocation-size-too-big ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 in __interceptor_malloc
==1320551==ABORTING
```
Allocation-size-too-big in parseSWF_DEFINEBITS
This is a GitHub Issue
repo:libming
owner:libming
Title : Allocation-size-too-big in parseSWF_DEFINEBITS
Issue date:

--- start body ---
## Environment
Ubuntu 22.04.3 LTS
## Compiler
clang version 11.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
## Step to reproduce
```cd libming 
./autogen.sh
./configure --disable-shared --disable-freetype
cd util
./swftophp <PoC file>
```
## Contents of PoC file
```
Unzip the file below.
```
[PoC.zip](https://github.com/libming/libming/files/13632294/PoC.zip)
## Expected behavior 
Print error or warning messages handled within swftophp.
## Current behavior
```
header indicates a filesize of 3882510954 but filesize is 113
<?php
$m = new SWFMovie(10);

ming_setscale(1.0);
$m->setRate(81.316406);
$m->setDimension(17748, 2269);

/* Note: xMin and/or yMin are not 0! */

$m->setFrames(20817);
=================================================================
==1320551==ERROR: AddressSanitizer: requested allocation size 0xfffffffffffffffe (0x800 after adjustments for alignment, red zones etc.) exceeds maximum supported size of 0x10000000000 (thread T0)
    #0 0x7fd5cdeb4887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x55f956222f17 in readBytes (/home/smb8508/Desktop/work_space/debuging/libming/util/swftophp+0x57f17)
    #2 0x55f95620c06e in parseSWF_DEFINEBITS (/home/smb8508/Desktop/work_space/debuging/libming/util/swftophp+0x4106e)
    #3 0x55f9561edee4 in blockParse (/home/smb8508/Desktop/work_space/debuging/libming/util/swftophp+0x22ee4)
    #4 0x55f9561ed3ca in readMovie (/home/smb8508/Desktop/work_space/debuging/libming/util/swftophp+0x223ca)
    #5 0x55f9561edc3d in main (/home/smb8508/Desktop/work_space/debuging/libming/util/swftophp+0x22c3d)
    #6 0x7fd5cda29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

==1320551==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: allocation-size-too-big ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 in __interceptor_malloc
==1320551==ABORTING
```
--- end body ---

The issue in the parseSWF_DEFINEBITS function of libming allows for a Denial of Service (DoS) via a specially crafted SWF file that leads to an allocation size error. This can be exploited to crash the application due to excessive memory allocation requests.