changeset 9645:3a8dfce3dc17 libavcodec

Ensure that we don't read from invalid memory with B-frame qpel
author conrad
date Fri, 15 May 2009 07:49:59 +0000
parents 15660ad4c641
children b8b9ff6fa077
files vc1.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/vc1.c	Fri May 15 05:39:44 2009 +0000
+++ b/vc1.c	Fri May 15 07:49:59 2009 +0000
@@ -1818,8 +1818,8 @@
     }
 
     if(v->rangeredfrm
-       || (unsigned)src_x > s->h_edge_pos - (mx&3) - 16
-       || (unsigned)src_y > s->v_edge_pos - (my&3) - 16){
+       || (unsigned)src_x > s->h_edge_pos - (mx&3) - 16 - s->mspel*3
+       || (unsigned)src_y > s->v_edge_pos - (my&3) - 16 - s->mspel*3){
         uint8_t *uvbuf= s->edge_emu_buffer + 19 * s->linesize;
 
         srcY -= s->mspel * (1 + s->linesize);