[MPlayer-dev-eng] [BUG] bug in vo_png?

Joey Parrish joey at yunamusic.com
Tue May 14 00:43:27 CEST 2002


On Tue, May 14, 2002 at 12:40:58AM +0200, Arpi wrote:
> try to remove this bad code:
> 
>   /* hack: swap planes for I420 ;) -- alex */
>   if ((image_format == IMGFMT_IYUV) || (image_format == IMGFMT_I420))
>   {
>     uint8_t *src_i420[3];
> 
>     src_i420[0] = src[0];
>     src_i420[1] = src[2];
>     src_i420[2] = src[1];
>     src = src_i420;
>   }
> 
> it swaps U<->V while it shouldn't, according to DOCS/tech/colorspaces.txt
>
> try to change this:
>              image_data = malloc(image_width*image_height*3);
> to:
>              image_data = malloc(image_width*image_height*3+16);
> 
> afair Michael's 24bpp converters write a bit too much, pass the limits
> it's workarounded in vfilter layer, it explains why does external csp
> conversion work

Excellent.  Between those two changes, it works perfectly now.
Thanks.  Here's the appropriate patch if you need it.

--Joey

-- 

"Yes." -- John F. Kennedy
-------------- next part --------------
--- libvo/vo_png.c.orig	Mon May 13 17:08:11 2002
+++ libvo/vo_png.c	Mon May 13 17:39:02 2002
@@ -85,7 +85,7 @@
 	case IMGFMT_BGR32:
 	     bpp = 24;
 	     cspace = BGR;
-	     image_data = malloc(image_width*image_height*3);
+	     image_data = malloc(image_width*image_height*3+16);
 	break;
 	case IMGFMT_BGR24:
 	     bpp = 24;
@@ -287,17 +287,6 @@
 
 static uint32_t draw_slice( uint8_t *src[],int stride[],int w,int h,int x,int y )
 {
-  /* hack: swap planes for I420 ;) -- alex */
-  if ((image_format == IMGFMT_IYUV) || (image_format == IMGFMT_I420))
-  {
-    uint8_t *src_i420[3];
-    
-    src_i420[0] = src[0];
-    src_i420[1] = src[2];
-    src_i420[2] = src[1];
-    src = src_i420;
-  }
-
   if (scale_srcW) {
     uint8_t *dst[3] = {image_data, NULL, NULL};
     SwScale_YV12slice(src,stride,y,h,


More information about the MPlayer-dev-eng mailing list