Commit a5d46235 authored by Laurent Aimar's avatar Laurent Aimar Committed by Michael Niedermayer

Check for out of bound reads in the Electronic Arts CMV decoder.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 113d7be6
...@@ -158,6 +158,9 @@ static int cmv_decode_frame(AVCodecContext *avctx, ...@@ -158,6 +158,9 @@ static int cmv_decode_frame(AVCodecContext *avctx,
CmvContext *s = avctx->priv_data; CmvContext *s = avctx->priv_data;
const uint8_t *buf_end = buf + buf_size; const uint8_t *buf_end = buf + buf_size;
if (buf_end - buf < EA_PREAMBLE_SIZE)
return AVERROR_INVALIDDATA;
if (AV_RL32(buf)==MVIh_TAG||AV_RB32(buf)==MVIh_TAG) { if (AV_RL32(buf)==MVIh_TAG||AV_RB32(buf)==MVIh_TAG) {
cmv_process_header(s, buf+EA_PREAMBLE_SIZE, buf_end); cmv_process_header(s, buf+EA_PREAMBLE_SIZE, buf_end);
return buf_size; return buf_size;
......
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