avcodec/bink: fix seeking to frame 0

Fixes Ticket3088

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb52d6da0a9c88c584a38a9a7a94825565854b7e)
avformat/http: fix cookies

Fixes Ticket3096

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b73900b8a6c0a23e63e84a5eed0a5b9b3ffe1198)
lavf/spdifdec: fix demuxing of AAC in IEC 61937

Return value of avpriv_aac_parse_header() is not checked correctly. Fix
it.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f86387b6c2b11650cb9d5a8fd886be76e48c665b)

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/cabac: support UNCHECKED_BITSTREAM_READER = 0

Fixes overreads in HEVC
Fixes Ticket3070
Also fixed remaining issues from Ticket3075 and Ticket3076

Some lines of code taken from  0c5f839693da2276c2da23400f67a67be4ea0af1:libavcodec/x86/cabac.h
and                            0c5f839693da2276c2da23400f67a67be4ea0af1:libavcodec/cabac_functions.h

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/utils: never decrease has_b_frames in compute_pkt_fields()

The intent of the original check was to increase has_b_frames when
it was incorrectly set to 0. Later codecs allowed larger values

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/ffv1enc: Check high bpp RGB against coder type too

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>
ffmpeg: Do not fill gap before the first decodable frame on single stream input files unless the user explicitly requests it.

Fixes different behavior to JM and probably several if not all
reference decoders.

We cannot just do this unconditionally as it would ruin AV sync in
some use cases.

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

Conflicts:

	ffmpeg.c
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>