Skip to content

Commit

Permalink
Import an stb_vorbis fix from upstream PR/1563:
Browse files Browse the repository at this point in the history
Patch by Seb de Graffenried (@Seb-degraff): nothings/stb#1563
Fixes distorted decompressed audio when UBSan was enabled.
  • Loading branch information
sezero committed Nov 7, 2023
1 parent ebb9b9c commit c015a42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/codecs/stb_vorbis/stb_vorbis.h
Original file line number Diff line number Diff line change
Expand Up @@ -2153,15 +2153,15 @@ STB_FORCEINLINE void draw_line(float *output, int x0, int y0, int x1, int y1, in
ady -= abs(base) * adx;
if (x1 > n) x1 = n;
if (x < x1) {
LINE_OP(output[x], inverse_db_table[y&255]);
LINE_OP(output[x], inverse_db_table[(uint32)y&255]);
for (++x; x < x1; ++x) {
err += ady;
if (err >= adx) {
err -= adx;
y += sy;
} else
y += base;
LINE_OP(output[x], inverse_db_table[y&255]);
LINE_OP(output[x], inverse_db_table[(uint32)y&255]);
}
}
}
Expand Down

0 comments on commit c015a42

Please sign in to comment.