Browse Source

avcodec/ffv1dec: use av_malloc_array()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.3
Michael Niedermayer 11 years ago
parent
commit
cc86158173
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/ffv1dec.c

+ 2
- 2
libavcodec/ffv1dec.c View File

@@ -380,10 +380,10 @@ static int decode_slice(AVCodecContext *c, void *arg)
pdst->vlc_state = NULL; pdst->vlc_state = NULL;


if (fssrc->ac) { if (fssrc->ac) {
pdst->state = av_malloc(CONTEXT_SIZE * psrc->context_count);
pdst->state = av_malloc_array(CONTEXT_SIZE, psrc->context_count);
memcpy(pdst->state, psrc->state, CONTEXT_SIZE * psrc->context_count); memcpy(pdst->state, psrc->state, CONTEXT_SIZE * psrc->context_count);
} else { } else {
pdst->vlc_state = av_malloc(sizeof(*pdst->vlc_state) * psrc->context_count);
pdst->vlc_state = av_malloc_array(sizeof(*pdst->vlc_state), psrc->context_count);
memcpy(pdst->vlc_state, psrc->vlc_state, sizeof(*pdst->vlc_state) * psrc->context_count); memcpy(pdst->vlc_state, psrc->vlc_state, sizeof(*pdst->vlc_state) * psrc->context_count);
} }
} }


Loading…
Cancel
Save