ff_emulated_edge_mc: fix handling of w/h being 0

Fixes assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-12-05 03:14:03 +01:00
parent 45326cb684
commit 599ae9995f
2 changed files with 6 additions and 0 deletions

View File

@ -130,6 +130,9 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src, int linesize, i
int x, y;
int start_y, start_x, end_y, end_x;
if(!w || !h)
return;
if(src_y>= h){
src-= src_y*linesize;
src+= (h-1)*linesize;

View File

@ -1675,6 +1675,9 @@ static av_always_inline void emulated_edge_mc(uint8_t *buf, const uint8_t *src,
{
int start_y, start_x, end_y, end_x, src_y_add = 0;
if(!w || !h)
return;
if (src_y >= h) {
src -= src_y*linesize;
src_y_add = h - 1;