Skip to content

Commit

Permalink
OpenCL: Fix heap buffer overflow
Browse files Browse the repository at this point in the history
Bug message from AddressSanitizer:

    ==6158==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7fffe774b7fc at pc 0x555557086b54 bp 0x7fffffffcee0 sp 0x7fffffffced8
    READ of size 1 at 0x7fffe774b7fc thread T0
        #0 0x555557086b53 in tesseract::HistogramRect(Pix*, int, int, int, int, int, int*) ../../../../../src/ccstruct/otsuthr.cpp:163

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Jan 19, 2019
1 parent 58447c0 commit ad19183
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/opencl/openclwrapper.cpp
Expand Up @@ -1998,7 +1998,7 @@ static void populateTessScoreEvaluationInputData(
}
}

input->pix = pixCreate(input->width, input->height, 1);
input->pix = pixCreate(input->width, input->height, 8 * input->numChannels);
}

struct TessDeviceScore {
Expand Down

0 comments on commit ad19183

Please sign in to comment.