ffserver: strip odd chars from html error messages before sending them back

Fixes Ticket3034

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/jpeg2000dec: check transform equality in MCT

Fixes null pointer dereference
Fixes Ticket2843

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/jpeg2000dec: prevent out of array accesses in pixel addressing

Fixes Ticket2921

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/jpeg2000dec: fix context consistency with too large lowres

Fixes out of array accesses
Fixes Ticket2898

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avfilter/ff_insert_pad: fix order of operations

Fixes out of bounds access
Fixes CID732170
Fixes CID732169

No filter is known to use this function in a way so the issue can be reproduced.

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

Conflicts:

	libavfilter/avfilter.c
avcodec/avpacket/av_packet_split_side_data: ensure that side data padding is initialized

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/utils: add some saftey checks to add_metadata_from_side_data()

This fixes potential overreads with crafted files.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avutil/opt: initialize ret

Fixes CID1108610
Fixes use of uninitialized variable

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/jpeglsdec: check err value for ls_get_code_runterm()

Fixes infinite loop
Fixes Ticket3086

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/thp: fix variable types to avoid overflows

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/thp: force moving forward

Fixes infinite loop
Fixes Ticket3098

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/jpeg2000dec: non zero image offsets are not supported

Fixes out of array accesses
Fixes Ticket3080
Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 780669ef7c23c00836a24921fcc6b03be2b8ca4a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
h264: Do not treat the initial frame special in handling of frame gaps

The not handling of frame gaps has lead to the lack of a dummy reference
frame, which has lead to the failure of decode_slice_header() which has
lead to one SEI recovery message being skiped which had introduced a
slightly suboptimal recovery point for at least 1 h264 file compared to
JM.

Found-by: Carl & BugMaster
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9e5ef1c5c37208326c59d642e2dc7afd3f10b09b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
mpegvideo: Fix swapping of UV planes for VCR2

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
mpeg12dec: Remove incomplete and wrong UV swapping code for VCR2

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avutil: rename lls to lls2

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
rename new lls code to lls2 to avoid conflict with the old which has a different ABI

also remove failed attempt at a compatibility layer, the code simply cannot work

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

Conflicts:

	libavcodec/version.h
avutil: reintroduce lls1 as the 52 ABI needs it

lls1 taken from ff130d7

This is incompatible with libavcodec version
55.18.100 to 55.43.100 except 55.39.101
This incompatibility is caused by these libavcodec versions depending on
a libavutil 52 which is ABI incompatible with the previous ABI 52

you can avoid this incompatibility by upgrading your libavcodec so it
does no longer depend on the invalid ABI

See: 502ab21af0ca68f76d6112722c46d2f35c004053
See: cc6714bb16b1f0716ba43701d47273dbe9657b8b
See: 41578f70cf8aec8e7565fba1ca7e07f3dc46c3d2
See: Ticket3136
Tested-by: marillat
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b382d09d29be90e0947295a70cdcbaa60b9030b8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec: move end zeroing code from av_packet_split_side_data() to avcodec_decode_subtitle2()

This code changes the input packet, which is read only and can in
rare circumstances lead to decoder errors. (i run into one of these in
the audio decoder, which corrupted the packet during av_find_stream_info()
so that actual decoding that single packet failed later)
Until a better fix is implemented, this commit limits the problem.
A better fix might be to make the subtitle decoders not depend on
data[size] = 0 or to copy their input when this is not the case.
(cherry picked from commit 01923bab98506b1e98b4cbf08419364ce6ffea6d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/jpeg2000dec: Check precno before using it in JPEG2000_PGOD_CPRL

Fixes out of array reads
Fixes: asan_heap-oob_f0de57_6823_mjp2.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3d5a5e86be2a65e33c34ab3ad7923f54e8e49c1d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>