diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index e5a20903b0d13a63b40c789f7f34ee01094a7e1b..98ccbdef9f3c770143878609074adf11f8accbc4 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -263,7 +263,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
                 !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 AVERROR_INVALIDDATA;
         }