Browse Source

cdgraphics: Fix out of array write

Fixes Ticket1359

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1e5c7376c4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.10.4
Michael Niedermayer 13 years ago
parent
commit
a4b329d622
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/cdgraphics.c

+ 4
- 0
libavcodec/cdgraphics.c View File

@@ -280,6 +280,10 @@ static int cdg_decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "buffer too small for decoder\n");
return AVERROR(EINVAL);
}
if (buf_size > CDG_HEADER_SIZE + CDG_DATA_SIZE) {
av_log(avctx, AV_LOG_ERROR, "buffer too big for decoder\n");
return AVERROR(EINVAL);
}

ret = avctx->reget_buffer(avctx, &cc->frame);
if (ret) {


Loading…
Cancel
Save