aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/snow.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-05-08 15:14:36 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-05-08 15:14:36 +0000
commit9a3eaeebad8bd0b62d76680d5895a4bdeb228ae4 (patch)
treed66b9b13c021c3977fc45de61d450ec1e4d55d09 /libavcodec/snow.c
parent5f9ae1983d901e703cd133435c6c87fdaae7b06f (diff)
downloadffmpeg-9a3eaeebad8bd0b62d76680d5895a4bdeb228ae4.tar.gz
Correct x/ymin to avoid segfault due to out of picture reads.
Originally committed as revision 18771 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/snow.c')
-rw-r--r--libavcodec/snow.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 995c1a2024..5a1a6683b4 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -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);