#13 libwmf: wrong reading of bitmap palette

closed-fixed
nobody
None
5
2006-03-11
2003-10-02
No

The libwmf bitmap reading code handles incorrectly
case, when the number of colors in the palette is set
to 0 (zero). According to the Microsoft, when this
value is set to zero, the palette contains maximum
number of colors for the bitmap's pixel width
(bits-per-pixel). (See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_1rw2.asp
for details.)

The libwmf keeps zero as a number of colors and don't
read any palette items - instead treats the palette
items as bitmap pixels, which results to the bitmap
corruption. This bug affects e.g. using bitmap brushes.

Attached patch provides basic, quick, fix - it works
for me, but I haven't done very much tests.

Discussion

  • David Cernoch

    David Cernoch - 2003-10-02

    Patch to correct number of palette entries in loaded bitmap.

     
  • Dom Lachowicz

    Dom Lachowicz - 2006-03-11
    • status: open --> closed-fixed
     
  • Dom Lachowicz

    Dom Lachowicz - 2006-03-11

    Logged In: YES
    user_id=69417

    Better late than never. Thanks!

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks