diff options
author | Damiano Galassi <[email protected]> | 2016-03-01 07:57:57 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2016-03-01 07:57:57 +0100 |
commit | 5ccde7ad2965d70247805ca850024a0ee779efd8 (patch) | |
tree | 1e46e5291fb31e58f9e8600b851c5dd733c0d00e /libhb | |
parent | 98deecc40488a83c80a4e55ec2e3f25f4523c37a (diff) |
scan: check if the video decoder was properly initialized before decoding the preview.
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/scan.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libhb/scan.c b/libhb/scan.c index 4a110c489..78a14e8ca 100644 --- a/libhb/scan.c +++ b/libhb/scan.c @@ -568,12 +568,21 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title, int flush ) if (title->video_codec == WORK_NONE) { hb_error("No video decoder set!"); + free(info_list); + crop_record_free(crops); return 0; } hb_work_object_t *vid_decoder = hb_get_work(data->h, title->video_codec); vid_decoder->codec_param = title->video_codec_param; vid_decoder->title = title; - vid_decoder->init( vid_decoder, NULL ); + + if (vid_decoder->init(vid_decoder, NULL)) + { + hb_error("Decoder init failed!"); + free(info_list); + crop_record_free(crops); + return 0; + } for( i = 0; i < data->preview_count; i++ ) { |