On Fri, May 26, 2017 at 1:30 PM, Anton Khirnov <an...@khirnov.net> wrote: > Quoting Luca Barbato (2017-05-23 22:08:49) >> On 5/17/17 7:46 PM, Vittorio Giovara wrote: >> > + av_channel_layout_uninit(dst); >> > + return av_channel_layout_copy(dst, channel_layout); >> >> Maybe put the uninit directly in the layout_copy so there isn't risk to >> leak memory if you forget. > > I am against this. Freeing memory should be explicit.
Well it can be "explicitly" documented ;) But seriously, it's incredibly easy to forget deallocating before copying, and while I see the reason for not bundling _uninit with _from_mask or _default, I think it makes sense here. -- Vittorio _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel