diff options
author | John Stebbins <[email protected]> | 2018-11-07 09:30:53 -0800 |
---|---|---|
committer | John Stebbins <[email protected]> | 2018-11-07 09:30:53 -0800 |
commit | 48abfc4c6699bd455e49dc9a621aaaf3f47ce894 (patch) | |
tree | 14476d37ec8f063ae0d4bba7a1b535c42b045e91 /libhb/decsrtsub.c | |
parent | 5f4dbd6f17348ffeef6dd0de282f9f5ee68237bf (diff) |
decsrtsub: fix crash when file can't be opened
Diffstat (limited to 'libhb/decsrtsub.c')
-rw-r--r-- | libhb/decsrtsub.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libhb/decsrtsub.c b/libhb/decsrtsub.c index 43269e47d..d5c17c27e 100644 --- a/libhb/decsrtsub.c +++ b/libhb/decsrtsub.c @@ -693,6 +693,7 @@ fail: fclose(pv->file); } free(pv); + w->private_data = NULL; } return 1; } @@ -733,9 +734,12 @@ static int decsrtWork( hb_work_object_t * w, hb_buffer_t ** buf_in, static void decsrtClose( hb_work_object_t * w ) { hb_work_private_t * pv = w->private_data; - fclose( pv->file ); - iconv_close(pv->iconv_context); - free( w->private_data ); + if (pv != NULL) + { + fclose( pv->file ); + iconv_close(pv->iconv_context); + free( w->private_data ); + } } hb_work_object_t hb_decsrtsub = |