aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRam Mohan <ram.mohan@ittiam.com>2023-09-28 18:51:50 +0530
committerHarish Mahendrakar <harish.mahendrakar@ittiam.com>2023-09-28 07:24:09 -0700
commitfef966515c1e8a4f18a9fea436707699a6b50c55 (patch)
treebc862522fc1aebdca4dbb779c9ffac9e4d63c7a8
parentf1f3a33bc416e4aabf306db693d5d873b1c32d2f (diff)
downloadlibavc-fef966515c1e8a4f18a9fea436707699a6b50c55.tar.gz
avcenc: Fix Crash for 422 ILE inputs
The input buffers allocated for 422 formats is less by a chroma plane. This causing memory over writes and results in crash while freeing
-rw-r--r--examples/avcenc/input.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/avcenc/input.c b/examples/avcenc/input.c
index 77b1090..bf92d56 100644
--- a/examples/avcenc/input.c
+++ b/examples/avcenc/input.c
@@ -245,7 +245,7 @@ void allocate_input(app_ctxt_t *ps_app_ctxt)
/* Size of buffer */
luma_size = ps_app_ctxt->u4_wd * ps_app_ctxt->u4_ht;
chroma_size = luma_size >> 1;
- pic_size = luma_size + chroma_size;
+ pic_size = luma_size + chroma_size * 2;
num_mbs = ALIGN16(ps_app_ctxt->u4_max_wd) * ALIGN16(ps_app_ctxt->u4_max_ht);
num_mbs /= 256;