summaryrefslogtreecommitdiff
path: root/src/libxinevdec/rgb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libxinevdec/rgb.c')
-rw-r--r--src/libxinevdec/rgb.c9
1 files changed, 5 insertions, 4 deletions
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 <stdio.h>
@@ -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] =