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
atomic: fix CAS with armcc.

On the current code, armcc will fail with:
"libavutil/atomic_gcc.h", line 52: Error:  #2771: first argument must be
a pointer to integer or enumeration type
lavc: remove disabled FF_API_OLD_DECODE_AUDIO cruft
lavc: remove disabled FF_API_OLD_ENCODE_AUDIO cruft
lavc: remove disabled FF_API_OLD_ENCODE_VIDEO cruft
lavc: remove disabled FF_API_MPV_GLOBAL_OPTS cruft
lavc: remove disabled FF_API_COLOR_TABLE_ID cruft
lavc: remove disabled FF_API_INTER_THRESHOLD cruft
lavc: remove disabled FF_API_SUB_ID cruft
lavc: remove disabled FF_API_DSP_MASK cruft
lavc: remove disabled FF_API_FIND_BEST_PIX_FMT cruft
lavc: remove disabled FF_API_CODEC_ID cruft
lavc: remove disabled FF_API_VDA_ASYNC cruft
avplay: enable only when SDL 1.2 is found

SDL 2 is API incompatible.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
vf_pad: fix a & instead of && typo

Avoid buffer overflow in buffer_needs_copy()

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
vorbisdec: do not leak the first frame.
ratecontrol: remove an unused variable
lavc: fix get_buffer() compatibility layer for audio.

planes - FF_ARRAY_ELEMS would be evaluated as unsigned and underflow
instead of being negative as was intended.
svq1: use av_frame_free to free refcounted frame

Fixes a memleak due to avcodec_free_frame not freeing the frame data.