avformat/wavenc: simplify malloc failure checking

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/76/merge
Michael Niedermayer 11 years ago
parent 3bd0221bc1
commit 501158c682
  1. 7
      libavformat/wavenc.c

@ -174,14 +174,9 @@ static av_cold int peak_init_writer(AVFormatContext *s)
}
wav->peak_maxpos = av_mallocz(enc->channels * sizeof(*wav->peak_maxpos));
if (!wav->peak_maxpos)
goto nomem;
wav->peak_maxneg = av_mallocz(enc->channels * sizeof(*wav->peak_maxneg));
if (!wav->peak_maxneg)
goto nomem;
wav->peak_output = av_malloc(PEAK_BUFFER_SIZE);
if (!wav->peak_output)
if (!wav->peak_maxpos || !wav->peak_maxneg || !wav->peak_output)
goto nomem;
wav->peak_outbuf_size = PEAK_BUFFER_SIZE;

Loading…
Cancel
Save