Skip to content

Commit daaf3d5

Browse files
authored
Comment block should be padded
to even length
1 parent 30c2726 commit daaf3d5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

thirdparty/stb_image_write.h

+1
Original file line numberDiff line numberDiff line change
@@ -1532,6 +1532,7 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in
15321532
s->func(s->context, (void*)"parameters", strlen("parameters") + 1); // std::string is zero-terminated
15331533
s->func(s->context, (void*)parameters, std::min(param_length, (size_t) 65534) - 2 - strlen("parameters") - 1);
15341534
if(param_length > 65534) stbiw__putc(s, 0); // always zero-terminate for safety
1535+
if(param_length & 1) stbiw__putc(s, 0xFF); // pad to even length
15351536
}
15361537

15371538
s->func(s->context, (void*)head1, sizeof(head1));

0 commit comments

Comments
 (0)