# HG changeset patch # User romansh # Date 1052708023 0 # Node ID 5d2376294fbfba6b95960f48f0070dfccb3487bc # Parent db903b6fd197755f6ed29eaea0a3f635e556e895 * fixing a bug in avpicture_layout (PAL8 wasn't handled properly) * adding regression tests for all pix_fmt conversions * making libavtest part of the default testsuite diff -r db903b6fd197 -r 5d2376294fbf imgconvert.c --- a/imgconvert.c Sun May 11 11:26:35 2003 +0000 +++ b/imgconvert.c Mon May 12 02:53:43 2003 +0000 @@ -324,12 +324,15 @@ if (size > dest_size) return -1; - if (pf->pixel_type == FF_PIXEL_PACKED) { + if (pf->pixel_type == FF_PIXEL_PACKED || pf->pixel_type == FF_PIXEL_PALETTE) { if (pix_fmt == PIX_FMT_YUV422 || pix_fmt == PIX_FMT_RGB565 || pix_fmt == PIX_FMT_RGB555) w = width * 2; + else if (pix_fmt == PIX_FMT_PAL8) + w = width; else w = width * (pf->depth * pf->nb_channels / 8); + data_planes = 1; h = height; } else { @@ -350,7 +353,10 @@ s += src->linesize[i]; } } - + + if (pf->pixel_type == FF_PIXEL_PALETTE) + memcpy((unsigned char *)(((size_t)dest + 3) & ~3), src->data[1], 256 * 4); + return size; }