From: John B. <joh...@gm...> - 2015-11-22 22:57:16
|
On Sat, Nov 21, 2015 at 6:01 PM, Glenn Randers-Pehrson <gl...@gm...> wrote: > >> It does; it writes to it in the read case and in either case it can free >> the data (both pointers array and the rows that are pointed to.) Examine >> the functionality of the API 'png_data_freer' to see why this mess >> happens. I, for one, would strongly support deprecating png_data_freer in >> 1.7. >> > > As I understand it, It writes to info_ptr->row_pointers, not to the local > row_pointers that is passed in to png_set_rows(). So how is the latter not > eligible to be const? > You can't pass a (const*) to free; the object being freed (the thing pointed to by the argument) has to be mutable. The code frees both the pointers array and the rows. John Bowler |