summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-04-28 20:33:22 +0000
committerRodeo <[email protected]>2013-04-28 20:33:22 +0000
commit61738cdb9c81d49a93c910a2ae22179bb69a0a52 (patch)
tree7214eefe5605754cc1e11573501e59be47958a53 /libhb
parent9f61b0eadf211bcc1506f3abc030e9beb26495ab (diff)
hb_get_best_mixdown: fix out-of-array reads.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5420 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libhb/common.c b/libhb/common.c
index d27dc3d14..f9ba7a761 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -994,12 +994,12 @@ int hb_get_best_mixdown(uint32_t codec, uint64_t layout, int mixdown)
// caller requested the best available mixdown
if (mixdown == HB_INVALID_AMIXDOWN)
- mixdown = hb_audio_mixdowns[hb_audio_mixdowns_count].amixdown;
+ mixdown = hb_audio_mixdowns[hb_audio_mixdowns_count - 1].amixdown;
int ii;
// test all mixdowns until an authorized, supported mixdown is found
// stop before we reach the "worst" non-None mixdown (index == 1)
- for (ii = hb_audio_mixdowns_count; ii > 1; ii--)
+ for (ii = hb_audio_mixdowns_count - 1; ii > 1; ii--)
if (hb_audio_mixdowns[ii].amixdown <= mixdown &&
hb_mixdown_is_supported(hb_audio_mixdowns[ii].amixdown, codec, layout))
break;