Commit 4142487d authored by Justin Ruggles's avatar Justin Ruggles

ac3enc: return error if frame+exponent bits are too large instead of using

av_assert2().

This can occur in some very rare cases with low bitrates.
parent 987fe2dc
......@@ -1052,7 +1052,8 @@ static int cbr_bit_allocation(AC3EncodeContext *s)
int snr_offset, snr_incr;
bits_left = 8 * s->frame_size - (s->frame_bits + s->exponent_bits);
av_assert2(bits_left >= 0);
if (bits_left < 0)
return AVERROR(EINVAL);
snr_offset = s->coarse_snr_offset << 4;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment