avidec: check for valid bit_rate range
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Mon, 4 May 2015 19:07:52 +0000 (21:07 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 4 May 2015 19:11:19 +0000 (21:11 +0200)
commit0eec40b713eee84e2aec8af35ccce059817cad2a
treed3e379b75ce420389be15f2e47bb7c21b2eb41c3
parent783e94cb119052722d38df0efa248fecc53508ab
avidec: check for valid bit_rate range

If bit_rate is negative, it can trigger an av_assert2 in av_rescale_rnd.

Since av_rescale returns int64_t, but st->codec_bit_rate is int, it can
also overflow into a negative value.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/avidec.c