aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-04-15 19:56:42 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-05-01 13:32:03 -0400
commit4142487d1cd8c555e13f156d1cc89f838099db10 (patch)
treefd0dbc90af7bf5a17db1c17e4e04eb85e19e7284
parent987fe2dc55c2de4dd798cbd0ebcdae6a066faff7 (diff)
downloadffmpeg-4142487d1cd8c555e13f156d1cc89f838099db10.tar.gz
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.
-rw-r--r--libavcodec/ac3enc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 00cb047374..47fd9b6a34 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -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;