--- psiconv/trunk/lib/psiconv/parse_image.c 1999/12/04 00:48:22 44 +++ psiconv/trunk/lib/psiconv/parse_image.c 1999/12/04 20:53:11 45 @@ -92,7 +92,7 @@ int psiconv_parse_paint_data_section(const psiconv_buffer buf,int lev, - psiconv_u32 off, int *length, + psiconv_u32 off, int *length,int isclipart, psiconv_paint_data_section *result) { int res = 0; @@ -178,12 +178,38 @@ compression = 1; } psiconv_debug(lev+2,off+len,"Compression: %s",compression?"RLE":"none"); + len += 4; + + if (isclipart) { + psiconv_progress(lev+2,off+len,"Going to read an unknown long"); + temp = psiconv_read_u32(buf,lev+2,off+len); + if (temp != 0xffffffff) { + psiconv_warn(lev+2,off+len, + "Paint data section prologue has unknown values"); + psiconv_debug(lev+2,off+len, + "offset %02x: read %08x, expected %08x",i,temp, 0xffffffff); + res = -1; + } + len += 4; + psiconv_progress(lev+2,off+len,"Going to read a second unknown long"); + temp = psiconv_read_u32(buf,lev+2,off+len); + if (temp != 0x44) { + psiconv_warn(lev+2,off+len, + "Paint data section prologue has unknown values"); + psiconv_debug(lev+2,off+len, + "offset %02x: read %08x, expected %08x",i,temp, 0x44); + res = -1; + } + len += 4; + } (*result)->red = malloc(sizeof(float) * picsize); (*result)->green = malloc(sizeof(float) * picsize); (*result)->blue = malloc(sizeof(float) * picsize); len = offset; datasize = size - len; + if (isclipart) + len += 8; psiconv_progress(lev+2,off+len,"Going to read the pixel data"); pixelnr = 0; @@ -395,7 +421,7 @@ } psiconv_progress(lev+2,off+len,"Going to read the picture data"); - res |= psiconv_parse_paint_data_section(buf,lev+2,off+len,&leng, + res |= psiconv_parse_paint_data_section(buf,lev+2,off+len,&leng,0, &((*result)->picture)); off += leng; if (!is_object) { @@ -520,7 +546,7 @@ off += 4; psiconv_progress(lev+2,off+len,"Going to read the Paint Data Section"); - res |= psiconv_parse_paint_data_section(buf,lev+2,off+len,&leng, + res |= psiconv_parse_paint_data_section(buf,lev+2,off+len,&leng,1, &((*result)->picture)); len += leng;