lavf/avio: check for : in filenames for protocols.

If the first "special" character in a filename is a comma,
it can introduce protocol options, but only if there is a
colon at the end. Otherwise, it is just a filename with a
comma.

Fix trac ticket #2303.
(cherry picked from commit d9fad53f4b447db1e436dcf3fc4a57e604616e6c)
Require at least three frames to autodetect loas.
(cherry picked from commit a60530e3ee1d9532c026a52b03661f88e163d647)
sanm: add forgotten check for decoded_size in old_codec37()

Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
sanm: Use the correct height variable in the decoded_size checks

Fixes integer overflow and out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pngdec/filter: dont access out of array elements at the end

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tiff: Check buffer allocation and pointer increment more carefully in shorts2str() and double2str()

Fixes out of array accesses

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

Conflicts:

	libavcodec/tiff.c
shorten: dont leave invalid channel counts in the context.

Fixes freeing invalid addresses

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

Conflicts:

	libavcodec/shorten.c
swr: check channel layouts before using them.

Fixes out of array accesses

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

Conflicts:

	libswresample/swresample.c
avcodec_decode_audio4: check got_frame_ptr before handling initial skip

Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
h264: check that luma and chroma depth match

Fixes out of array access

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

Conflicts:

	libavcodec/h264_ps.c
rtmpproto: Check APP_MAX_LENGTH

Fixes Ticket2292

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

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

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

Fixes second part of Ticket2292

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

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

Fixes Ticket1733

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a12a618aa9c6d84ec3c01695fb5aec9796453a6d)
avformat: Fix apics with aac

Fixes Ticket2318

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cada996528422907b8b818e99029a8e3b97cf08d)
psymodel: dont apply lowpass filters with a cutoff close to the nyquist

The IIR filter numerically diverges in such cases, this could easily be
fixed but would make the filter slower on some platforms

Fixes Ticket2246

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fee5da6b0a79bed9dc849f216b6da1e03132b668)
aacsbr: Check for envelope scalefactors overflowing

This prevents various values from becoming stuck at NAN and
output to become silent
If someone knows a cleaner solution, thats welcome!

Fixes Ticket2335

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