diff options
author | Mans Rullgard <mans@mansr.com> | 2011-10-10 20:41:31 +0100 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2012-03-18 17:50:41 +0100 |
commit | 3b7a1ba90ec94fe052b6ea085ae6f3f3bfd9ba27 (patch) | |
tree | d27c30b8041c9bfd367ee6a75662e10c86f75155 | |
parent | da73a2005aa4fbea03226eadbb4a1afd1d860cca (diff) | |
download | ffmpeg-3b7a1ba90ec94fe052b6ea085ae6f3f3bfd9ba27.tar.gz |
sipr: fix get_bits(0) calls
Zero-length get_bits() is undefined, must check before calling.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit c79d2a20bad59298188171f1316a830d563a41ee)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | libavcodec/sipr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c index fa57b43eb1..ccd0eeb1fb 100644 --- a/libavcodec/sipr.c +++ b/libavcodec/sipr.c @@ -194,14 +194,16 @@ static void decode_parameters(SiprParameters* parms, GetBitContext *pgb, { int i, j; - parms->ma_pred_switch = get_bits(pgb, p->ma_predictor_bits); + if (p->ma_predictor_bits) + parms->ma_pred_switch = get_bits(pgb, p->ma_predictor_bits); for (i = 0; i < 5; i++) parms->vq_indexes[i] = get_bits(pgb, p->vq_indexes_bits[i]); for (i = 0; i < p->subframe_count; i++) { parms->pitch_delay[i] = get_bits(pgb, p->pitch_delay_bits[i]); - parms->gp_index[i] = get_bits(pgb, p->gp_index_bits); + if (p->gp_index_bits) + parms->gp_index[i] = get_bits(pgb, p->gp_index_bits); for (j = 0; j < p->number_of_fc_indexes; j++) parms->fc_indexes[i][j] = get_bits(pgb, p->fc_index_bits[j]); |