diff options
author | Florian Kriener <floriank@google.com> | 2016-03-18 09:05:28 +0100 |
---|---|---|
committer | Florian Kriener <floriank@google.com> | 2016-03-18 09:07:32 +0100 |
commit | e26fa7de870663aeffd61bdbb5bf9560c75964b6 (patch) | |
tree | ac97b8b122c85011879da401162320e43e4ecc43 | |
parent | 1754202ed3e25b98179a4f377f0bdd605d9a157a (diff) | |
download | dng_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.cpp | 24 |
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); |