Browse Source

indeo3: fix data size check

The data offsets are relative to the bistream header, which is 16 bytes
after the start of the data.
Fixes invalid reads with corrupted files.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
tags/n2.0
Anton Khirnov 12 years ago
parent
commit
34e6af9e20
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      libavcodec/indeo3.c

+ 1
- 2
libavcodec/indeo3.c View File

@@ -893,8 +893,7 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,

if (ctx->data_size == 16)
return 4;
if (ctx->data_size > buf_size)
ctx->data_size = buf_size;
ctx->data_size = FFMIN(ctx->data_size, buf_size - 16);

bytestream2_skip(&gb, 3); // skip reserved byte and checksum



Loading…
Cancel
Save