Skip to content

Commit

Permalink
fix out-of-bounds access to crop when lcp distortion correction is en…
Browse files Browse the repository at this point in the history
…abled
  • Loading branch information
agriggio committed Apr 8, 2017
1 parent eafe8d2 commit 73e1470
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rtengine/dcrop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1150,10 +1150,10 @@ bool Crop::setCropSizes (int rcx, int rcy, int rcw, int rch, int skip, bool inte
// distortion relative to the image
// size. BUT IS 15% REALLY ENOUGH?
// In fact, is there a better way??
orw = min(int(orw + dW), parent->fw);
orh = min(int(orh + dH), parent->fh);
orx = max(int(orx - dW/2.0), 0);
ory = max(int(ory - dH/2.0), 0);
orw = min(int(orw + dW), parent->fw - orx);
orh = min(int(orh + dH), parent->fh - ory);
}


Expand Down

0 comments on commit 73e1470

Please sign in to comment.