opusdec: make sure all substreams have the same number of coded samples

Fixes invalid writes with invalid multichannel streams.

CC:libav-stable@libav.org
(cherry picked from commit 1973079417e8701b52ba810a72cb6c7c6f7f9a56)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
avutil/buffer_internal: leave the buffer pool entries volatile

Theres no reason to remove the volatile keyword in a release branch

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'ca78ee73db9e059f501706ba6108e23902e84933' into release/2.4

* commit 'ca78ee73db9e059f501706ba6108e23902e84933':
  opusdec: make sure all substreams have the same number of coded samples

Merged-by: Michael Niedermayer <michaelni@gmx.at>
fix Makefile objects for pulseaudio support

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb58c771ade66afcc623250e1c7ac8191381d991)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/thread.h: Support OS/2 threads

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 090a7801a8817c1fbc6db0ed39070bf82255d8f2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/threads.h: correct an include to be local

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32eadfe453c32788ea57968e6e80f673f434739d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
lavc/utils: Make pix_fmt desc pointer const.

Fixes an "initialization discards qualifiers from pointer target type" warning.
(cherry picked from commit f05855414ed4cce97c06ba2a31f4987af47e6d4e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/options_table fix min of audio channels and sample rate

Found-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 206c98f303e833c9e94427c9e3f9867f85265f78)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/utvideodec: fix assumtation that slice_height >= 1

Fixes out of array read
Fixes: asan_heap-oob_2573085_3783_utvideo_rgba_median.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7656c4c6e66f8a787d384f027ad824cc1677fda1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/wmaprodec: Fix integer overflow in sfb_offsets initialization

Fixes out of array read
Fixes: asan_heap-oob_2aec5b0_1828_classical_22_16_2_16000_v3c_0_exclusive_0_29.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5dcb99033df16eccc4dbbc4a099ad64457f9f090)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
lavu/opt: fix av_opt_get function

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
(cherry picked from commit 173d51c982f1ecaa8d28cd0d8611164be0c9d36d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/mpeg4video_parser: fix spurious extradata parse warnings

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7d37e45f6bac198bc986aeb987afe219edbbd45a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/hlsenc: Free context after hls_append_segment

Fixes reading uninitialized memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 530eb6acf8ee867bf00728bf7efaf505da107e17)

Conflicts:

	libavformat/hlsenc.c
doc/APIchanges: Fix some wrong versions

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4eae568a0712b8b59cb74b3882963f938c26eab4)

Conflicts:

	doc/APIchanges
swscale/x86/rgb2rgb_template: handle the first 2 lines with C in rgb24toyv12_*()

This avoids out of array accesses
Should fix Ticket3451

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4388e78a0f022c8572996f9ab568a39b5f716f9d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/mjpegdec: Check for pixfmtid 0x42111100 || 0x24111100 with more than 8 bits

These cases are not supported yet

Fixes assertion failure
Fixes: signal_sigabrt_7ffff6ac7bb9_1_cov_1553101927_00.jpg
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0bf416f2628137e5389050fa323c329692dd4ba6)

Conflicts:

	libavcodec/mjpegdec.c
avcodec/mjpegdec: Fix context fields becoming inconsistent

Fixes out of array access
Fixes: asan_heap-oob_1ca4f85_2760_cov_144449187_miss_congeniality_pegasus_ljpg.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0eecf40935b22644e6cd74c586057237ecfd6844)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/utils: Check that the data is complete in avpriv_bprint_to_extradata()

Fixes out of array read
Fixes: asan_heap-oob_4d2250_814_cov_2745172097_JACOsub_capability_tester.jss
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3d5d95db3f5d8e2093e9e19d0c46e86f54ed2a5d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/flacdec: Call ff_flacdsp_init() unconditionally

Fixes out of array access
Fixes: signal_sigsegv_324b135_3398_cov_246853371_short.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e5c01ccdf5a9a330d4c51a9b9ea721fd8f1fb70b)

Conflicts:

	libavcodec/flacdec.c
avcodec/pngdec: Check IHDR/IDAT order

Fixes out of array access
Fixes: asan_heap-oob_20a6c26_2690_cov_3434532168_mail.png
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 79ceaf827be0b070675d4cd0a55c3386542defd8)

Conflicts:

	libavcodec/pngdec.c