Skip to content

Commit

Permalink
soundlib: fix CVE-2017-12839 in libmpg123
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr0maks committed Aug 18, 2022
1 parent f246a0c commit 8a5e21a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion engine/common/soundlib/libmpg/getbits.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ static uint32_t getbits( mpg123_handle_t *fr, int number_of_bits )
{
ulong rval;

if( (long)(fr->wordpointer-fr->bsbuf)*8
+ fr->bitindex+number_of_bits > (long)fr->framesize*8 )
return 0;

rval = fr->wordpointer[0];
rval <<= 8;
rval |= fr->wordpointer[1];
Expand All @@ -73,4 +77,4 @@ static uint32_t getbits( mpg123_handle_t *fr, int number_of_bits )
return rval;
}

#endif//GETBITS_H
#endif//GETBITS_H

0 comments on commit 8a5e21a

Please sign in to comment.