24 lines
714 B
Diff
24 lines
714 B
Diff
https://github.com/LibRaw/LibRaw/commit/8303e74b0567806dd5f16fc39aab70fe928de1a2
|
|
diff --git a/internal/dcraw_common.cpp b/internal/dcraw_common.cpp
|
|
index 18bcdbcb..8fb2b073 100644
|
|
--- a/internal/dcraw_common.cpp
|
|
+++ b/internal/dcraw_common.cpp
|
|
@@ -3240,8 +3240,15 @@ void CLASS kodak_65000_load_raw()
|
|
len = MIN (256, width-col);
|
|
ret = kodak_65000_decode (buf, len);
|
|
for (i=0; i < len; i++)
|
|
- if ((RAW(row,col+i) = curve[ret ? buf[i] :
|
|
- (pred[i & 1] += buf[i])]) >> 12) derror();
|
|
+ {
|
|
+ int idx = ret ? buf[i] : (pred[i & 1] += buf[i]);
|
|
+ if(idx >=0 && idx <= 0xffff)
|
|
+ {
|
|
+ if ((RAW(row,col+i) = curve[idx]) >> 12) derror();
|
|
+ }
|
|
+ else
|
|
+ derror();
|
|
+ }
|
|
}
|
|
}
|
|
}
|