changeset 7782:4f6bbaf09dbc

fixing palette export
author arpi
date Thu, 17 Oct 2002 21:32:35 +0000
parents 2263b7200fdd
children 29c059774519
files libmpcodecs/vd_raw.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_raw.c	Thu Oct 17 20:37:55 2002 +0000
+++ b/libmpcodecs/vd_raw.c	Thu Oct 17 21:32:35 2002 +0000
@@ -88,7 +88,14 @@
 	if(sh->format==0 || sh->format==3) mpi->stride[0]=(mpi->stride[0]+3)&(~3);
 	if(mpi->imgfmt==IMGFMT_RGB8 || mpi->imgfmt==IMGFMT_BGR8){
 	    // export palette:
-	    mpi->planes[1]=sh->bih ? (((unsigned char*)&sh->bih)+40) : NULL;
+	    mpi->planes[1]=sh->bih ? (unsigned char*)(sh->bih+1) : NULL;
+#if 0
+	    printf("Exporting palette: %p !!\n",mpi->planes[1]);
+	    {	unsigned char* p=mpi->planes[1];
+		int i;
+		for(i=0;i<64;i++) printf("%3d: %02X %02X %02X (%02X)\n",i,p[4*i],p[4*i+1],p[4*i+2],p[4*i+3]);
+	    }
+#endif
 	}
 	frame_size=mpi->stride[0]*mpi->h;
 	if(mpi->bpp<8) frame_size=frame_size*mpi->bpp/8;