[haiku-commits] Re: haiku: hrev52055 - src/kits/media headers/os/media

  • From: Stefano Ceccherini <stefano.ceccherini@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 27 Aug 2018 10:52:31 +0200

Il giorno lun 27 ago 2018 alle ore 10:49 Stefano Ceccherini <
stefano.ceccherini@xxxxxxxxx> ha scritto:




Issues for which no fix patch has been submitted:

* Lots of memset calls are not needed and should be removed.
* The patch breaks metadata initialization/cleanup in media_format.


I think that this could happen in the media_format copy constructor, at
least. We call Clear() on "this", and then the assignment operator.
The assignment operator calls the media_format destructor (for "this"),
but Clear() already set the metadata pointer / area id to NULL/-1 so
they're probably leaked.



Moreover, in most cases, Clear() is not needed, since one can/should just
use a new media_format object instead.

Other related posts: