changeset 292:73a9ce3d9715 libavcodec

fcode_tables where too small, found by Klaas-Pieter Vlieg <vlieg@eurescom.de>
author michaelni
date Sun, 24 Mar 2002 23:45:13 +0000
parents ab46ebfd419f
children 6eaf5da091fa
files h263.c mpeg12.c mpegvideo.c
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/h263.c	Sun Mar 24 22:02:21 2002 +0000
+++ b/h263.c	Sun Mar 24 23:45:13 2002 +0000
@@ -53,7 +53,7 @@
 
 extern UINT32 inverse[256];
 
-static UINT16 mv_penalty[MAX_FCODE][MAX_MV*2+1];
+static UINT16 mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
 static UINT8 fcode_tab[MAX_MV*2+1];
 static UINT8 umv_fcode_tab[MAX_MV*2+1];
 
--- a/mpeg12.c	Sun Mar 24 22:02:21 2002 +0000
+++ b/mpeg12.c	Sun Mar 24 23:45:13 2002 +0000
@@ -51,7 +51,7 @@
                                     int n);
 static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred);
 
-static UINT16 mv_penalty[MAX_FCODE][MAX_MV*2+1];
+static UINT16 mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
 static UINT8 fcode_tab[MAX_MV*2+1];
 
 static void put_header(MpegEncContext *s, int header)
--- a/mpegvideo.c	Sun Mar 24 22:02:21 2002 +0000
+++ b/mpegvideo.c	Sun Mar 24 23:45:13 2002 +0000
@@ -67,7 +67,7 @@
     0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
 };
 
-static UINT16 default_mv_penalty[MAX_FCODE][MAX_MV*2+1];
+static UINT16 default_mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
 static UINT8 default_fcode_tab[MAX_MV*2+1];
 
 /* default motion estimation */
@@ -366,7 +366,7 @@
         if(!done){
             int i;
             done=1;
-            memset(default_mv_penalty, 0, sizeof(UINT16)*MAX_FCODE*(2*MAX_MV+1));
+            memset(default_mv_penalty, 0, sizeof(UINT16)*(MAX_FCODE+1)*(2*MAX_MV+1));
             memset(default_fcode_tab , 0, sizeof(UINT8)*(2*MAX_MV+1));
 
             for(i=-16; i<16; i++){