aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-11 19:02:05 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-11 19:02:31 +0100
commit26452e24ed1a93047226aed7830111abd24cfee3 (patch)
tree69c2b6f737457f7c3af9718e3f132918ad3d38a0 /libavcodec
parentb7b7e2348c07498f373d3b14a13615de151b2e7e (diff)
downloadffmpeg-26452e24ed1a93047226aed7830111abd24cfee3.tar.gz
snow: fix edge emu switch
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/snow.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index a4fe8b603a..2f3ddbee18 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -343,8 +343,8 @@ void ff_snow_pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride,
sx += (mx>>4) - (HTAPS_MAX/2-1);
sy += (my>>4) - (HTAPS_MAX/2-1);
src += sx + sy*stride;
- if( (unsigned)sx >= w - b_w - (HTAPS_MAX-2)
- || (unsigned)sy >= h - b_h - (HTAPS_MAX-2)){
+ if( (unsigned)sx >= FFMAX(w - b_w - (HTAPS_MAX-2), 0)
+ || (unsigned)sy >= FFMAX(h - b_h - (HTAPS_MAX-2), 0)){
s->dsp.emulated_edge_mc(tmp + MB_SIZE, src, stride, b_w+HTAPS_MAX-1, b_h+HTAPS_MAX-1, sx, sy, w, h);
src= tmp + MB_SIZE;
}