Browse Source

engine: common: soundlib: libmpg: backport fix for CVE-2017-12839.

Original patch: https://www.mpg123.de/cgi-bin/scm/mpg123/trunk/src/libmpg123/getbits.h?view=patch&r1=2024&r2=4323
Same as: 8a5e21a2a2
pull/2/head
Andrey Akhmichin 2 years ago committed by Alibek Omarov
parent
commit
ffd5c2d3d0
  1. 4
      engine/common/soundlib/libmpg/getbits.h

4
engine/common/soundlib/libmpg/getbits.h

@ -47,6 +47,10 @@ static uint getbits( mpg123_handle_t *fr, int number_of_bits )
{ {
ulong rval; 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 = fr->wordpointer[0];
rval <<= 8; rval <<= 8;
rval |= fr->wordpointer[1]; rval |= fr->wordpointer[1];

Loading…
Cancel
Save