Skip to content

Commit

Permalink
Fixed bug 3900 - timidity/readmidi.c (getvl): check if the read is su…
Browse files Browse the repository at this point in the history
…ccessful.

Ozkan Sezer

fixes valgrind warning with broken midi files
  • Loading branch information
slouken committed Oct 21, 2017
1 parent 4b6c333 commit 283a34f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion timidity/readmidi.c
Expand Up @@ -45,7 +45,7 @@ static Sint32 getvl(SDL_RWops *rw)
Uint8 c;
for (;;)
{
SDL_RWread(rw, &c, 1, 1);
if (!SDL_RWread(rw, &c, 1, 1)) return l;
l += (c & 0x7f);
if (!(c & 0x80)) return l;
l<<=7;
Expand Down

0 comments on commit 283a34f

Please sign in to comment.