mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #6431
6431: fix bug when loading invalid opus file r=def- a=Marmare314 Trying to load any invalid opus file crashes the editor. ## Checklist - [x] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test (especially base/) or added coverage to integration test - [x] Considered possible null pointers and out of bounds array indexing - [x] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: marmare314 <49279081+Marmare314@users.noreply.github.com>
This commit is contained in:
commit
52217add6d
|
@ -676,6 +676,8 @@ int CSound::LoadOpusFromMem(const void *pData, unsigned DataSize, bool FromEdito
|
|||
return -1;
|
||||
|
||||
SampleID = DecodeOpus(SampleID, pData, DataSize);
|
||||
if(SampleID < 0)
|
||||
return -1;
|
||||
|
||||
RateConvert(SampleID);
|
||||
return SampleID;
|
||||
|
|
Loading…
Reference in a new issue