Skip to content

Commit

Permalink
tjTransform(): Use instance err. for bad crop spec
Browse files Browse the repository at this point in the history
Addresses a concern raised in mozilla#396
  • Loading branch information
dcommander committed Dec 31, 2019
1 parent 29f718e commit 6367924
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion turbojpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1906,10 1906,11 @@ DLLEXPORT int tjTransform(tjhandle handle, const unsigned char *jpegBuf,
if (xinfo[i].crop) {
if ((t[i].r.x % xinfo[i].iMCU_sample_width) != 0 ||
(t[i].r.y % xinfo[i].iMCU_sample_height) != 0) {
snprintf(errStr, JMSG_LENGTH_MAX,
snprintf(this->errStr, JMSG_LENGTH_MAX,
"To crop this JPEG image, x must be a multiple of %d\n"
"and y must be a multiple of %d.\n",
xinfo[i].iMCU_sample_width, xinfo[i].iMCU_sample_height);
this->isInstanceError = TRUE;
retval = -1; goto bailout;
}
}
Expand Down

0 comments on commit 6367924

Please sign in to comment.