libmp3lame: use the correct remaining buffer size when flushing

CC:libav-stable@libav.org
png: use av_mallocz_array() for the zlib zalloc function

Fixes valgrind uninitialized memory errors when decoding png.

CC:libav-stable@libav.org