diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 4019631932..5a09486aa8 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -574,8 +574,8 @@ static void rgb_name ## _to_yuv420p(AVPicture *dst, AVPicture *src, \ cb = dst->data[1]; \ cr = dst->data[2]; \ \ - wrap = width; \ - wrap3 = width * BPP; \ + wrap = dst->linesize[0]; \ + wrap3 = src->linesize[0]; \ p = src->data[0]; \ for(y=0;ylinesize[1] - width / 2; \ + cr += dst->linesize[2] - width / 2; \ } \ } \ \