Browse Source

avcodec/tta: use av_malloc(z)_array()

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

+ 2
- 2
libavcodec/tta.c View File

@@ -104,12 +104,12 @@ static int allocate_buffers(AVCodecContext *avctx)
TTAContext *s = avctx->priv_data;

if (s->bps < 3) {
s->decode_buffer = av_mallocz(sizeof(int32_t)*s->frame_length*s->channels);
s->decode_buffer = av_mallocz_array(sizeof(int32_t)*s->frame_length, s->channels);
if (!s->decode_buffer)
return AVERROR(ENOMEM);
} else
s->decode_buffer = NULL;
s->ch_ctx = av_malloc(avctx->channels * sizeof(*s->ch_ctx));
s->ch_ctx = av_malloc_array(avctx->channels, sizeof(*s->ch_ctx));
if (!s->ch_ctx) {
av_freep(&s->decode_buffer);
return AVERROR(ENOMEM);


Loading…
Cancel
Save