Skip to content

Commit

Permalink
Changed offset checks against image dimensions to use >=
Browse files Browse the repository at this point in the history
  • Loading branch information
flyyee committed Jul 8, 2024
1 parent a4cfe72 commit 45c704a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libheif/pixelimage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -831,19 +831,19 @@ Error HeifPixelImage::overlay(std::shared_ptr<HeifPixelImage>& overlay, int dx,

// verify that the destination points are within the bounds of the image's dimensions
if (out_x0 < 0 ||
out_x0 > out_w ||
out_x0 >= out_w ||
out_y0 < 0 ||
out_y0 > out_h) {
out_y0 >= out_h) {
return Error(heif_error_Invalid_input,
heif_suberror_Invalid_overlay_data,
"Overlay image has invalid offsets");
}

// verify that the source points are within the bounds of the image's dimensions
if (in_x0 < 0 ||
in_x0 > in_w ||
in_x0 >= in_w ||
in_y0 < 0 ||
in_y0 > in_h) {
in_y0 >= in_h) {
return Error(heif_error_Invalid_input,
heif_suberror_Invalid_overlay_data,
"Overlay image has invalid offsets");
Expand Down

0 comments on commit 45c704a

Please sign in to comment.