mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
wmv2: Use emu edge mode when the edge is too small
Fixes out of array read Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
92002db3eb
commit
76e6b1eba1
@ -116,7 +116,7 @@ void ff_mspel_motion(MpegEncContext *s,
|
||||
uvlinesize = s->uvlinesize;
|
||||
ptr = ref_picture[0] + (src_y * linesize) + src_x;
|
||||
|
||||
if(s->flags&CODEC_FLAG_EMU_EDGE){
|
||||
if(s->flags&CODEC_FLAG_EMU_EDGE || src_y <= -15 || src_y >= s->height - 1)
|
||||
if(src_x<1 || src_y<1 || src_x + 17 >= s->h_edge_pos
|
||||
|| src_y + h+1 >= v_edge_pos){
|
||||
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr - 1 - s->linesize, s->linesize, 19, 19,
|
||||
@ -124,7 +124,6 @@ void ff_mspel_motion(MpegEncContext *s,
|
||||
ptr= s->edge_emu_buffer + 1 + s->linesize;
|
||||
emu=1;
|
||||
}
|
||||
}
|
||||
|
||||
s->dsp.put_mspel_pixels_tab[dxy](dest_y , ptr , linesize);
|
||||
s->dsp.put_mspel_pixels_tab[dxy](dest_y+8 , ptr+8 , linesize);
|
||||
|
Loading…
x
Reference in New Issue
Block a user