summaryrefslogtreecommitdiff
path: root/libavcodec/vc1dec.c
diff options
context:
space:
mode:
authorMashiat Sarker Shakkhar <mashiat.sarker@gmail.com>2012-08-03 20:53:35 +0600
committerKostya Shishkov <kostya.shishkov@gmail.com>2012-08-03 17:21:54 +0200
commit8379ea5e9f6bf3d50663ffb655ba5dd6a11652b4 (patch)
tree82d71a1f5a873a21e46fa84a4774ed3c9cff9215 /libavcodec/vc1dec.c
parentca844b7be9c69c91113094ef21d720f1ca80db60 (diff)
vc1dec: Invoke edge_emulation regardless of MV precision
In VC-1 interlaced field pictures, chroma motion vectors can extend beyond picture boundary even if luma vectors are bounded. The problem shows up only for hpel interpolated MVs, and may be due to the way motion vectors are scaled / cropped. Thanks to Konstantin Shishkov for suggesting the fix. This fixes long-known segfaults in MC-VC1.ts from videolan streams archive. Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r--libavcodec/vc1dec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index e36cc0dc54..fcb25db0bf 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -1880,8 +1880,8 @@ static void vc1_interp_mc(VC1Context *v)
}
if (v->rangeredfrm || s->h_edge_pos < 22 || v_edge_pos < 22
- || (unsigned)(src_x - s->mspel) > s->h_edge_pos - (mx & 3) - 16 - s->mspel * 3
- || (unsigned)(src_y - s->mspel) > v_edge_pos - (my & 3) - 16 - s->mspel * 3) {
+ || (unsigned)(src_x - 1) > s->h_edge_pos - (mx & 3) - 16 - 3
+ || (unsigned)(src_y - 1) > v_edge_pos - (my & 3) - 16 - 3) {
uint8_t *uvbuf = s->edge_emu_buffer + 19 * s->linesize;
srcY -= s->mspel * (1 + s->linesize);