When either video dimension is only one macroblock, subtractions
based on v_edge_pos and the macroblock size may be negative. In
that situation, an unsigned comparison isn't sufficent to test for
MV overruns, because a limit of (unsigned)-1 will let any other
value pass.
---
libavcodec/snow.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 447289a..ed521a9 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -337,8 +337,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;
}
--
1.7.5.4
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel