mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
avutil/tests/base64: Check with too short output array
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c304784a86
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
ef80220f32
commit
a0af91c348
@ -64,6 +64,16 @@ static int test_encode_decode(const uint8_t *data, unsigned int data_size,
|
||||
printf("Failed: decode to NULL buffer\n");
|
||||
return 1;
|
||||
}
|
||||
if (data_size > 0 && (data2_size = av_base64_decode(data2, encoded, data_size - 1)) != data_size - 1) {
|
||||
printf("Failed: out of array write\n"
|
||||
"Encoded:\n%s\n", encoded);
|
||||
return 1;
|
||||
}
|
||||
if (data_size > 1 && (data2_size = av_base64_decode(data2, encoded, data_size - 2)) != data_size - 2) {
|
||||
printf("Failed: out of array write\n"
|
||||
"Encoded:\n%s\n", encoded);
|
||||
return 1;
|
||||
}
|
||||
if (strlen(encoded)) {
|
||||
char *end = strchr(encoded, '=');
|
||||
if (!end)
|
||||
|
Loading…
Reference in New Issue
Block a user