avcodec/mace: check buffer size

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f9d2775e090_8782_surge-2-8-MAC3.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
h264: Clear ERContext.cur_pic when unref'ing current picture.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
ffmpeg: do not fail when options are routed to libavformat and libavcodec and only one can be used

Fixes setting frame_size for pulse demuxer

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
matroskadec: Export the MuxingApp element value as metadata

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/bink: seek to first frame

Some rare bink files include unused bytes between the frame table index
and first frame data.

Fixes ticket #3266.

This patch has also been tested with non-seekable protocols.

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/http: always allow no-op seek

This also allows checking stream position as per ffurl_seek() doxy.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
avformat/hls: decouple playlists from variants

Not all "sub-playlists" are variant playlists (containing the same
content with a different bitrate, etc) in the current version of the HLS
specification. They can now also be alternative renditions, containing
e.g. alternative audio tracks etc.

Decouple playlists from variants to prepare for handling the new
features.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
MAINTAINERS: add myself for spdif* and hls.c

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
avformat/bink: display audio track ids

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/avcodec: document that some video decoders do not support linesizes changing between frames.

Omission in the documentation found by: Sebastian Dröge
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
mpegvideo: set reference/pict_type on generated reference frames

Otherwise the generic code will unref them, which can then result in
last_picture_ptr == current_picture_ptr, which causes deadlocks at least
in rv40.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
rv30: fix extradata size check.

It has been checking the number of bits in the offset instead of the
actual offset.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
adx: check that the offset is not negative

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
eacmv: check the framerate before setting it.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
mathematics: remove asserts from av_rescale_rnd()

It is a public function, it must not assert on its parameters.
pmpdec: check that there is at least one audio packet.

The code cannot handle there being none, but that should not happen for
valid files.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
lzw: switch to bytestream2

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
h264: reset data_partitioning if decoding the slice header for NAL_DPA fails

If it was set before then we can end up trying to decode a slice without
a valid slice header, which can lead to invalid memory access.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
audio_mix: initialize the data pointers to NULL

This should make it easier to catch problems where some of those
pointers are used uninitialized, since reading from NULL should always
crash, while random numbers from stack can turn out to be valid
pointers, so random memory may be silently overwritten.
audio_mix: fix zeroing output channels in certain cases

Specifically, when the corresponding input channel exists and its matrix
column is all-zero (which is necessary for zeroing the output), the
matrix column must be removed from the matrix.

This is not done currently, so the mixing code would end up using
uninitialized pointers from stack.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind