Browse Source

TT#108003 Handle unsigned wrap around in amr_encoder_mode_change()

We only do 1 decrements/increments so the check for the upper-bound will
always catch any downward wrap-around or an upward out-of-bound.

Change-Id: Ibdb9a69e1a55f34ffca56721c310efc505b86f99
Warned-by: coverity
pull/1194/head
Guillem Jover 5 years ago
parent
commit
648e74fd39
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      lib/codeclib.c

+ 1
- 1
lib/codeclib.c View File

@ -2017,7 +2017,7 @@ static void amr_encoder_mode_change(encoder_t *enc) {
// step up or down towards the current bitrate
cmr += cmr_diff;
// still in bounds?
if (cmr < 0 || cmr >= AMR_FT_TYPES)
if (cmr >= AMR_FT_TYPES)
break;
cmr_br = enc->codec_options.amr.bitrates[cmr];
if (cmr_br == cur_br)


Loading…
Cancel
Save