Skip to content

Commit

Permalink
Improvement to dcraw linear_table #6448
Browse files Browse the repository at this point in the history
Merged on behalf of heckflosse
#6448 (comment)
  • Loading branch information
Beep6581 committed Dec 18, 2022
1 parent 3713e36 commit bbe4558
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions rtengine/dcraw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6319,12 +6319,13 @@ void CLASS parse_mos (int offset)

void CLASS linear_table (unsigned len)
{
int i;
if (len > 0x10000) len = 0x10000;
read_shorts (curve, len);
for (i=len; i < 0x10000; i++)
curve[i] = curve[i-1];
maximum = curve[0xffff];
const unsigned maxLen = std::min(0x10000ull, 1ull << tiff_bps);
len = std::min(len, maxLen);
read_shorts(curve, len);
maximum = curve[len - 1];
for (std::size_t i = len; i < maxLen; ++i) {
curve[i] = maximum;
}
}

void CLASS parse_kodak_ifd (int base)
Expand Down

0 comments on commit bbe4558

Please sign in to comment.