Skip to content

Commit

Permalink
Fix 7e6cab1: out of bounds itheta on bit error
Browse files Browse the repository at this point in the history
  • Loading branch information
jmvalin committed Jan 22, 2025
1 parent 42c59f2 commit fef5dd1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions celt/bands.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,8 @@ static void compute_theta(struct band_ctx *ctx, struct split_ctx *sctx,
}
itheta_q30 -= (1<<(extra_bits-1))-1;
itheta_q30 = (itheta<<16) + itheta_q30*(opus_int64)(1<<30)/(qn*((1<<extra_bits)-1));
/* Hard bounds on itheta (can only trigger on corrupted bitstreams). */
itheta_q30 = IMAX(0, IMIN(itheta_q30, 1073741824));
*ext_b -= ec_tell_frac(ctx->ext_ec) - ext_tell;
} else {
itheta_q30 = (opus_int32)itheta<<16;
Expand Down

0 comments on commit fef5dd1

Please sign in to comment.