handle no language found

This commit is contained in:
Anshul Maheshwari 2015-01-09 13:14:32 +01:00
parent 2c9faa70ea
commit 94675b2dac
2 changed files with 6 additions and 1 deletions

View File

@ -435,6 +435,11 @@ void* dvbsub_init_decoder(struct dvb_config* cfg)
#ifdef ENABLE_OCR
ctx->ocr_ctx = init_ocr(ctx->lang_index);
if(!ctx->ocr_ctx)
{
freep(&ctx);
return NULL;
}
#endif
ctx->version = -1;

View File

@ -67,7 +67,7 @@ static void delete_ocr (struct ocrCtx* ctx)
{
TessBaseAPIEnd(ctx->api);
TessBaseAPIDelete(ctx->api);
freep(ctx);
freep(&ctx);
}
void* init_ocr(int lang_index)
{