From e497eb1f9172f0e620e807a99b3379b7348d6410 Mon Sep 17 00:00:00 2001 From: Robin KAY Date: Fri, 20 Dec 2002 01:35:49 +0000 Subject: MNG demuxer added CVS patchset: 3591 CVS date: 2002/12/20 01:35:49 --- src/libxinevdec/rgb.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/libxinevdec') diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index addf45efe..2a13fb068 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -21,7 +21,7 @@ * Actually, this decoder just converts a raw RGB image to a YUY2 map * suitable for display under xine. * - * $Id: rgb.c,v 1.14 2002/12/18 21:35:42 esnel Exp $ + * $Id: rgb.c,v 1.15 2002/12/20 01:35:50 komadori Exp $ */ #include @@ -153,9 +153,8 @@ static void rgb_decode_data (video_decoder_t *this_gen, /* iterate through each row */ buf_ptr = 0; - row_ptr = this->yuv_planes.row_width * - (this->yuv_planes.row_count - 1); - for (; row_ptr >= 0; row_ptr -= this->yuv_planes.row_width) { + + for (row_ptr = 0; row_ptr < this->yuv_planes.row_width * this->yuv_planes.row_count; row_ptr += this->yuv_planes.row_width) { for (pixel_ptr = 0; pixel_ptr < this->width; pixel_ptr++) { if (this->bytes_per_pixel == 1) { @@ -188,6 +187,8 @@ static void rgb_decode_data (video_decoder_t *this_gen, g = this->buf[buf_ptr++]; r = this->buf[buf_ptr++]; + buf_ptr += this->bytes_per_pixel - 3; + this->yuv_planes.y[row_ptr + pixel_ptr] = COMPUTE_Y(r, g, b); this->yuv_planes.u[row_ptr + pixel_ptr] = -- cgit v1.2.3