From 501158c682ceb7546d71209374dac406a7f43238 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 24 Jun 2014 13:51:40 +0200 Subject: [PATCH] avformat/wavenc: simplify malloc failure checking Signed-off-by: Michael Niedermayer --- libavformat/wavenc.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c index 57d626fa2f..123dd459ae 100644 --- a/libavformat/wavenc.c +++ b/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;