changeset 9617:f4a60e47193f libavcodec

Correct x/ymin to avoid segfault due to out of picture reads.
author michael
date Fri, 08 May 2009 15:14:36 +0000
parents fe6e82906aa8
children 85ad5d68ec98
files snow.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/snow.c	Wed May 06 21:57:20 2009 +0000
+++ b/snow.c	Fri May 08 15:14:36 2009 +0000
@@ -1807,10 +1807,10 @@
     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);