Repository navigation
Conversation
Expands the setup_malloc size parameter, and various calculations that the Vorbis spec allows to exceed 32 bits, to uint64. setup_malloc and setup_temp_malloc now reject allocations that exceed INT_MAX, as the underlying memory fields are still 32 bit signed integers.
|
Expands the setup_malloc size parameter, and various calculations that the Vorbis spec allows to exceed 32 bits, to uint64. setup_malloc and setup_temp_malloc still reject allocations that exceed INT_MAX, as the underlying memory fields are still 32 bit signed integers. Mainstream P/R: nothings/stb#1960 Reference issue: libxmp#996 Also see: nothings/stb#1947 Also see: nothings/stb#1933 Also see: nothings/stb#1168 (comment)
Expands the setup_malloc size parameter, and various calculations that the Vorbis spec allows to exceed 32 bits, to uint64. setup_malloc and setup_temp_malloc still reject allocations that exceed INT_MAX, as the underlying memory fields are still 32 bit signed integers. Mainstream P/R: nothings/stb#1960 Reference issue: libxmp#996 Also see: nothings/stb#1947 Also see: nothings/stb#1933 Also see: nothings/stb#1168 (comment)
Expands the setup_malloc size parameter, and various calculations that the Vorbis spec allows to exceed 32 bits, to uint64. setup_malloc and setup_temp_malloc still reject allocations that exceed INT_MAX, as the underlying memory fields are still 32 bit signed integers. Mainstream P/R: nothings/stb#1960 Reference issue: #996 Also see: nothings/stb#1947 Also see: nothings/stb#1933 Also see: nothings/stb#1168 (comment) Co-authored-by: AliceLR <petrifiedrowan@gmail.com>
Expands the setup_malloc size parameter, and various calculations that the Vorbis spec allows to exceed 32 bits, to uint64. setup_malloc and setup_temp_malloc still reject allocations that exceed INT_MAX, as the underlying memory fields are still 32 bit signed integers. Reference issue: libxmp/libxmp#996 Reference issue: nothings#1947 Reference issue: nothings#1933 Also see : nothings#1168 (comment) Mainstream P/R : nothings#1960
Expands the setup_malloc size parameter, and various calculations that the Vorbis spec allows to exceed 32 bits, to uint64. setup_malloc and setup_temp_malloc still reject allocations that exceed INT_MAX, as the underlying memory fields are still 32 bit signed integers. Reference issue: libxmp/libxmp#996 Reference issue: nothings/stb#1947 Reference issue: nothings/stb#1933 Also see : nothings/stb#1168 (comment) Mainstream P/R : nothings/stb#1960 (cherry picked from commit 19ae8a8)
Expands the setup_malloc size parameter, and various calculations that the Vorbis spec allows to exceed 32 bits, to uint64. setup_malloc and setup_temp_malloc still reject allocations that exceed INT_MAX, as the underlying memory fields are still 32 bit signed integers. Reference issue: libxmp/libxmp#996 Reference issue: nothings/stb#1947 Reference issue: nothings/stb#1933 Also see : nothings/stb#1168 (comment) Mainstream P/R : nothings/stb#1960
Expands the setup_malloc size parameter, and various calculations that the Vorbis spec allows to exceed 32 bits, to uint64. setup_malloc and setup_temp_malloc still reject allocations that exceed INT_MAX, as the underlying memory fields are still 32 bit signed integers. Reference issue: libxmp/libxmp#996 Reference issue: nothings/stb#1947 Reference issue: nothings/stb#1933 Also see : nothings/stb#1168 (comment) Mainstream P/R : nothings/stb#1960 (cherry picked from commit 369279b)
Expands the setup_malloc size parameter, and various calculations that the Vorbis spec allows to exceed 32 bits, to uint64. setup_malloc and setup_temp_malloc still reject allocations that exceed INT_MAX, as the underlying memory fields are still 32 bit signed integers. Reference issue: libxmp/libxmp#996 Reference issue: nothings/stb#1947 Reference issue: nothings/stb#1933 Also see : nothings/stb#1168 (comment) Mainstream P/R : nothings/stb#1960
Expands the setup_malloc size parameter, and various calculations that the Vorbis spec allows to exceed 32 bits, to uint64. setup_malloc and setup_temp_malloc still reject allocations that exceed INT_MAX, as the underlying memory fields are still 32 bit signed integers. Reference issue: libxmp/libxmp#996 Reference issue: nothings/stb#1947 Reference issue: nothings/stb#1933 Also see : nothings/stb#1168 (comment) Mainstream P/R : nothings/stb#1960 (cherry picked from commit 369279b)
Expands the setup_malloc size parameter, and various calculations that the Vorbis spec allows to exceed 32 bits, to uint64. setup_malloc and setup_temp_malloc still reject allocations that exceed INT_MAX, as the underlying memory fields are still 32 bit signed integers. Reference issue: libxmp/libxmp#996 Reference issue: nothings/stb#1947 Reference issue: nothings/stb#1933 Also see : nothings/stb#1168 (comment) Mainstream P/R : nothings/stb#1960
Expands the setup_malloc size parameter, and various calculations that the Vorbis spec allows to exceed 32 bits, to uint64. setup_malloc and setup_temp_malloc still reject allocations that exceed INT_MAX, as the underlying memory fields are still 32 bit signed integers. Reference issue: libxmp/libxmp#996 Reference issue: nothings/stb#1947 Reference issue: nothings/stb#1933 Also see : nothings/stb#1168 (comment) Mainstream P/R : nothings/stb#1960 (cherry picked from commit 52afb20)
Backported from libsdl-org/SDL_mixer@369279b xpands the setup_malloc size parameter, and various calculations that the Vorbis spec allows to exceed 32 bits, to uint64. setup_malloc and setup_temp_malloc still reject allocations that exceed INT_MAX, as the underlying memory fields are still 32 bit signed integers. Reference issue: libxmp/libxmp#996 Reference issue: nothings/stb#1947 Reference issue: nothings/stb#1933 Also see : nothings/stb#1168 (comment) Mainstream P/R : nothings/stb#1960
|
Without putting too much thought into it, I think my preference would be that it's okay to use 64-bit to compute the products but to still bail if the size is larger than 32-bit, since it's surely a problematic file anyway, i.e. 64-bit locals okay, but not in structs. |
That sounds reasonable. I will update this patch when I get a chance. |
|
Also, the whole use of floor(pow) and floor(exp(log())) for integer powers, seems crazy to me, it should probably be done by repeated multiplication, or at least rounding with floor(...+0.5)? Weird that I did it that way in the first place. |
|
Yeah, maybe better to just use #2021 . |
That's also reasonable IMO; it is essentially what I would have implemented if you had rejected |
7b777aa to
b895b0f
Compare
|
I've pushed a second commit that limits |
|
Removed |
|
At long last merged into dev branch, will be in the next release. |
Marking as a draft for now since it's poorly tested, but this should fix #1933, #1947, and the second case in the comment #1168 (comment). However, it's not clear if this is the fix you actually want (particularly re: the definition of
uint64and various type-corrections).@nothings I've noticed several dubious submissions duplicating parts of bug reports and patches I submitted years ago. Is there anything I can do to help?