Commit 4f5d1468 authored by Michael Niedermayer's avatar Michael Niedermayer

omadec: Fix wrong number of array elements.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ddd86a29
...@@ -234,7 +234,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header) ...@@ -234,7 +234,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
rprobe(s, gdata, oc->r_val) < 0 && rprobe(s, gdata, oc->r_val) < 0 &&
nprobe(s, gdata, geob->datasize, oc->n_val) < 0) { nprobe(s, gdata, geob->datasize, oc->n_val) < 0) {
int i; int i;
for (i = 0; i < sizeof(leaf_table); i += 2) { for (i = 0; i < FF_ARRAY_ELEMS(leaf_table); i += 2) {
uint8_t buf[16]; uint8_t buf[16];
AV_WL64(buf, leaf_table[i]); AV_WL64(buf, leaf_table[i]);
AV_WL64(&buf[8], leaf_table[i+1]); AV_WL64(&buf[8], leaf_table[i+1]);
...@@ -242,7 +242,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header) ...@@ -242,7 +242,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
if (!rprobe(s, gdata, oc->r_val) || !nprobe(s, gdata, geob->datasize, oc->n_val)) if (!rprobe(s, gdata, oc->r_val) || !nprobe(s, gdata, geob->datasize, oc->n_val))
break; break;
} }
if (i >= sizeof(leaf_table)) { if (i >= FF_ARRAY_ELEMS(leaf_table)) {
av_log(s, AV_LOG_ERROR, "Invalid key\n"); av_log(s, AV_LOG_ERROR, "Invalid key\n");
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment