Browse Source

avcodec/targa_y216dec: Fix width type

Fixes out of array access
Fixes: 1376/clusterfuzz-testcase-minimized-6361794975105024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3e56db8926)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3.1
Michael Niedermayer 8 years ago
parent
commit
eec20b665a
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavcodec/targa_y216dec.c

+ 2
- 1
libavcodec/targa_y216dec.c View File

@@ -35,7 +35,8 @@ static int y216_decode_frame(AVCodecContext *avctx, void *data,
{ {
AVFrame *pic = data; AVFrame *pic = data;
const uint16_t *src = (uint16_t *)avpkt->data; const uint16_t *src = (uint16_t *)avpkt->data;
uint16_t *y, *u, *v, aligned_width = FFALIGN(avctx->width, 4);
uint16_t *y, *u, *v;
int aligned_width = FFALIGN(avctx->width, 4);
int i, j, ret; int i, j, ret;


if (avpkt->size < 4 * avctx->height * aligned_width) { if (avpkt->size < 4 * avctx->height * aligned_width) {


Loading…
Cancel
Save