summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Kriener <floriank@google.com>2016-03-18 09:05:28 +0100
committerFlorian Kriener <floriank@google.com>2016-03-18 09:07:32 +0100
commite26fa7de870663aeffd61bdbb5bf9560c75964b6 (patch)
treeac97b8b122c85011879da401162320e43e4ecc43
parent1754202ed3e25b98179a4f377f0bdd605d9a157a (diff)
downloaddng_sdk-e26fa7de870663aeffd61bdbb5bf9560c75964b6.tar.gz
Fix some implementation defined behavior in dng_image.cpp
Some operations in dng_image.cpp of the form a + b and a - b, where a is of type int and b is of type uint32, would be computed as unsigned int operations due to "usual arithmetic conversions". This unsigned int result would then be stored as an int which is implementation defined.
-rw-r--r--source/dng_image.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/source/dng_image.cpp b/source/dng_image.cpp
index 41b54f0..ae99b9e 100644
--- a/source/dng_image.cpp
+++ b/source/dng_image.cpp
@@ -553,8 +553,8 @@ void dng_image::Get (dng_pixel_buffer &buffer,
edgeOption,
dng_rect (fBounds.t,
fBounds.l,
- fBounds.t + repeatV,
- fBounds.l + repeatH),
+ fBounds.t + (int)repeatV,
+ fBounds.l + (int)repeatH),
areaTL);
}
@@ -570,7 +570,7 @@ void dng_image::Get (dng_pixel_buffer &buffer,
edgeOption,
dng_rect (fBounds.t,
areaTM.l,
- fBounds.t + repeatV,
+ fBounds.t + (int)repeatV,
areaTM.r),
areaTM);
@@ -586,8 +586,8 @@ void dng_image::Get (dng_pixel_buffer &buffer,
GetEdge (buffer,
edgeOption,
dng_rect (fBounds.t,
- fBounds.r - repeatH,
- fBounds.t + repeatV,
+ fBounds.r - (int)repeatH,
+ fBounds.t + (int)repeatV,
fBounds.r),
areaTR);
@@ -605,7 +605,7 @@ void dng_image::Get (dng_pixel_buffer &buffer,
dng_rect (areaLM.t,
fBounds.l,
areaLM.b,
- fBounds.l + repeatH),
+ fBounds.l + (int)repeatH),
areaLM);
}
@@ -620,7 +620,7 @@ void dng_image::Get (dng_pixel_buffer &buffer,
GetEdge (buffer,
edgeOption,
dng_rect (areaRM.t,
- fBounds.r - repeatH,
+ fBounds.r - (int)repeatH,
areaRM.b,
fBounds.r),
areaRM);
@@ -636,10 +636,10 @@ void dng_image::Get (dng_pixel_buffer &buffer,
GetEdge (buffer,
edgeOption,
- dng_rect (fBounds.b - repeatV,
+ dng_rect (fBounds.b - (int)repeatV,
fBounds.l,
fBounds.b,
- fBounds.l + repeatH),
+ fBounds.l + (int)repeatH),
areaBL);
}
@@ -653,7 +653,7 @@ void dng_image::Get (dng_pixel_buffer &buffer,
GetEdge (buffer,
edgeOption,
- dng_rect (fBounds.b - repeatV,
+ dng_rect (fBounds.b - (int)repeatV,
areaBM.l,
fBounds.b,
areaBM.r),
@@ -670,8 +670,8 @@ void dng_image::Get (dng_pixel_buffer &buffer,
GetEdge (buffer,
edgeOption,
- dng_rect (fBounds.b - repeatV,
- fBounds.r - repeatH,
+ dng_rect (fBounds.b - (int)repeatV,
+ fBounds.r - (int)repeatH,
fBounds.b,
fBounds.r),
areaBR);