X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fivi_dsp.c;h=bedd5dc93ce0f26bf3ca8c3ae4033fdb3d6459db;hb=c0b47d1914a19abacdf1edf081cbf07485952920;hp=0ee703574107a6a4436a52301b962d70b5b19379;hpb=a8cedbebf163ad376abc4703b3156c44d0858404;p=ffmpeg diff --git a/libavcodec/ivi_dsp.c b/libavcodec/ivi_dsp.c index 0ee70357410..bedd5dc93ce 100644 --- a/libavcodec/ivi_dsp.c +++ b/libavcodec/ivi_dsp.c @@ -55,6 +55,9 @@ void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, b3_ptr = plane->bands[3].buf; for (y = 0; y < plane->height; y += 2) { + + if (y+2 >= plane->height) + pitch= 0; /* load storage variables with values */ if (num_bands > 0) { b0_1 = b0_ptr[0]; @@ -84,6 +87,13 @@ void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, } for (x = 0, indx = 0; x < plane->width; x+=2, indx++) { + if (x+2 >= plane->width) { + b0_ptr --; + b1_ptr --; + b2_ptr --; + b3_ptr --; + } + /* some values calculated in the previous iterations can */ /* be reused in the next ones, so do appropriate copying */ b2_1 = b2_2; // b2[x-1,y ] = b2[x, y ] @@ -171,10 +181,10 @@ void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, back_pitch = -pitch; - b0_ptr += pitch; - b1_ptr += pitch; - b2_ptr += pitch; - b3_ptr += pitch; + b0_ptr += pitch + 1; + b1_ptr += pitch + 1; + b2_ptr += pitch + 1; + b3_ptr += pitch + 1; } }