summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuergen Keil <jkeil@users.sourceforge.net>2002-10-13 17:24:29 +0000
committerJuergen Keil <jkeil@users.sourceforge.net>2002-10-13 17:24:29 +0000
commit4a621f2f0880a440dd1751ec96372e3965e64ca6 (patch)
tree12d33ef8a1f5e14808838d881e9d1704caefbcf7
parent011810a2984487049a5e6e9b1c23470b4a1cccc2 (diff)
downloadxine-lib-4a621f2f0880a440dd1751ec96372e3965e64ca6.tar.gz
xine-lib-4a621f2f0880a440dd1751ec96372e3965e64ca6.tar.bz2
yuv2rgb_mlib needs an even YUV2 width. It was segfaulting on Solaris SPARC with
MediaLib. CVS patchset: 2826 CVS date: 2002/10/13 17:24:29
-rw-r--r--src/video_out/video_out_xshm.c5
-rw-r--r--src/video_out/yuv2rgb_mlib.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c
index 88cb7ae7c..a5f4afa33 100644
--- a/src/video_out/video_out_xshm.c
+++ b/src/video_out/video_out_xshm.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_xshm.c,v 1.92 2002/10/04 13:36:56 mroi Exp $
+ * $Id: video_out_xshm.c,v 1.93 2002/10/13 17:24:29 jkeil Exp $
*
* video_out_xshm.c, X11 shared memory extension interface for xine
*
@@ -421,6 +421,9 @@ static void xshm_compute_rgb_size (xshm_driver_t *this, xshm_frame_t *frame) {
frame->sc.output_height = ((frame->sc.delivered_height + 15) >> 4);
if (frame->sc.output_width < 8)
frame->sc.output_width = 8;
+ if (frame->sc.output_width & 1) /* yuv2rgb_mlib needs an even YUV2 width */
+ frame->sc.output_width++;
+
#ifdef LOG
printf("video_out_xshm: frame source %d x %d => screen output %d x %d%s\n",
diff --git a/src/video_out/yuv2rgb_mlib.c b/src/video_out/yuv2rgb_mlib.c
index c627e8a73..d0ebd598b 100644
--- a/src/video_out/yuv2rgb_mlib.c
+++ b/src/video_out/yuv2rgb_mlib.c
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <assert.h>
#include <inttypes.h>
#include <mlib_video.h>
@@ -82,6 +83,7 @@ static void mlib_yuv420_rgb24 (yuv2rgb_t *this,
dy = 0;
dst_height = this->dest_height;
+ assert((this->dest_width&1) == 0); /* mlib needs an even YUV2 width */
for (;;) {
scale_line (pu, this->u_buffer,
this->dest_width >> 1, this->step_dx);
@@ -156,6 +158,7 @@ static void mlib_yuv420_argb32 (yuv2rgb_t *this,
dy = 0;
dst_height = this->dest_height;
+ assert((this->dest_width&1) == 0); /* mlib needs an even YUV2 width */
for (;;) {
scale_line (pu, this->u_buffer,
this->dest_width >> 1, this->step_dx);
@@ -230,6 +233,7 @@ static void mlib_yuv420_abgr32 (yuv2rgb_t *this,
dy = 0;
dst_height = this->dest_height;
+ assert((this->dest_width&1) == 0); /* mlib needs an even YUV2 width */
for (;;) {
scale_line (pu, this->u_buffer,
this->dest_width >> 1, this->step_dx);