summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuergen Keil <jkeil@users.sourceforge.net>2001-10-05 18:37:33 +0000
committerJuergen Keil <jkeil@users.sourceforge.net>2001-10-05 18:37:33 +0000
commit21d531a6003cb60f6f274b701aeaa5fa3b1388f5 (patch)
tree9ce39514cd44af1ea01bc1de66de8b61875db4a4 /src
parente723efae2fcbfa501639fb6909ed0e8a662e79b8 (diff)
downloadxine-lib-21d531a6003cb60f6f274b701aeaa5fa3b1388f5.tar.gz
xine-lib-21d531a6003cb60f6f274b701aeaa5fa3b1388f5.tar.bz2
solaris mlib yub2rgb crashed for 4:3 NTSC DVD format
CVS patchset: 742 CVS date: 2001/10/05 18:37:33
Diffstat (limited to 'src')
-rw-r--r--src/video_out/yuv2rgb_mlib.c54
1 files changed, 39 insertions, 15 deletions
diff --git a/src/video_out/yuv2rgb_mlib.c b/src/video_out/yuv2rgb_mlib.c
index 34bb582b6..0e992e1c0 100644
--- a/src/video_out/yuv2rgb_mlib.c
+++ b/src/video_out/yuv2rgb_mlib.c
@@ -74,15 +74,15 @@ static void mlib_yuv420_rgb24 (yuv2rgb_t *this,
uint8_t * image, uint8_t * py,
uint8_t * pu, uint8_t * pv)
{
- int height;
+ int dst_height;
int dy;
mlib_status mlib_stat;
if (this->do_scale) {
dy = 0;
- height = this->source_height >> 1;
+ dst_height = this->dest_height;
- while (--height >= 0) {
+ for (;;) {
scale_line (pu, this->u_buffer,
this->dest_width >> 1, this->step_dx);
pu += this->uv_stride;
@@ -109,21 +109,29 @@ static void mlib_yuv420_rgb24 (yuv2rgb_t *this,
dy += this->step_dy;
image += this->rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (image, (uint8_t*)image-this->rgb_stride, this->dest_width*6);
dy += this->step_dy;
image += this->rgb_stride;
}
+
+ if (dst_height <= 0)
+ break;
+
dy -= 32768;
dy += this->step_dy;
image += this->rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (image, (uint8_t*)image-this->rgb_stride, this->dest_width*3);
dy += this->step_dy;
image += this->rgb_stride;
}
+
+ if (dst_height <= 0)
+ break;
+
dy -= 32768;
}
} else {
@@ -140,15 +148,15 @@ static void mlib_yuv420_argb32 (yuv2rgb_t *this,
uint8_t * image, uint8_t * py,
uint8_t * pu, uint8_t * pv)
{
- int height;
+ int dst_height;
int dy;
mlib_status mlib_stat;
if (this->do_scale) {
dy = 0;
- height = this->source_height >> 1;
+ dst_height = this->dest_height;
- while (--height >= 0) {
+ for (;;) {
scale_line (pu, this->u_buffer,
this->dest_width >> 1, this->step_dx);
pu += this->uv_stride;
@@ -175,21 +183,29 @@ static void mlib_yuv420_argb32 (yuv2rgb_t *this,
dy += this->step_dy;
image += this->rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (image, (uint8_t*)image-this->rgb_stride, this->dest_width*8);
dy += this->step_dy;
image += this->rgb_stride;
}
+
+ if (dst_height <= 0)
+ break;
+
dy -= 32768;
dy += this->step_dy;
image += this->rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (image, (uint8_t*)image-this->rgb_stride, this->dest_width*4);
dy += this->step_dy;
image += this->rgb_stride;
}
+
+ if (dst_height <= 0)
+ break;
+
dy -= 32768;
}
} else {
@@ -206,15 +222,15 @@ static void mlib_yuv420_abgr32 (yuv2rgb_t *this,
uint8_t * image, uint8_t * py,
uint8_t * pu, uint8_t * pv)
{
- int height;
+ int dst_height;
int dy;
mlib_status mlib_stat;
if (this->do_scale) {
dy = 0;
- height = this->source_height >> 1;
+ dst_height = this->dest_height;
- while (--height >= 0) {
+ for (;;) {
scale_line (pu, this->u_buffer,
this->dest_width >> 1, this->step_dx);
pu += this->uv_stride;
@@ -241,21 +257,29 @@ static void mlib_yuv420_abgr32 (yuv2rgb_t *this,
dy += this->step_dy;
image += this->rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (image, (uint8_t*)image-this->rgb_stride, this->dest_width*8);
dy += this->step_dy;
image += this->rgb_stride;
}
+
+ if (dst_height <= 0)
+ break;
+
dy -= 32768;
dy += this->step_dy;
image += this->rgb_stride;
- while (dy < 32768) {
+ while (--dst_height > 0 && dy < 32768) {
memcpy (image, (uint8_t*)image-this->rgb_stride, this->dest_width*4);
dy += this->step_dy;
image += this->rgb_stride;
}
+
+ if (dst_height <= 0)
+ break;
+
dy -= 32768;
}
} else {