summaryrefslogtreecommitdiffstats
path: root/libhb/scan.c
diff options
context:
space:
mode:
authoreddyg <[email protected]>2008-08-12 01:55:30 +0000
committereddyg <[email protected]>2008-08-12 01:55:30 +0000
commita075d4eb871d68f1ae1a7d9c202e1c3d8b6e8f57 (patch)
treea9d957ea070d711afc8b270ff4d4f802106801b6 /libhb/scan.c
parentab4016fe2a5119ee4bb39979323385006a015e39 (diff)
Don't crash HB when the video decoder (MPEG2 or ffmpeg) doesn't understand the format of the input and so therefore doesn't populate vid_info. Just skip that preview instead.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1626 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/scan.c')
-rw-r--r--libhb/scan.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libhb/scan.c b/libhb/scan.c
index 5cc0b414a..de4d565d6 100644
--- a/libhb/scan.c
+++ b/libhb/scan.c
@@ -494,7 +494,16 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title )
/* Get size and rate infos */
hb_work_info_t vid_info;
- vid_decoder->info( vid_decoder, &vid_info );
+ if( !vid_decoder->info( vid_decoder, &vid_info ) )
+ {
+ /*
+ * Could not fill vid_info, don't continue and try to use vid_info
+ * in this case.
+ */
+ vid_decoder->close( vid_decoder );
+ free( vid_decoder );
+ continue;
+ }
vid_decoder->close( vid_decoder );
free( vid_decoder );