Browse Source

truemotion1: Check input buffer size against header size.

Fixes overread.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.11
Michael Niedermayer 13 years ago
parent
commit
e7b43e8e84
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/truemotion1.c

+ 1
- 1
libavcodec/truemotion1.c View File

@@ -314,7 +314,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
const uint8_t *sel_vector_table;

header.header_size = ((s->buf[0] >> 5) | (s->buf[0] << 3)) & 0x7f;
if (s->buf[0] < 0x10)
if (s->buf[0] < 0x10 || header.header_size >= s->size)
{
av_log(s->avctx, AV_LOG_ERROR, "invalid header size (%d)\n", s->buf[0]);
return -1;


Loading…
Cancel
Save