summaryrefslogtreecommitdiff
path: root/libavformat/omadec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-02-28 18:41:44 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-02-28 18:41:44 +0100
commit4f5d1468f55eb87bce84845c4e62242c791268f5 (patch)
tree1c70427e0168ff034fefaea701ed439ebe97fa78 /libavformat/omadec.c
parentddd86a2924b9bc67c406cd66ebb1fc8915cd60f7 (diff)
omadec: Fix wrong number of array elements.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/omadec.c')
-rw-r--r--libavformat/omadec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index adf08a621c..97aaf175ab 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -234,7 +234,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
rprobe(s, gdata, oc->r_val) < 0 &&
nprobe(s, gdata, geob->datasize, oc->n_val) < 0) {
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];
AV_WL64(buf, leaf_table[i]);
AV_WL64(&buf[8], leaf_table[i+1]);
@@ -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))
break;
}
- if (i >= sizeof(leaf_table)) {
+ if (i >= FF_ARRAY_ELEMS(leaf_table)) {
av_log(s, AV_LOG_ERROR, "Invalid key\n");
return -1;
}