Lossless: Fix innocuous UBSan warnings
This commit is contained in:
@@ -256,8 +256,9 @@ METHODDEF(void)
|
|||||||
simple_downscale(j_compress_ptr cinfo,
|
simple_downscale(j_compress_ptr cinfo,
|
||||||
_JSAMPROW input_buf, _JSAMPROW output_buf, JDIMENSION width)
|
_JSAMPROW input_buf, _JSAMPROW output_buf, JDIMENSION width)
|
||||||
{
|
{
|
||||||
while (width--)
|
do {
|
||||||
*output_buf++ = (_JSAMPLE)RIGHT_SHIFT(*input_buf++, cinfo->Al);
|
*output_buf++ = (_JSAMPLE)RIGHT_SHIFT(*input_buf++, cinfo->Al);
|
||||||
|
} while (--width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -196,7 +196,8 @@ decompress_data(j_decompress_ptr cinfo, _JSAMPIMAGE output_buf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Account for restart interval (no-op if not using restarts) */
|
/* Account for restart interval (no-op if not using restarts) */
|
||||||
diff->restart_rows_to_go--;
|
if (cinfo->restart_interval)
|
||||||
|
diff->restart_rows_to_go--;
|
||||||
|
|
||||||
/* Completed an MCU row, but perhaps not an iMCU row */
|
/* Completed an MCU row, but perhaps not an iMCU row */
|
||||||
diff->MCU_ctr = 0;
|
diff->MCU_ctr = 0;
|
||||||
|
|||||||
@@ -216,16 +216,18 @@ METHODDEF(void)
|
|||||||
simple_upscale(j_decompress_ptr cinfo,
|
simple_upscale(j_decompress_ptr cinfo,
|
||||||
JDIFFROW diff_buf, _JSAMPROW output_buf, JDIMENSION width)
|
JDIFFROW diff_buf, _JSAMPROW output_buf, JDIMENSION width)
|
||||||
{
|
{
|
||||||
while (width--)
|
do {
|
||||||
*output_buf++ = (_JSAMPLE)(*diff_buf++ << cinfo->Al);
|
*output_buf++ = (_JSAMPLE)(*diff_buf++ << cinfo->Al);
|
||||||
|
} while (--width);
|
||||||
}
|
}
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
noscale(j_decompress_ptr cinfo,
|
noscale(j_decompress_ptr cinfo,
|
||||||
JDIFFROW diff_buf, _JSAMPROW output_buf, JDIMENSION width)
|
JDIFFROW diff_buf, _JSAMPROW output_buf, JDIMENSION width)
|
||||||
{
|
{
|
||||||
while (width--)
|
do {
|
||||||
*output_buf++ = (_JSAMPLE)(*diff_buf++);
|
*output_buf++ = (_JSAMPLE)(*diff_buf++);
|
||||||
|
} while (--width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user