[Mplayer-cvslog] CVS: main/libmpcodecs vd_qt8bps.c,1.1,1.2
Roberto Togni CVS
rtognimp at mplayerhq.hu
Fri Aug 29 00:02:18 CEST 2003
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv21959
Modified Files:
vd_qt8bps.c
Log Message:
100l fix for paletted 8bpp files, I committed an old version
Index: vd_qt8bps.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_qt8bps.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vd_qt8bps.c 28 Aug 2003 21:23:01 -0000 1.1
+++ vd_qt8bps.c 28 Aug 2003 22:01:44 -0000 1.2
@@ -84,8 +84,6 @@
int vo_ret; // Video output init ret value
qt8bps_context_t *hc; // Decoder context
BITMAPINFOHEADER *bih = sh->bih;
- int i;
- unsigned char *psrc, *pdest;
if ((hc = malloc(sizeof(qt8bps_context_t))) == NULL) {
mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Can't allocate memory for 8BPS decoder context.\n");
@@ -99,16 +97,10 @@
case 8:
hc->planes = 1;
hc->planemap[0] = 0; // 1st plane is palette indexes
- if (bih->biSize > sizeof(BITMAPINFOHEADER)) {
- psrc = (unsigned char*)bih + sizeof(BITMAPINFOHEADER);
- pdest = hc->palette = (unsigned char *)malloc(256*3);
- for (i = 0; i < 256; i++) {
- *pdest++ = *psrc++;
- *pdest++ = *psrc++;
- *pdest++ = *psrc++;
- psrc++;
- }
- }
+ if (bih->biSize > sizeof(BITMAPINFOHEADER)) {
+ hc->palette = (unsigned char *)malloc(256*4);
+ memcpy(hc->palette, (unsigned char*)bih + sizeof(BITMAPINFOHEADER), 256*4);
+ }
break;
case 24:
hc->planes = 3;
More information about the MPlayer-cvslog
mailing list