]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Correct x/ymin to avoid segfault due to out of picture reads.
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 8 May 2009 15:14:36 +0000 (15:14 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 8 May 2009 15:14:36 +0000 (15:14 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18771 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/snow.c
tests/ffmpeg.regression.ref

index 995c1a202443533cf28569c032ca86e7c8fd02a0..5a1a6683b49705c3f5f8cd8de5a6aabf1adc62df 100644 (file)
@@ -1807,10 +1807,10 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){
     c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp);
     c->current_mv_penalty= c->mv_penalty[s->m.f_code=1] + MAX_MV;
 
-    c->xmin = - x*block_w - 16+2;
-    c->ymin = - y*block_w - 16+2;
-    c->xmax = - (x+1)*block_w + (w<<(LOG2_MB_SIZE - s->block_max_depth)) + 16-2;
-    c->ymax = - (y+1)*block_w + (h<<(LOG2_MB_SIZE - s->block_max_depth)) + 16-2;
+    c->xmin = - x*block_w - 16+3;
+    c->ymin = - y*block_w - 16+3;
+    c->xmax = - (x+1)*block_w + (w<<(LOG2_MB_SIZE - s->block_max_depth)) + 16-3;
+    c->ymax = - (y+1)*block_w + (h<<(LOG2_MB_SIZE - s->block_max_depth)) + 16-3;
 
     if(P_LEFT[0]     > (c->xmax<<shift)) P_LEFT[0]    = (c->xmax<<shift);
     if(P_LEFT[1]     > (c->ymax<<shift)) P_LEFT[1]    = (c->ymax<<shift);
index 2a3f082d305038a7f43482b7d0f2d354ba14a602..313f87f5fbf772981c967224984706ef4b51ded8 100644 (file)
@@ -146,8 +146,8 @@ stddev:    0.00 PSNR:999.99 bytes:  7603200/  7603200
 137018 ./tests/data/a-snow.avi
 3a00e0016a28f4b759c2e9df8cd3db02 *./tests/data/snow.vsynth.out.yuv
 stddev:   22.73 PSNR: 20.99 bytes:  7603200/  7603200
-c7397d2ceb420f7564dcc785948bff84 *./tests/data/a-snow53.avi
-3520692 ./tests/data/a-snow53.avi
+48fdd2eb0b44c867c1652c13bde246da *./tests/data/a-snow53.avi
+3520700 ./tests/data/a-snow53.avi
 799d3db687f6cdd7a837ec156efc171f *./tests/data/snowll.vsynth.out.yuv
 stddev:    0.00 PSNR:999.99 bytes:  7603200/  7603200
 9bfab037b2779eef4b95773788bbe369 *./tests/data/a-dv.dv