From 2c27ef868423e72548b948017ef4ff7ec6060b0d Mon Sep 17 00:00:00 2001 From: Rabindra Harlalka <13387-rabindra-harlalka@users.noreply.gitlab.freedesktop.org> Date: Mon, 17 Jul 2023 16:21:47 +0000 Subject: [PATCH] aesenc: Fix IV length addition to output buffer length Add length of IV to output buffer length only for the first buffer. Part-of: --- subprojects/gst-plugins-bad/ext/aes/gstaesenc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/ext/aes/gstaesenc.c b/subprojects/gst-plugins-bad/ext/aes/gstaesenc.c index 1119e2c..b02de57 100644 --- a/subprojects/gst-plugins-bad/ext/aes/gstaesenc.c +++ b/subprojects/gst-plugins-bad/ext/aes/gstaesenc.c @@ -498,7 +498,9 @@ gst_aes_enc_transform (GstBaseTransform * base, gst_buffer_unmap (inbuf, &inmap); gst_buffer_unmap (outbuf, &outmap); - out_len = ciphertext_len + (filter->serialize_iv ? GST_AES_BLOCK_SIZE : 0); + out_len = ciphertext_len + ((filter->serialize_iv + && filter->awaiting_first_buffer) + ? GST_AES_BLOCK_SIZE : 0); gst_buffer_set_size (outbuf, out_len); GST_LOG_OBJECT (filter, "plaintext len: %d, ciphertext len: %d, padding: %d, output buffer length: %d", -- 2.7.4