Commit a9821bda authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  4xm: check bitstream_size boundary before using it

Conflicts:
	libavcodec/4xm.c

See: 9c661e95Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents e9f2e971 59d7bb99
...@@ -766,7 +766,10 @@ static int decode_i_frame(FourXContext *f, AVFrame *frame, const uint8_t *buf, i ...@@ -766,7 +766,10 @@ static int decode_i_frame(FourXContext *f, AVFrame *frame, const uint8_t *buf, i
unsigned int prestream_size; unsigned int prestream_size;
const uint8_t *prestream; const uint8_t *prestream;
if (bitstream_size > (1<<26) || length < bitstream_size + 12) { if (bitstream_size > (1 << 26))
return AVERROR_INVALIDDATA;
if (length < bitstream_size + 12) {
av_log(f->avctx, AV_LOG_ERROR, "packet size too small\n"); av_log(f->avctx, AV_LOG_ERROR, "packet size too small\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
...@@ -775,7 +778,6 @@ static int decode_i_frame(FourXContext *f, AVFrame *frame, const uint8_t *buf, i ...@@ -775,7 +778,6 @@ static int decode_i_frame(FourXContext *f, AVFrame *frame, const uint8_t *buf, i
prestream = buf + bitstream_size + 12; prestream = buf + bitstream_size + 12;
if (prestream_size + bitstream_size + 12 != length if (prestream_size + bitstream_size + 12 != length
|| bitstream_size > (1 << 26)
|| prestream_size > (1 << 26)) { || prestream_size > (1 << 26)) {
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d %d\n", av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d %d\n",
prestream_size, bitstream_size, length); prestream_size, bitstream_size, length);
......
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