Skip to content

Commit 59caf94

Browse files
committed
native_midi_common.c (ReadMIDIFile): fix possible NULL ptr dereference.
if allocation of mididata->track ever fails we'd still be dereferencing it under 'bail' (cherry picked from commit 9c5ccc0)
1 parent 5a01fae commit 59caf94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/codecs/native_midi/native_midi_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ static MIDIEvent *MIDItoStream(MIDIFile *mididata)
262262

263263
static int ReadMIDIFile(MIDIFile *mididata, SDL_RWops *src)
264264
{
265-
int i = 0;
265+
int i = -1;
266266
Uint32 ID;
267267
Uint32 size;
268268
Uint16 format;

0 commit comments

Comments
 (0)