Skip to content
This repository has been archived by the owner on Dec 1, 2017. It is now read-only.

Commit

Permalink
(CVE-2016-5321 / CVE-2016-5323 , bugzilla #2558 / #2559)
Browse files Browse the repository at this point in the history
  • Loading branch information
erouault committed Jul 11, 2016
1 parent d9783e4 commit 2f79856
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* tools/tiffcrop.c: Avoid access outside of stack allocated array
on a tiled separate TIFF with more than 8 samples per pixel.
Reported by Kaixiang Zhang of the Cloud Security Team, Qihoo 360
(CVE-2016-5321, bugzilla #2558)
(CVE-2016-5321 / CVE-2016-5323 , bugzilla #2558 / #2559)

2016-07-10 Even Rouault <even.rouault at spatialys.com>

Expand Down
16 changes: 8 additions & 8 deletions tools/tiffcrop.c
Original file line number Diff line number Diff line change
Expand Up @@ -3738,7 +3738,7 @@ combineSeparateSamples8bits (uint8 *in[], uint8 *out, uint32 cols,

matchbits = maskbits << (8 - src_bit - bps);
/* load up next sample from each plane */
for (s = 0; s < spp; s++)
for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
{
src = in[s] + src_offset + src_byte;
buff1 = ((*src) & matchbits) << (src_bit);
Expand Down Expand Up @@ -3837,7 +3837,7 @@ combineSeparateSamples16bits (uint8 *in[], uint8 *out, uint32 cols,
src_bit = bit_offset % 8;

matchbits = maskbits << (16 - src_bit - bps);
for (s = 0; s < spp; s++)
for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
{
src = in[s] + src_offset + src_byte;
if (little_endian)
Expand Down Expand Up @@ -3947,7 +3947,7 @@ combineSeparateSamples24bits (uint8 *in[], uint8 *out, uint32 cols,
src_bit = bit_offset % 8;

matchbits = maskbits << (32 - src_bit - bps);
for (s = 0; s < spp; s++)
for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
{
src = in[s] + src_offset + src_byte;
if (little_endian)
Expand Down Expand Up @@ -4073,7 +4073,7 @@ combineSeparateSamples32bits (uint8 *in[], uint8 *out, uint32 cols,
src_bit = bit_offset % 8;

matchbits = maskbits << (64 - src_bit - bps);
for (s = 0; s < spp; s++)
for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
{
src = in[s] + src_offset + src_byte;
if (little_endian)
Expand Down Expand Up @@ -4263,7 +4263,7 @@ combineSeparateTileSamples8bits (uint8 *in[], uint8 *out, uint32 cols,

matchbits = maskbits << (8 - src_bit - bps);
/* load up next sample from each plane */
for (s = 0; s < spp; s++)
for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
{
src = in[s] + src_offset + src_byte;
buff1 = ((*src) & matchbits) << (src_bit);
Expand Down Expand Up @@ -4362,7 +4362,7 @@ combineSeparateTileSamples16bits (uint8 *in[], uint8 *out, uint32 cols,
src_bit = bit_offset % 8;

matchbits = maskbits << (16 - src_bit - bps);
for (s = 0; s < spp; s++)
for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
{
src = in[s] + src_offset + src_byte;
if (little_endian)
Expand Down Expand Up @@ -4471,7 +4471,7 @@ combineSeparateTileSamples24bits (uint8 *in[], uint8 *out, uint32 cols,
src_bit = bit_offset % 8;

matchbits = maskbits << (32 - src_bit - bps);
for (s = 0; s < spp; s++)
for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
{
src = in[s] + src_offset + src_byte;
if (little_endian)
Expand Down Expand Up @@ -4597,7 +4597,7 @@ combineSeparateTileSamples32bits (uint8 *in[], uint8 *out, uint32 cols,
src_bit = bit_offset % 8;

matchbits = maskbits << (64 - src_bit - bps);
for (s = 0; s < spp; s++)
for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
{
src = in[s] + src_offset + src_byte;
if (little_endian)
Expand Down

0 comments on commit 2f79856

Please sign in to comment.