Language: C
Label: safe
CWE: CWE-787 \u2014 Out-of-bounds Write
The product writes data past the end, or before the beginning, of the intended buffer.

Code:
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);
}