Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security Vulnerability - Action Required: heap-based buffer overflow vulnerability may in your project #103

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/3rdparty/libjpeg/src/jdlossls.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,16 @@ METHODDEF(void)
simple_upscale(j_decompress_ptr cinfo,
JDIFFROW diff_buf, _JSAMPROW output_buf, JDIMENSION width)
{
do {
do {
#if BITS_IN_JSAMPLE == 12
/* 12-bit is the only data precision for which the range of the sample data
* type exceeds the valid sample range. Thus, we need to range-limit the
* samples, because other algorithms may try to use them as array indices.
*/
*output_buf++ = (_JSAMPLE)((*diff_buf++ << cinfo->Al) & 0xFFF);
#else
*output_buf++ = (_JSAMPLE)(*diff_buf++ << cinfo->Al);
#endif
} while (--width);
}

Expand All @@ -226,7 +234,11 @@ noscale(j_decompress_ptr cinfo,
JDIFFROW diff_buf, _JSAMPROW output_buf, JDIMENSION width)
{
do {
#if BITS_IN_JSAMPLE == 12
*output_buf++ = (_JSAMPLE)((*diff_buf++) & 0xFFF);
#else
*output_buf++ = (_JSAMPLE)(*diff_buf++);
#endif
} while (--width);
}

Expand Down