aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-01-12 21:37:57 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-01-12 21:37:57 +0000
commitc8a596d21045851ddbdc29d0d27397ab0a19674c (patch)
tree2dbf2e995d54633dab8bf9bcf29a2c7ebc30e02e /libavcodec
parent517840c65434b42fb8784ad1ce4a0301d5d6c36d (diff)
downloadffmpeg-c8a596d21045851ddbdc29d0d27397ab0a19674c.tar.gz
bugs found by valgrind
Originally committed as revision 4841 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/snow.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index c73477a1d1..4b032a9741 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -3116,13 +3116,14 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, con
BlockNode *top = y ? &s->block[index-b_stride] : &null_block;
BlockNode *tl = y && x ? &s->block[index-b_stride-1] : left;
BlockNode *tr = y && x+1<b_stride ? &s->block[index-b_stride+1] : tl;
- int dmx= b->mx - mid_pred(left->mx, top->mx, tr->mx);
- int dmy= b->my - mid_pred(left->my, top->my, tr->my);
+ int dmx, dmy;
// int mx_context= av_log2(2*ABS(left->mx - top->mx));
// int my_context= av_log2(2*ABS(left->my - top->my));
if(x<0 || x>=b_stride || y>=b_height)
continue;
+ dmx= b->mx - mid_pred(left->mx, top->mx, tr->mx);
+ dmy= b->my - mid_pred(left->my, top->my, tr->my);
/*
1 0 0
01X 1-2 1
@@ -3206,14 +3207,14 @@ static void iterative_me(SnowContext *s){
BlockNode backup;
const int index= mb_x + mb_y * b_stride;
BlockNode *block= &s->block[index];
- BlockNode *tb = mb_y ? &s->block[index-b_stride ] : &null_block;
- BlockNode *lb = mb_x ? &s->block[index -1] : &null_block;
- BlockNode *rb = mb_x<b_width ? &s->block[index +1] : &null_block;
- BlockNode *bb = mb_y<b_height ? &s->block[index+b_stride ] : &null_block;
- BlockNode *tlb= mb_x && mb_y ? &s->block[index-b_stride-1] : &null_block;
- BlockNode *trb= mb_x<b_width && mb_y ? &s->block[index-b_stride+1] : &null_block;
- BlockNode *blb= mb_x && mb_y<b_height ? &s->block[index+b_stride-1] : &null_block;
- BlockNode *brb= mb_x<b_width && mb_y<b_height ? &s->block[index+b_stride+1] : &null_block;
+ BlockNode *tb = mb_y ? &s->block[index-b_stride ] : &null_block;
+ BlockNode *lb = mb_x ? &s->block[index -1] : &null_block;
+ BlockNode *rb = mb_x+1<b_width ? &s->block[index +1] : &null_block;
+ BlockNode *bb = mb_y+1<b_height ? &s->block[index+b_stride ] : &null_block;
+ BlockNode *tlb= mb_x && mb_y ? &s->block[index-b_stride-1] : &null_block;
+ BlockNode *trb= mb_x+1<b_width && mb_y ? &s->block[index-b_stride+1] : &null_block;
+ BlockNode *blb= mb_x && mb_y+1<b_height ? &s->block[index+b_stride-1] : &null_block;
+ BlockNode *brb= mb_x+1<b_width && mb_y+1<b_height ? &s->block[index+b_stride+1] : &null_block;
const int b_w= (MB_SIZE >> s->block_max_depth);
uint8_t obmc_edged[b_w*2][b_w*2];