changeset 422:92161c93529d libavutil

Fix access to the last element of the table. (size of the table vs. number of elements in the table)
author aurel
date Mon, 07 Jan 2008 13:19:38 +0000
parents fc19d0d355ad
children cf0184d7d6d7
files crc.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/crc.c	Fri Jan 04 23:47:10 2008 +0000
+++ b/crc.c	Mon Jan 07 13:19:38 2008 +0000
@@ -91,7 +91,7 @@
  */
 const AVCRC *av_crc_get_table(AVCRCId crc_id){
 #ifndef CONFIG_HARDCODED_TABLES
-    if (!av_crc_table[crc_id][sizeof(av_crc_table[crc_id])-1])
+    if (!av_crc_table[crc_id][sizeof(av_crc_table[crc_id])/sizeof(av_crc_table[crc_id][0])-1])
         if (av_crc_init(av_crc_table[crc_id],
                         av_crc_table_params[crc_id].le,
                         av_crc_table_params[crc_id].bits,