mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 19:59:46 +00:00
avformat/wavenc: simplify malloc failure checking
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
3bd0221bc1
commit
501158c682
@ -174,14 +174,9 @@ static av_cold int peak_init_writer(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wav->peak_maxpos = av_mallocz(enc->channels * sizeof(*wav->peak_maxpos));
|
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));
|
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);
|
wav->peak_output = av_malloc(PEAK_BUFFER_SIZE);
|
||||||
if (!wav->peak_output)
|
if (!wav->peak_maxpos || !wav->peak_maxneg || !wav->peak_output)
|
||||||
goto nomem;
|
goto nomem;
|
||||||
|
|
||||||
wav->peak_outbuf_size = PEAK_BUFFER_SIZE;
|
wav->peak_outbuf_size = PEAK_BUFFER_SIZE;
|
||||||
|
Loading…
Reference in New Issue
Block a user