summaryrefslogtreecommitdiff
path: root/0030-brotli-Fix-VLA-parameter-warning-893.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-10-30 11:56:48 +0000
committerCoprDistGit <infra@openeuler.org>2023-10-30 11:56:48 +0000
commit1dae37b163e1e08e719ac06fa86b3414b4ddfb2b (patch)
treed6c29b92e733448b00701f46c85d08ecc4a5fbbb /0030-brotli-Fix-VLA-parameter-warning-893.patch
parent8a55803b9ffda4b5bd4f5bbb9767a617620266ae (diff)
automatic import of edk2openeuler22.03_LTS
Diffstat (limited to '0030-brotli-Fix-VLA-parameter-warning-893.patch')
-rw-r--r--0030-brotli-Fix-VLA-parameter-warning-893.patch89
1 files changed, 89 insertions, 0 deletions
diff --git a/0030-brotli-Fix-VLA-parameter-warning-893.patch b/0030-brotli-Fix-VLA-parameter-warning-893.patch
new file mode 100644
index 0000000..9f6974e
--- /dev/null
+++ b/0030-brotli-Fix-VLA-parameter-warning-893.patch
@@ -0,0 +1,89 @@
+From 0a3944c8c99b8d10cc4325f721b7c273d2b41f7b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Adri=C3=A1n=20Herrera=20Arcila?= <adr.her.arc.95@gmail.com>
+Date: Wed, 23 Jun 2021 08:53:59 +0100
+Subject: [PATCH] Fix VLA parameter warning (#893)
+
+Make VLA buffer types consistent in declarations and definitions.
+Resolves build crash when using -Werror due to "vla-parameter" warning.
+
+Signed-off-by: Adrian Herrera <adr.her.arc.95@gmail.com>
+
+reference: https://github.com/google/brotli/pull/893
+Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
+---
+ BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c | 6 ++++--
+ BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c | 5 +++--
+ .../Library/BrotliCustomDecompressLib/brotli/c/dec/decode.c | 6 ++++--
+ .../Library/BrotliCustomDecompressLib/brotli/c/enc/encode.c | 5 +++--
+ 4 files changed, 14 insertions(+), 8 deletions(-)
+
+diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/decode.c b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/decode.c
+index ae5a3d3..7eee968 100644
+--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/decode.c
++++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/decode.c
+@@ -2030,8 +2030,10 @@ static BROTLI_NOINLINE BrotliDecoderErrorCode SafeProcessCommands(
+ }
+
+ BrotliDecoderResult BrotliDecoderDecompress(
+- size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size,
+- uint8_t* decoded_buffer) {
++ size_t encoded_size,
++ const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
++ size_t* decoded_size,
++ uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]) {
+ BrotliDecoderState s;
+ BrotliDecoderResult result;
+ size_t total_out = 0;
+diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/enc/encode.c b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/enc/encode.c
+index 8d90937..0c49c64 100644
+--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/enc/encode.c
++++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/enc/encode.c
+@@ -1470,8 +1470,9 @@ static size_t MakeUncompressedStream(
+
+ BROTLI_BOOL BrotliEncoderCompress(
+ int quality, int lgwin, BrotliEncoderMode mode, size_t input_size,
+- const uint8_t* input_buffer, size_t* encoded_size,
+- uint8_t* encoded_buffer) {
++ const uint8_t input_buffer[BROTLI_ARRAY_PARAM(input_size)],
++ size_t* encoded_size,
++ uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(*encoded_size)]) {
+ BrotliEncoderState* s;
+ size_t out_size = *encoded_size;
+ const uint8_t* input_start = input_buffer;
+
+diff --git a/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c b/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c
+index ae5a3d3..7eee968 100644
+--- a/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c
++++ b/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c
+@@ -2030,8 +2030,10 @@ static BROTLI_NOINLINE BrotliDecoderErrorCode SafeProcessCommands(
+ }
+
+ BrotliDecoderResult BrotliDecoderDecompress(
+- size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size,
+- uint8_t* decoded_buffer) {
++ size_t encoded_size,
++ const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
++ size_t* decoded_size,
++ uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]) {
+ BrotliDecoderState s;
+ BrotliDecoderResult result;
+ size_t total_out = 0;
+diff --git a/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c b/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c
+index 8d90937..0c49c64 100644
+--- a/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c
++++ b/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c
+@@ -1470,8 +1470,9 @@ static size_t MakeUncompressedStream(
+
+ BROTLI_BOOL BrotliEncoderCompress(
+ int quality, int lgwin, BrotliEncoderMode mode, size_t input_size,
+- const uint8_t* input_buffer, size_t* encoded_size,
+- uint8_t* encoded_buffer) {
++ const uint8_t input_buffer[BROTLI_ARRAY_PARAM(input_size)],
++ size_t* encoded_size,
++ uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(*encoded_size)]) {
+ BrotliEncoderState* s;
+ size_t out_size = *encoded_size;
+ const uint8_t* input_start = input_buffer;
+--
+2.41.0
+