Merge pull request #1655 from stweil/scanedg

block_edges: Add assertions for block coordinates
This commit is contained in:
Egor Pugin 2018-06-09 18:32:05 +03:00 committed by GitHub
commit a4241c9817
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,6 +50,8 @@ void block_edges(Pix *t_pix, // thresholded image
CRACKEDGE *free_cracks = nullptr;
block->bounding_box(bleft, tright); // block box
ASSERT_HOST(tright.x() <= width);
ASSERT_HOST(tright.y() <= height);
int block_width = tright.x() - bleft.x();
for (int x = block_width; x >= 0; x--)
ptrline[x] = nullptr; // no lines in progress