mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-06-11 12:43:17 +08:00
Fixed issue 1114
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@1073 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
parent
0dd47a2fd5
commit
e6e6c35ee1
@ -104,7 +104,7 @@ CharSamp *CharSamp::FromCharDumpFile(CachedFile *fp) {
|
||||
return NULL;
|
||||
}
|
||||
// the label is not null terminated in the file
|
||||
if (val32 > 0) {
|
||||
if (val32 > 0 && val32 < MAX_UINT32) {
|
||||
label32 = new char_32[val32 + 1];
|
||||
if (label32 == NULL) {
|
||||
return NULL;
|
||||
@ -193,7 +193,7 @@ CharSamp *CharSamp::FromCharDumpFile(FILE *fp) {
|
||||
return NULL;
|
||||
}
|
||||
// the label is not null terminated in the file
|
||||
if (val32 > 0) {
|
||||
if (val32 > 0 && val32 < MAX_UINT32) {
|
||||
label32 = new char_32[val32 + 1];
|
||||
if (label32 == NULL) {
|
||||
return NULL;
|
||||
@ -592,7 +592,7 @@ CharSamp *CharSamp::FromCharDumpFile(unsigned char **raw_data_ptr) {
|
||||
memcpy(&val32, raw_data, sizeof(val32));
|
||||
raw_data += sizeof(val32);
|
||||
// the label is not null terminated in the file
|
||||
if (val32 > 0) {
|
||||
if (val32 > 0 && val32 < MAX_UINT32) {
|
||||
label32 = new char_32[val32 + 1];
|
||||
if (label32 == NULL) {
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user