mirror of https://git.ffmpeg.org/ffmpeg.git
Merge commit 'e1ea365f7e1477c78865b866a180712174536c20'
* commit 'e1ea365f7e1477c78865b866a180712174536c20':
truemotion2: Check memory allocation
Conflicts:
libavcodec/truemotion2.c
See: d49f2603be
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
07f606b4f0
|
@ -177,7 +177,7 @@ static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code)
|
|||
|
||||
if (!huff.nums || !huff.bits || !huff.lens) {
|
||||
res = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
goto out;
|
||||
}
|
||||
|
||||
res = tm2_read_tree(ctx, 0, 0, &huff);
|
||||
|
@ -203,13 +203,14 @@ static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code)
|
|||
code->recode = av_malloc_array(code->length, sizeof(int));
|
||||
if (!code->recode) {
|
||||
res = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
goto out;
|
||||
}
|
||||
for (i = 0; i < code->length; i++)
|
||||
code->recode[i] = huff.nums[i];
|
||||
}
|
||||
}
|
||||
fail:
|
||||
|
||||
out:
|
||||
/* free allocated memory */
|
||||
av_free(huff.nums);
|
||||
av_free(huff.bits);
|
||||
|
|
Loading…
Reference in New Issue