Browse Source

avcodec/eatgv: use av_mallocz() for frame_buffer

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fbf6159587b_2571_ORIGIN.TGV
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.2-rc1
Michael Niedermayer 12 years ago
parent
commit
bb9f55163f
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/eatgv.c

+ 1
- 1
libavcodec/eatgv.c View File

@@ -311,7 +311,7 @@ static int tgv_decode_frame(AVCodecContext *avctx,
frame->pict_type = AV_PICTURE_TYPE_I;

if (!s->frame_buffer &&
!(s->frame_buffer = av_malloc(s->width * s->height)))
!(s->frame_buffer = av_mallocz(s->width * s->height)))
return AVERROR(ENOMEM);

if (unpack(buf, buf_end, s->frame_buffer, s->avctx->width, s->avctx->height) < 0) {


Loading…
Cancel
Save