Commit e0f5f926 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/avienc: assert that bits_per_coded_sample is within the supported...

avformat/avienc: assert that bits_per_coded_sample is within the supported range (out of array access otherwise)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 76019f5f
......@@ -699,6 +699,9 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
if (ret2) {
int pal_size = 1 << enc->bits_per_coded_sample;
int pc_tag, i;
av_assert0(enc->bits_per_coded_sample >= 0 && enc->bits_per_coded_sample <= 8);
if (pb->seekable && avist->pal_offset) {
int64_t cur_offset = avio_tell(pb);
avio_seek(pb, avist->pal_offset, SEEK_SET);
......
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