Menu

#119 Bugfix: Cloned bitmap "view" still points to original external bitmap

None
closed
None
5
2018-07-31
2016-03-18
No

When we Clone we memcpy the header. This way a view into a external bitmap, wich has ext_bits and ext_pitch set, after Clone will still have these fields pointing to the external bitmap.

To fix, reset the fields:

      ((FREEIMAGEHEADER *)new_dib->data)->ext_bits  = NULL;
      ((FREEIMAGEHEADER *)new_dib->data)->ext_pitch = 0;

This is serious bug, because if one clones a view, in hopes to get unique data, then modifies the new bitmap, it will still modify the original image!

Discussion

  • Hervé Drolon

    Hervé Drolon - 2016-03-20
    • status: open --> pending
    • assigned_to: Hervé Drolon
    • Group: -->
     
  • Hervé Drolon

    Hervé Drolon - 2016-03-20

    Hi Mihail,

    Thanks for pointing this bug. It is now fixed in the CVS.

    Hervé

     
  • Mikhail T.

    Mikhail T. - 2017-05-03

    It is "external_...", rather than "ext_...", is not it?

     
  • Hervé Drolon

    Hervé Drolon - 2018-07-31
    • status: pending --> closed
     
  • Hervé Drolon

    Hervé Drolon - 2018-07-31

    Fixed in release 3.18.0

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB