mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-15 21:23:10 +00:00
Fix memory leaks (#1511)
This commit is contained in:
@@ -1600,7 +1600,9 @@ static int write_dvb_sub(struct lib_cc_decode *dec_ctx, struct cc_subtitle *sub)
|
||||
break;
|
||||
}
|
||||
|
||||
rect->data1 = malloc(1024);
|
||||
if (rect->data1 == NULL) {
|
||||
rect->data1 = malloc(1024);
|
||||
}
|
||||
memset(rect->data1, 0, 1024);
|
||||
memcpy(rect->data1, clut_table, (1 << region->depth) * sizeof(uint32_t));
|
||||
assert(((1 << region->depth) * sizeof(uint32_t)) <= 1024);
|
||||
|
||||
@@ -672,14 +672,14 @@ char *ocr_bitmap(void *arg, png_color *palette, png_byte *alpha, unsigned char *
|
||||
line_start = line_end + 1;
|
||||
}
|
||||
*new_text_out_iter = '\0';
|
||||
free(text_out);
|
||||
freep(&text_out);
|
||||
text_out = new_text_out;
|
||||
}
|
||||
}
|
||||
TessResultIteratorDelete(ri);
|
||||
}
|
||||
// End Color Detection
|
||||
|
||||
freep(&text_out);
|
||||
boxDestroy(&crop_points);
|
||||
|
||||
pixDestroy(&pix);
|
||||
|
||||
Reference in New Issue
Block a user