aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/svq1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-07-28 10:13:45 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-07-28 10:13:45 +0000
commit7a04636485ad4ca0222a418dd2951a1ba8aa2ce4 (patch)
tree15ebb214a55739a5451e8c1a66532307a9e4abce /libavcodec/svq1.c
parent15c8dbe7784ad57467f3465a3d5330b5560c8579 (diff)
downloadffmpeg-7a04636485ad4ca0222a418dd2951a1ba8aa2ce4.tar.gz
svq1 mv array size fix
Originally committed as revision 3361 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/svq1.c')
-rw-r--r--libavcodec/svq1.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/svq1.c b/libavcodec/svq1.c
index 1efeb57a46..ae79afef90 100644
--- a/libavcodec/svq1.c
+++ b/libavcodec/svq1.c
@@ -1108,10 +1108,10 @@ static void svq1_encode_plane(SVQ1Context *s, int plane, unsigned char *src_plan
s->m.me_method= s->avctx->me_method;
if(!s->motion_val8[plane]){
- s->motion_val8 [plane]= av_mallocz(s->m.b8_stride*block_height*2*2*sizeof(int16_t));
- s->motion_val16[plane]= av_mallocz(s->m.mb_stride*block_height*2*sizeof(int16_t));
+ s->motion_val8 [plane]= av_mallocz((s->m.b8_stride*block_height*2 + 2)*2*sizeof(int16_t));
+ s->motion_val16[plane]= av_mallocz((s->m.mb_stride*(block_height + 2) + 1)*2*sizeof(int16_t));
}
-
+
s->m.mb_type= s->mb_type;
//dummies, to avoid segfaults
@@ -1120,8 +1120,8 @@ static void svq1_encode_plane(SVQ1Context *s, int plane, unsigned char *src_plan
s->m.current_picture.mc_mb_var= (uint16_t*)s->dummy;
s->m.current_picture.mb_type= s->dummy;
- s->m.current_picture.motion_val[0]= s->motion_val8[plane];
- s->m.p_mv_table= s->motion_val16[plane];
+ s->m.current_picture.motion_val[0]= s->motion_val8[plane] + 2;
+ s->m.p_mv_table= s->motion_val16[plane] + s->m.mb_stride + 1;
s->m.dsp= s->dsp; //move
ff_init_me(&s->m);