Skip to content

Commit f139482

Browse files
committed
SECUNIA advisory 76000 #1 (wrong fuji width set via tiff tag
1 parent 74d1795 commit f139482

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

Diff for: dcraw/dcraw.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -3172,7 +3172,7 @@ void CLASS panasonic_load_raw()
31723172
int row, col, i, j, sh = 0, pred[2], nonz[2];
31733173

31743174
pana_bits(0);
3175-
for (row = 0; row < height; row++)
3175+
for (row = 0; row < raw_height; row++)
31763176
{
31773177
#ifdef LIBRAW_LIBRARY_BUILD
31783178
checkCancel();
@@ -3194,7 +3194,7 @@ void CLASS panasonic_load_raw()
31943194
}
31953195
else if ((nonz[i & 1] = pana_bits(8)) || i > 11)
31963196
pred[i & 1] = nonz[i & 1] << 4 | pana_bits(4);
3197-
if ((RAW(row, col) = pred[col & 1]) > 4098 && col < width)
3197+
if ((RAW(row, col) = pred[col & 1]) > 4098 && col < width && row < height)
31983198
derror();
31993199
}
32003200
}
@@ -15037,6 +15037,9 @@ void CLASS parse_fuji(int offset)
1503715037
entries = get4();
1503815038
if (entries > 255)
1503915039
return;
15040+
#ifdef LIBRAW_LIBRARY_BUILD
15041+
imgdata.process_warnings |= LIBRAW_WARN_PARSEFUJI_PROCESSED;
15042+
#endif
1504015043
while (entries--)
1504115044
{
1504215045
tag = get2();
@@ -19580,6 +19583,11 @@ void CLASS identify()
1958019583
if (raw_color)
1958119584
adobe_coeff("Apple", "Quicktake");
1958219585

19586+
#ifdef LIBRAW_LIBRARY_BUILD
19587+
// Clear erorneus fuji_width if not set through parse_fuji or for DNG
19588+
if(fuji_width && !dng_version && !(imgdata.process_warnings & LIBRAW_WARN_PARSEFUJI_PROCESSED ))
19589+
fuji_width = 0;
19590+
#endif
1958319591
if (fuji_width)
1958419592
{
1958519593
fuji_width = width >> !fuji_layout;

Diff for: internal/dcraw_common.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -2875,7 +2875,7 @@ void CLASS panasonic_load_raw()
28752875
int row, col, i, j, sh = 0, pred[2], nonz[2];
28762876

28772877
pana_bits(0);
2878-
for (row = 0; row < height; row++)
2878+
for (row = 0; row < raw_height; row++)
28792879
{
28802880
#ifdef LIBRAW_LIBRARY_BUILD
28812881
checkCancel();
@@ -2897,7 +2897,7 @@ void CLASS panasonic_load_raw()
28972897
}
28982898
else if ((nonz[i & 1] = pana_bits(8)) || i > 11)
28992899
pred[i & 1] = nonz[i & 1] << 4 | pana_bits(4);
2900-
if ((RAW(row, col) = pred[col & 1]) > 4098 && col < width)
2900+
if ((RAW(row, col) = pred[col & 1]) > 4098 && col < width && row < height)
29012901
derror();
29022902
}
29032903
}
@@ -13708,6 +13708,9 @@ void CLASS parse_fuji(int offset)
1370813708
entries = get4();
1370913709
if (entries > 255)
1371013710
return;
13711+
#ifdef LIBRAW_LIBRARY_BUILD
13712+
imgdata.process_warnings |= LIBRAW_WARN_PARSEFUJI_PROCESSED;
13713+
#endif
1371113714
while (entries--)
1371213715
{
1371313716
tag = get2();
@@ -18091,6 +18094,11 @@ void CLASS identify()
1809118094
if (raw_color)
1809218095
adobe_coeff("Apple", "Quicktake");
1809318096

18097+
#ifdef LIBRAW_LIBRARY_BUILD
18098+
// Clear erorneus fuji_width if not set through parse_fuji or for DNG
18099+
if(fuji_width && !dng_version && !(imgdata.process_warnings & LIBRAW_WARN_PARSEFUJI_PROCESSED ))
18100+
fuji_width = 0;
18101+
#endif
1809418102
if (fuji_width)
1809518103
{
1809618104
fuji_width = width >> !fuji_layout;

Diff for: libraw/libraw_const.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ enum LibRaw_warnings
231231
LIBRAW_WARN_RAWSPEED_PROBLEM = 1 << 12,
232232
LIBRAW_WARN_RAWSPEED_UNSUPPORTED = 1 << 13,
233233
LIBRAW_WARN_RAWSPEED_PROCESSED = 1 << 14,
234-
LIBRAW_WARN_FALLBACK_TO_AHD = 1 << 15
234+
LIBRAW_WARN_FALLBACK_TO_AHD = 1 << 15,
235+
LIBRAW_WARN_PARSEFUJI_PROCESSED = 1 << 16
235236
};
236237

237238
enum LibRaw_exceptions

0 commit comments

Comments
 (0)