OLEPictureImpl_Load: fix for headerless pictures

Fabian Cenedese Cenedese at indel.ch
Tue Feb 3 09:09:24 CST 2004


>> >> This fails on on my computer and I don't
>> >> know how wine could detect if it's a headerless picture or no picture at all
>> >> if they look the same (so far).
>> >
>> >Maybe check header[0] to be real .bmp or .gif magic and header[1] for
>> >zero?
>>
>> I couldn't see a difference, always 0x746c in the first entry.
>
>Then what type of picture it is?
>
>0x4947  GIF
>0xd8ff  JPEG
>0x4d42  BMP
>0x0000  ICON
>0x746c  ???

Well, as I didn't use any pictures I don't know what it's supposed to be.
Might as well be "NoPic" :) But I have also seen this marker where the
second field was not zero.

>Have you seen something like "Unknown magic, blah-blah-blah..."?

It depends.

Without your patch (where [0]=746c, and [1]=0) :
trace:ole:OLEPictureImpl_Load (0x40383880,0x414de29c)
fixme:ole:OLEPictureImpl_Load icon.idReserved=0
fixme:ole:OLEPictureImpl_Load icon.idType=0
fixme:ole:OLEPictureImpl_Load icon.idCount=0
fixme:ole:OLEPictureImpl_Load [0] width 0
fixme:ole:OLEPictureImpl_Load [0] height 0
fixme:ole:OLEPictureImpl_Load [0] bColorCount 0
fixme:ole:OLEPictureImpl_Load [0] bReserved 0
fixme:ole:OLEPictureImpl_Load [0] xHotspot 0
fixme:ole:OLEPictureImpl_Load [0] yHotspot 0
fixme:ole:OLEPictureImpl_Load [0] dwDIBSize 0
fixme:ole:OLEPictureImpl_Load [0] dwDIBOffset 0
fixme:ole:OLEPictureImpl_Load CreateIcon failed.
(obviously when all data are 0)
trace:ole:OLEPictureImpl_Release (0x40383880)->(ref=2)
trace:ole:OLEPictureImpl_Release (0x40382ec8)->(ref=1)
trace:ole:OLEPictureImpl_Destroy (0x40382ec8)
trace:ole:OLEPictureImpl_Release (0x40383880)->(ref=1)
trace:ole:OLEPictureImpl_Destroy (0x40383880)
fixme:ole:OLEPictureImpl_Destroy Unsupported type 0 - unable to delete
trace:ole:OLEPictureImpl_Release (0x40380a70)->(ref=1)
trace:ole:OLEPictureImpl_Destroy (0x40380a70)
trace:ole:OLEFontImpl_ReleaseHfont (0x4037f648)->(0xd82) (lock=0)
trace:ole:OLEPictureImpl_Release (0x4037f7a8)->(ref=1)
trace:ole:OLEPictureImpl_Destroy (0x4037f7a8)

With your patch (already earlier with [0]=756c, [1]=...):
fixme:ole:OLEPictureImpl_Load Could only read 109 of 2763 bytes in no-header case?
fixme:ole:OLEPictureImpl_Load Unknown magic 746c, 109 read bytes:
6c 74 00 00 00 00 00 00 6c 74
00 00 00 00 00 00 00 00 01 00
00 00 0a 00 54 00 61 00 62 00
20 00 31 00 01 00 00 00 04 52
e3 0b 91 8f ce 11 9d e3 00 aa
00 4b b8 51 6c 74 00 00 00 00
00 00 00 00 00 00 00 00 0a 00
54 00 61 00 62 00 20 00 32 00
01 00 00 00 04 52 e3 0b 91 8f
ce 11 9d e3 00 aa 00 4b b8 51
6c 74 00 00 00 00 00 00 00 00
00 00 00 00 ff 02 04

Maybe this isn't even part of a picture and we shouldn't be reading this.
How does it know that a picture is coming? Perhaps we shouldn't
even enter OLEPictureImpl_Load if there is no picture at all.

Thanks

bye  Fabi





More information about the wine-devel mailing list