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 c79d2a20ba
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:

committed by
Michael Niedermayer

parent
9b6080f685
commit
73f85eae68
@@ -194,6 +194,7 @@ static void decode_parameters(SiprParameters* parms, GetBitContext *pgb,
|
|||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
if (p->ma_predictor_bits)
|
||||||
parms->ma_pred_switch = get_bits(pgb, p->ma_predictor_bits);
|
parms->ma_pred_switch = get_bits(pgb, p->ma_predictor_bits);
|
||||||
|
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < 5; i++)
|
||||||
@@ -201,6 +202,7 @@ static void decode_parameters(SiprParameters* parms, GetBitContext *pgb,
|
|||||||
|
|
||||||
for (i = 0; i < p->subframe_count; i++) {
|
for (i = 0; i < p->subframe_count; i++) {
|
||||||
parms->pitch_delay[i] = get_bits(pgb, p->pitch_delay_bits[i]);
|
parms->pitch_delay[i] = get_bits(pgb, p->pitch_delay_bits[i]);
|
||||||
|
if (p->gp_index_bits)
|
||||||
parms->gp_index[i] = get_bits(pgb, 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++)
|
for (j = 0; j < p->number_of_fc_indexes; j++)
|
||||||
|
Reference in New Issue
Block a user