mirror of
https://github.com/libjpeg-turbo/libjpeg-turbo.git
synced 2026-01-18 21:41:20 +01:00
tjTransform(): Range check transform operations
This commit is contained in:
@@ -1999,6 +1999,8 @@ DLLEXPORT int tjTransform(tjhandle handle, const unsigned char *jpegBuf,
|
||||
jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (t[i].op < 0 || t[i].op >= TJ_NUMXOP)
|
||||
THROW("Invalid transform operation");
|
||||
xinfo[i].transform = xformtypes[t[i].op];
|
||||
xinfo[i].perfect = (t[i].options & TJXOPT_PERFECT) ? 1 : 0;
|
||||
xinfo[i].trim = (t[i].options & TJXOPT_TRIM) ? 1 : 0;
|
||||
|
||||
Reference in New Issue
Block a user