fdkaacenc: fix accessing freed memory
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 29 Sep 2016 13:32:15 +0000 (14:32 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 29 Sep 2016 14:13:07 +0000 (15:13 +0100)
commitce59031b10efcf025c820704d8b8b9f6d215a85c
tree9e71a24a75580603610d6316070123796a10edd4
parent58bb21c463dfdb956e1a6811d345c556c9d95b17
fdkaacenc: fix accessing freed memory

The buffer data is not always copied in _Fill, and will be
read in _DecodeFrame. We unmap at the end of the function,
whether we get there via failure or early out, and keep a
ref to the buffer to ensure we can use it to unmap the
memory even after _finish_frame is called, as it unrefs
the buffer.

Note that there is an access beyond the allocated buffer,
which is only apparent when playing from souphttpsrc (ie,
not from filesrc). This appears to be a bug in the bit
reading code in libfdkaac AFAICT.

https://bugzilla.gnome.org/show_bug.cgi?id=772186
ext/fdkaac/gstfdkaacdec.c