avcodec/g722enc: Use av_mallocz_array()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-01-15 23:02:43 +01:00
parent 71bd6ea0fa
commit 5989a2b24f
1 changed files with 3 additions and 3 deletions

View File

@ -75,9 +75,9 @@ static av_cold int g722_encode_init(AVCodecContext * avctx)
int max_paths = frontier * FREEZE_INTERVAL; int max_paths = frontier * FREEZE_INTERVAL;
int i; int i;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
c->paths[i] = av_mallocz(max_paths * sizeof(**c->paths)); c->paths[i] = av_mallocz_array(max_paths, sizeof(**c->paths));
c->node_buf[i] = av_mallocz(2 * frontier * sizeof(**c->node_buf)); c->node_buf[i] = av_mallocz_array(frontier, 2 * sizeof(**c->node_buf));
c->nodep_buf[i] = av_mallocz(2 * frontier * sizeof(**c->nodep_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]) { if (!c->paths[i] || !c->node_buf[i] || !c->nodep_buf[i]) {
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto error; goto error;