Skip to content
Myr

Fix overflow in stbi_write_hdr_core()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

b056850ea9118b69325d973f8aef7f843527e299 left an additional multiplication by x, leading to overflow.

authored by PopPoLoPoPpo · committed by PopPoLoPoPpo · parent e6afb9c · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:stb_image_write.h+1 added-1 removed
692 unmodified lines
693#endif694 s->func(s->context, buffer, len);695696 for(i=0; i < y; i++)697 stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*x*(stbi__flip_vertically_on_write ? y-1-i : i)*x);697 stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*x*(stbi__flip_vertically_on_write ? y-1-i : i));698 STBIW_FREE(scratch);699 return 1;700 }701}
867 unmodified lines