Skip to content
Permalink
Browse files

music_mpg.c (getsome): return error if cvt-> buf is NULL

it means that we did not receive MPG123_NEW_FORMAT from libmpg123.
fixes segfaults with broken files.
  • Loading branch information
sezero committed Dec 14, 2019
1 parent b347209 commit e78e3fb505f8ed92e91a8e0117fa951694bf8902
Showing with 6 additions and 0 deletions.
  1. +6 −0 music_mpg.c
@@ -314,6 +314,12 @@ getsome(mpg_data* m)
return 0;
}

if (!cvt->buf) {
/* not received MPG123_NEW_FORMAT... */
Mix_SetError("music_mpg: No format.");
return 0;
}

SDL_memcpy(cvt->buf, data, cbdata);

if (cvt->needed) {

0 comments on commit e78e3fb

Please sign in to comment.