提交 5989a2b2 编写于 作者: M Michael Niedermayer

avcodec/g722enc: Use av_mallocz_array()

Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 71bd6ea0
......@@ -75,9 +75,9 @@ static av_cold int g722_encode_init(AVCodecContext * avctx)
int max_paths = frontier * FREEZE_INTERVAL;
int i;
for (i = 0; i < 2; i++) {
c->paths[i] = av_mallocz(max_paths * sizeof(**c->paths));
c->node_buf[i] = av_mallocz(2 * frontier * sizeof(**c->node_buf));
c->nodep_buf[i] = av_mallocz(2 * frontier * sizeof(**c->nodep_buf));
c->paths[i] = av_mallocz_array(max_paths, sizeof(**c->paths));
c->node_buf[i] = av_mallocz_array(frontier, 2 * sizeof(**c->node_buf));
c->nodep_buf[i] = av_mallocz_array(frontier, 2 * sizeof(**c->nodep_buf));
if (!c->paths[i] || !c->node_buf[i] || !c->nodep_buf[i]) {
ret = AVERROR(ENOMEM);
goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册