diff options
author | van <[email protected]> | 2008-02-29 18:33:45 +0000 |
---|---|---|
committer | van <[email protected]> | 2008-02-29 18:33:45 +0000 |
commit | ba78192db9012c547bf78d3ef855fe473a7fb46f (patch) | |
tree | 014eb6e2239a6106619c7dc899632acc93e7cf15 /libhb/common.c | |
parent | 10c233da4008525393ed7552a49de1008f64b7b3 (diff) |
Don't crash while scanning when we can't get previews for some title.
- if we get no previews for some title, ignore the title
- use the most common aspect ratio found from our 10 previews rather than just the aspect of preview 2 (otherwise we'll crash in hb_fix_aspect if we don't get preview 2).
- check parameters in hb_fix_aspect so we don't divide by zero.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1322 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.c')
-rw-r--r-- | libhb/common.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libhb/common.c b/libhb/common.c index 5f6341790..d802f41a5 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -111,6 +111,15 @@ void hb_fix_aspect( hb_job_t * job, int keep ) hb_title_t * title = job->title; int i; + /* don't do anything unless the title has complete size info */ + if ( title->height == 0 || title->width == 0 || title->aspect == 0 ) + { + hb_log( "hb_fix_aspect: incomplete info for title %d: " + "height = %d, width = %d, aspect = %d", + title->height, title->width, title->aspect ); + return; + } + /* Sanity checks: Widths and heights must be multiples of 16 and greater than or equal to 16 |