# FMOD\_System\_CreateSound wav file with zeros in total chunk size causes crash

**URL:** <https://qa.fmod.com/t/fmod-system-createsound-wav-file-with-zeros-in-total-chunk-size-causes-crash/14514>\
**Category:** FMOD Engine\
**Created:** [April 1, 2019, 3:12pm UTC](https://qa.fmod.com/t/fmod-system-createsound-wav-file-with-zeros-in-total-chunk-size-causes-crash/14514 "2019-04-01T15:12:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarcSpecter](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@MarcSpecter](https://qa.fmod.com/u/MarcSpecter)\
**Post date:** [April 1, 2019, 3:12pm UTC](https://qa.fmod.com/t/fmod-system-createsound-wav-file-with-zeros-in-total-chunk-size-causes-crash/14514/1 "2019-04-01T15:12:08Z")

</div>

Breakpoint below at line with \*\*\*\* at start.

Thanks

0x10041f429 \<+69\>: callq 0x100422190 ; FMOD::SystemI::validate(FMOD::System\*, FMOD::SystemI\*\*, FMOD::SystemLockScope\*)  
0x10041f42e \<+74\>: testl %eax, %eax  
0x10041f430 \<+76\>: jne 0x10041f456 ; \<+114\>  
0x10041f432 \<+78\>: movq -0x138(%rbp), %rdi  
0x10041f439 \<+85\>: movq %r14, %rsi  
0x10041f43c \<+88\>: movl %r15d, %edx  
0x10041f43f \<+91\>: movq %r12, %rcx  
0x10041f442 \<+94\>: movq -0x140(%rbp), %r8  
0x10041f449 \<+101\>: callq 0x100427c9e ; \_\_\_lldb\_unnamed\_symbol1436$$libfmodL.dylib  
\*\*\*\* 0x10041f44e \<+106\>: testl %eax, %eax . \ ***signal SIBABRT**  
0x10041f450 \<+108\>: je 0x10041f58d ; \<+425\>  
0x10041f456 \<+114\>: movl %r15d, %r13d  
0x10041f459 \<+117\>: movq %r12, -0x150(%rbp)  
0x10041f460 \<+124\>: leaq 0x8eefe(%rip), %rsi ; “/Users/fmod/jenkins/workspace/Build\_\_1.10\_\_API\_Mac/lowlevel\_api/src/fmod\_system.cpp”  
0x10041f467 \<+131\>: movl $0x3a4, %edx ; imm = 0x3A4  
0x10041f46c \<+136\>: movl %eax, %edi  
0x10041f46e \<+138\>: movl %eax, %r15d  
0x10041f471 \<+141\>: callq 0x1003dabb2 ; \_\_\_lldb\_unnamed\_symbol572$$libfmodL.dylib

---

<div class="post-metadata">

**Author:** ![MarcSpecter](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@MarcSpecter](https://qa.fmod.com/u/MarcSpecter)\
**Post date:** [April 2, 2019, 9:45am UTC](https://qa.fmod.com/t/fmod-system-createsound-wav-file-with-zeros-in-total-chunk-size-causes-crash/14514/2 "2019-04-02T09:45:15Z")

</div>

And this from FMOD memory logging (in  
[LOG] SystemI::createSoundInternal : Create name=‘xxxx.wav’  
LOG] MemPool::alloc : 528 bytes (0x101868ab8) (alloc 351)  
[LOG] MemPool::alloc : 600 bytes (0x10186bf68) (alloc 352)  
[LOG] MemPool::free : 600 bytes (0x10186bf68)  
[LOG] MemPool::alloc : 432 bytes (0x1018407c8) (alloc 353)  
[ERR] CodecFSB5::readHeader : Header check failed. Not an FSB5  
[LOG] MemPool::free : 432 bytes (0x1018407c8)  
[LOG] MemPool::alloc : 1312 bytes (0x102053e08) (alloc 354)  
[LOG] MemPool::free : -388396727 bytes (0x100403eab)

and codec logging:

[LOG] SystemI::createSoundInternal : 15 codecs found. Scan all until one succeeds  
[LOG] SystemI::createSoundInternal : Scan for tags.  
[LOG] CodecTag::openInternal : attempting to open ID3 or ASF tags…  
[LOG] Codec::release :  
[LOG] Codec::release : done  
[LOG] CodecWav::openInternal : attempting to open as WAV…  
[LOG] CodecWav::parseRIFF : chunk : id bext size 1114  
[LOG] CodecWav::parseRIFF : offset = 1126 / 0  
[LOG] Codec::release :  
[LOG] Codec::release : done  
[LOG] CodecFSB5::openInternal : attempting to open as FSB5…  
[ERR] CodecFSB5::readHeader : Header check failed. Not an FSB5  
[LOG] Codec::release :  
[LOG] Codec::release : done  
[LOG] CodecOggVorbis::openInternal : attempting to open as OGG…  
[LOG] CodecWav::parseRIFF : chunk : id bext size 1114  
[LOG] CodecWav::parseRIFF : offset = 1126 / 0

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [April 5, 2019, 3:48am UTC](https://qa.fmod.com/t/fmod-system-createsound-wav-file-with-zeros-in-total-chunk-size-causes-crash/14514/3 "2019-04-05T03:48:03Z")

</div>

Does this only occur with a specific file?  
If so are you able to send this to us: [support@fmod.com](mailto:support@fmod.com)

---

<div class="post-metadata">

**Author:** ![MarcSpecter](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@MarcSpecter](https://qa.fmod.com/u/MarcSpecter)\
**Post date:** [April 5, 2019, 8:59am UTC](https://qa.fmod.com/t/fmod-system-createsound-wav-file-with-zeros-in-total-chunk-size-causes-crash/14514/4 "2019-04-05T08:59:59Z")

</div>

I think it happens with any wav file. Just zero out bytes 5,6,7 and 8. And try to open stream on it.

Ive attached one,

(Attachment BB0484\_A001-002B-\_010.WAV.zip is missing)

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [April 8, 2019, 1:42am UTC](https://qa.fmod.com/t/fmod-system-createsound-wav-file-with-zeros-in-total-chunk-size-causes-crash/14514/5 "2019-04-08T01:42:55Z")

</div>

Thanks very much for the file.

We can see how this 0 chunk length file can cause a problem and have fixed the reason for the crash for the next release.

---

<div class="post-metadata">

**Author:** ![MarcSpecter](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@MarcSpecter](https://qa.fmod.com/u/MarcSpecter)\
**Post date:** [July 11, 2020, 1:02am UTC](https://qa.fmod.com/t/fmod-system-createsound-wav-file-with-zeros-in-total-chunk-size-causes-crash/14514/6 "2020-07-11T01:02:45Z")

</div>

Hello there.

I just downloaded the latest FMOD libs with the claimed fix for this issue:  
“Core API - Fix crash trying to load corrupt WAV files with 0 length chunk size.”

I am still getting 0 length chunk wav files crashing.

NB: these files also have 0 length data chunks, but when I add an overall length value to the file, the lack of a data chunk size doesnt cause a crash.

Thanks  
Marc

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [July 13, 2020, 6:06am UTC](https://qa.fmod.com/t/fmod-system-createsound-wav-file-with-zeros-in-total-chunk-size-causes-crash/14514/7 "2020-07-13T06:06:04Z")

</div>

Zero length file should just return `fmod_err_plugin`, the crash must be caused by something else. Are you able to provide a repro or logs at all?
