summaryrefslogtreecommitdiff
path: root/libavcodec/truemotion2.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-01 02:41:45 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-01 02:42:29 +0200
commit07f606b4f0149b6515248b9f7b879a59b2008d7e (patch)
treecfa26a6e4ec3d76bf92723e6941893b741f74f96 /libavcodec/truemotion2.c
parentf24b7d7616533cd00475d7bf93f3a33ff5ac40dc (diff)
parente1ea365f7e1477c78865b866a180712174536c20 (diff)
downloadffmpeg-07f606b4f0149b6515248b9f7b879a59b2008d7e.tar.gz
Merge commit 'e1ea365f7e1477c78865b866a180712174536c20'
* commit 'e1ea365f7e1477c78865b866a180712174536c20': truemotion2: Check memory allocation Conflicts: libavcodec/truemotion2.c See: d49f2603bedb780a6cedff4ac790605679cf4029 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/truemotion2.c')
-rw-r--r--libavcodec/truemotion2.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index d2aa3c6f45..f70c79c38f 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -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);