Fix overflow in stbi_write_hdr_core()

b056850ea9 left an additional multiplication by x,
leading to overflow.
pull/572/head
PopPoLoPoPpo 2018-02-27 00:08:45 +01:00
parent e6afb9cbae
commit f685ee4e58
1 changed files with 1 additions and 1 deletions

View File

@ -694,7 +694,7 @@ static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, f
s->func(s->context, buffer, len);
for(i=0; i < y; i++)
stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*x*(stbi__flip_vertically_on_write ? y-1-i : i)*x);
stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*x*(stbi__flip_vertically_on_write ? y-1-i : i));
STBIW_FREE(scratch);
return 1;
}