oma: Validate sample rates

The sample rate index is 3 bits even if currently index 5, 6 and 7 are
not supported.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 0933fd1533560fbc718026e12f19a4824b041237)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
configure: Enable hwaccels without external dependencies by default.

(cherry picked from commit 2e2ec667416d8ed345491ac360fccc94e7a4772f)

This is a fixup for f074618 to reenable auto-detection of dxva in the
build environment.

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
avfiltergraph: check for sws opts being non-NULL before using them.

Avoid snprintfing a NULL pointer.

CC: libav-stable@libav.org
(cherry picked from commit 6e3c13a559e9ff300b5ca60e1d503e594d7f055c)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
matroska: fix a corner case in ebml-lace parsing

Make sure we notice when the lace_size[n] is a negative value.

CC: libav-stable@libav.org
(cherry picked from commit 8a96df7b70be509dae9ceec82d2c10a20361356d)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
matroska: Update the available size after lace parsing

Fix heap-buffer-overflow in matroska_parse_block for
corrupted real media in mkv files.

CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit fc43c19a567aa945398dccb491d972c11ec2a065)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
matroska: pass the lace size to the matroska_parse_rm_audio

Each lace must be independent according to the specification.

Fix heap-buffer-overflow in matroska_parse_block for
corrupted real media in mkv files.

Stricter check than fc43c19a567aa945398dccb491d972c11ec2a065

CC: libav-stable@libav.org
(cherry picked from commit 25a80a931a3829f9d730971dbd269aa39cc273f6)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
xmv: do not leak memory in the error paths in xmv_read_header()

CC: libav-stable@libav.org
(cherry picked from commit f8080bd13b5f7fc48204b17fa59a5ce9feb15f07)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
bmv: check for len being valid in bmv_decode_frame().

It can be 0 or -1 for invalid files, which may result in invalid memory
access.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit b88f902125ee808c8366e9dcb3f21e4c227483fc)

Conflicts:

	libavcodec/bmv.c
xmv: check audio track parameters validity.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit d1016dccdcb10486245e5d7c186cc31af54b2a9c)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
dfa: check for invalid access in decode_wdlt().

This can happen when the number of skipped lines is not consistent with
the number of coded lines.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 3623589edc7b1257bb45aa9e52c9631e133f22b6)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
lavf: make sure stream probe data gets freed.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit dbb1425811a672eddf4acf0513237cdf20f83756)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>