!7752 [Data]Fix crop param when x = 0 or y = 0

Merge pull request !7752 from xulei/lite_test0905
pull/7752/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit 12251ac612

@ -441,7 +441,7 @@ static void CropInternal(const LiteMat &src, LiteMat &dst, int x, int y, int w,
}
bool Crop(const LiteMat &src, LiteMat &dst, int x, int y, int w, int h) {
if (x <= 0 || y <= 0 || w <= 0 || h <= 0) {
if (x < 0 || y < 0 || w <= 0 || h <= 0) {
return false;
}
if (y + h > src.height_ || x + w > src.width_) {

Loading…
Cancel
Save