Commit 501158c6 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/wavenc: simplify malloc failure checking

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 3bd0221b
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment