Skip to content

Fix floor1 inverse_db_table indexing in stb_vorbis#1973

Open
meta-legend wants to merge 1 commit into
nothings:masterfrom
meta-legend:fix-#1934
Open

Fix floor1 inverse_db_table indexing in stb_vorbis#1973
meta-legend wants to merge 1 commit into
nothings:masterfrom
meta-legend:fix-#1934

Conversation

@meta-legend

Copy link
Copy Markdown

CVE-2019-13220 fix added y&255 mask in draw_line() (lines 2071, 2079). However, "do_floor()" has an inline optimization equivalent to "draw_line(target, lx, ly, n, ly, n2);" without the same mask (line 3104).

"draw_line()" uses inverse_db_table[y & 255], but this doesn't. If bad input causes ly to exceed 255, this can read past the end of inverse_db_table.

Note: my line number labels are off by 1 compared to the issue because I added my name to the contributors list

This also resolves #1934.

sezero added a commit to icculus/SDL_sound that referenced this pull request Jul 13, 2026
CVE-2019-13220 fix added y&255 mask in draw_line(). However, do_floor()
has an inline optimization equivalent to draw_line(target,lx,ly,n,ly,n2)
without the same mask.
draw_line() uses inverse_db_table[y&255], but this doesn't. If bad input
causes ly to exceed 255, this can read past the end of inverse_db_table.
c.f.: nothings/stb#1934.
Mainstream P/R nothings/stb#1973
sezero added a commit to icculus/SDL_sound that referenced this pull request Jul 13, 2026
CVE-2019-13220 fix added y&255 mask in draw_line(). However, do_floor()
has an inline optimization equivalent to draw_line(target,lx,ly,n,ly,n2)
without the same mask.
draw_line() uses inverse_db_table[y&255], but this doesn't. If bad input
causes ly to exceed 255, this can read past the end of inverse_db_table.
c.f.: nothings/stb#1934.
Mainstream P/R nothings/stb#1973

(cherry picked from commit 69cce71)
sezero added a commit to icculus/SDL_sound that referenced this pull request Jul 13, 2026
CVE-2019-13220 fix added y&255 mask in draw_line(). However, do_floor()
has an inline optimization equivalent to draw_line(target,lx,ly,n,ly,n2)
without the same mask.
draw_line() uses inverse_db_table[y&255], but this doesn't. If bad input
causes ly to exceed 255, this can read past the end of inverse_db_table.
c.f.: nothings/stb#1934.
Mainstream P/R nothings/stb#1973

(cherry picked from commit 69cce71)
sezero added a commit to libsdl-org/SDL_mixer that referenced this pull request Jul 13, 2026
CVE-2019-13220 fix added y&255 mask in draw_line(). However, do_floor()
has an inline optimization equivalent to draw_line(target,lx,ly,n,ly,n2)
without the same mask.
draw_line() uses inverse_db_table[y&255], but this doesn't. If bad input
causes ly to exceed 255, this can read past the end of inverse_db_table.
c.f.: nothings/stb#1934.
Mainstream P/R nothings/stb#1973
sezero added a commit to libsdl-org/SDL_mixer that referenced this pull request Jul 13, 2026
CVE-2019-13220 fix added y&255 mask in draw_line(). However, do_floor()
has an inline optimization equivalent to draw_line(target,lx,ly,n,ly,n2)
without the same mask.
draw_line() uses inverse_db_table[y&255], but this doesn't. If bad input
causes ly to exceed 255, this can read past the end of inverse_db_table.
c.f.: nothings/stb#1934.
Mainstream P/R nothings/stb#1973

(cherry picked from commit ce30df3)
sezero added a commit to libsdl-org/SDL_mixer that referenced this pull request Jul 13, 2026
CVE-2019-13220 fix added y&255 mask in draw_line(). However, do_floor()
has an inline optimization equivalent to draw_line(target,lx,ly,n,ly,n2)
without the same mask.
draw_line() uses inverse_db_table[y&255], but this doesn't. If bad input
causes ly to exceed 255, this can read past the end of inverse_db_table.
c.f.: nothings/stb#1934.
Mainstream P/R nothings/stb#1973

(cherry picked from commit 01a5783)
sezero added a commit to libsdl-org/SDL_mixer that referenced this pull request Jul 13, 2026
CVE-2019-13220 fix added y&255 mask in draw_line(). However, do_floor()
has an inline optimization equivalent to draw_line(target,lx,ly,n,ly,n2)
without the same mask.
draw_line() uses inverse_db_table[y&255], but this doesn't. If bad input
causes ly to exceed 255, this can read past the end of inverse_db_table.
c.f.: nothings/stb#1934.
Mainstream P/R nothings/stb#1973

(cherry picked from commit ce30df3)
sezero added a commit to libsdl-org/SDL_mixer that referenced this pull request Jul 13, 2026
CVE-2019-13220 fix added y&255 mask in draw_line(). However, do_floor()
has an inline optimization equivalent to draw_line(target,lx,ly,n,ly,n2)
without the same mask.
draw_line() uses inverse_db_table[y&255], but this doesn't. If bad input
causes ly to exceed 255, this can read past the end of inverse_db_table.
c.f.: nothings/stb#1934.
Mainstream P/R nothings/stb#1973
sezero added a commit to sezero/stb that referenced this pull request Jul 13, 2026
CVE-2019-13220 fix added y&255 mask in draw_line(). However, do_floor()
has an inline optimization equivalent to draw_line(target,lx,ly,n,ly,n2)
without the same mask.
draw_line() uses inverse_db_table[y&255], but this doesn't. If bad input
causes ly to exceed 255, this can read past the end of inverse_db_table.
c.f.: nothings#1934.
Mainstream P/R nothings#1973
AliceLR pushed a commit to libxmp/libxmp that referenced this pull request Jul 14, 2026
CVE-2019-13220 fix added y&255 mask in draw_line(). However, do_floor()
has an inline optimization equivalent to draw_line(target,lx,ly,n,ly,n2)
without the same mask.
draw_line() uses inverse_db_table[y&255], but this doesn't. If bad input
causes ly to exceed 255, this can read past the end of inverse_db_table.
c.f.: nothings/stb#1934.
Mainstream P/R nothings/stb#1973
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stb_vorbis: incomplete fix for CVE-2019-13220 in floor1 decode

2 participants