ffmpeg.git
2 years agoChangelog: Update n2.8.8
Michael Niedermayer [Sat, 17 Sep 2016 23:18:35 +0000 (01:18 +0200)]
Changelog: Update

2 years agoavformat/movenc: Check packet in mov_write_single_packet() too
Michael Niedermayer [Thu, 15 Sep 2016 21:52:54 +0000 (23:52 +0200)]
avformat/movenc: Check packet in mov_write_single_packet() too

Fixes assertion failure

Found-by: durandal117
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 28343139330f557e00293933a4697c7d0fc19c56)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavformat/movenc: Factor check_pkt() out
Michael Niedermayer [Thu, 15 Sep 2016 21:52:42 +0000 (23:52 +0200)]
avformat/movenc: Factor check_pkt() out

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit deabcd2c05b2b01689d91394bbf3908da17234ed)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavformat/utils: fix timebase error in avformat_seek_file()
Xinzheng Zhang [Wed, 14 Sep 2016 08:13:45 +0000 (16:13 +0800)]
avformat/utils: fix timebase error in avformat_seek_file()

When there is only one stream and stream_index has not specified,
The ts has been transferd by the timebase of stream0 without modifying the stream_index
In this condation it cause seek failure.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ecc04b4f2f29ac676e6c1d1ebf20ec45f5385f1e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/g726: Add missing ADDB output mask
Michael Niedermayer [Wed, 14 Sep 2016 11:06:53 +0000 (13:06 +0200)]
avcodec/g726: Add missing ADDB output mask

Fixes: 1.poc
Fixes out of array read

Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a5af1240fce845f645440364c1335e0f8e44ee6c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/avpacket: clear side_data_elems
Michael Niedermayer [Mon, 12 Sep 2016 11:13:42 +0000 (13:13 +0200)]
avcodec/avpacket: clear side_data_elems

Fixes null pointer dereference

Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5e1bf9d8c0d2cdbbf17b06a5dfdf87a635b3203b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/ccaption_dec: Use simple array instead of AVBuffer
Michael Niedermayer [Fri, 9 Sep 2016 08:26:15 +0000 (10:26 +0200)]
avcodec/ccaption_dec: Use simple array instead of AVBuffer

This is simpler and fixes an out of array read, fixing it with AVBuffers
would be more complex

Fixes: e00d9e6e50e5495cc93fea41147b97bb/asan_heap-oob_12dcdbb_8798_b32a97ea722dd37bb5066812cc674552.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 752e6dfa3ea97e7901870bdd9e5a51f860607240)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoswscale/swscale_unscaled: Try to fix Rgb16ToPlanarRgb16Wrapper() with slices
Michael Niedermayer [Sat, 3 Sep 2016 10:15:24 +0000 (12:15 +0200)]
swscale/swscale_unscaled: Try to fix Rgb16ToPlanarRgb16Wrapper() with slices

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e57d99dd4e0d8fe2992da0d65b563580e35ce728)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoswscale/swscale_unscaled: Fix packed_16bpc_bswap() with slices
Michael Niedermayer [Fri, 2 Sep 2016 18:25:24 +0000 (20:25 +0200)]
swscale/swscale_unscaled: Fix packed_16bpc_bswap() with slices

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 47bc1bdafb0950ccf128eaa491d8fd7cc0978813)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavformat/avidec: Fix infinite loop in avi_read_nikon()
Michael Niedermayer [Fri, 2 Sep 2016 10:19:29 +0000 (12:19 +0200)]
avformat/avidec: Fix infinite loop in avi_read_nikon()

Fixes: 360/test.poc

Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e4e4a9cad7f21593d4bcb1f2404ea0d373c36c43)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agocmdutils: fix implicit declaration of SetDllDirectory function
Tobias Rapp [Mon, 29 Aug 2016 13:25:58 +0000 (15:25 +0200)]
cmdutils: fix implicit declaration of SetDllDirectory function

Pre-processor check changed by commiter.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agocmdutils: check for SetDllDirectory() availability
James Almer [Mon, 22 Aug 2016 22:24:31 +0000 (19:24 -0300)]
cmdutils: check for SetDllDirectory() availability

It's only available on Windows XP or newer.

Should fix compilation with mingw32 using the default OS target.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/aacenc: Tighter input checks
Michael Niedermayer [Tue, 23 Aug 2016 09:00:29 +0000 (11:00 +0200)]
avcodec/aacenc: Tighter input checks

Fixes occurance of NaN/Inf leading to assertion failures and out of array access
Fixes: d1c38a09acc34845c6be3a127a5aacaf/signal_sigsegv_3982225_6121_d18bd5451d4245ee09408f04badd1b83.wmv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 77bf96b04710b98a52aaddb93bfd32da0d506191)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agolibavcodec/wmalosslessdec: Check the remaining bits
Michael Niedermayer [Sun, 21 Aug 2016 18:30:34 +0000 (20:30 +0200)]
libavcodec/wmalosslessdec: Check the remaining bits

Fixes assertion failure
Fixes: 24ebfda03228b5cc1ef792608cfba458/signal_sigabrt_7ffff6ae7c37_6473_3fa8a111dbc752b1a7c411c5ab79aaa4.wma

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 67318187fbba382d887f9581dde48a50842f1bea)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/diracdec: Check numx/y
Michael Niedermayer [Sat, 20 Aug 2016 17:21:07 +0000 (19:21 +0200)]
avcodec/diracdec: Check numx/y

Fixes division by 0
Fixes: 60261c4469ba3e11059890fb2832a515/asan_generic_135e694_2790_beb94eaa0aeb7d11c0437375a8964a99.drc

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a31e08fa1aa5c5f0518b8af850f28eb945268e66)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/indeo2: check ctab
Michael Niedermayer [Fri, 19 Aug 2016 11:07:14 +0000 (13:07 +0200)]
avcodec/indeo2: check ctab

Fixes out of array access
Fixes: 6b73fa392ac808f02e95a4e0a5770026/asan_static-oob_1b15f9a_1969_e7778535e5f27225fe0d6ded14721430.AVI

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9ffe44c5c75c485b4cbb12751e228f18da219df3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/swfdec: Fix inflate() error code check
Michael Niedermayer [Fri, 19 Aug 2016 08:28:22 +0000 (10:28 +0200)]
avformat/swfdec: Fix inflate() error code check

Fixes infinite loop
Fixes endless.poc

Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a453bbb68f3eec202673728988bba3bc76071761)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoUpdate for FFmpeg 2.8.8
Michael Niedermayer [Mon, 15 Aug 2016 20:26:37 +0000 (22:26 +0200)]
Update for FFmpeg 2.8.8

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/h264: Put context_count check back
Michael Niedermayer [Wed, 8 Jun 2016 10:32:57 +0000 (12:32 +0200)]
avcodec/h264: Put context_count check back

Fixes assertion failure

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f883f0b0bd0dac76b58e49f5c75cf9b497eecaa0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agocmdutils: remove the current working directory from the DLL search path on win32
Hendrik Leppkes [Mon, 8 Aug 2016 13:27:41 +0000 (15:27 +0200)]
cmdutils: remove the current working directory from the DLL search path on win32

Reviewed-by: Matt Oliver <protogonoi@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3bf142c77337814458ed8e036796934032d9837f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/raw: Fix decoding of ilacetest.mov
Michael Niedermayer [Sun, 7 Aug 2016 14:27:31 +0000 (16:27 +0200)]
avcodec/raw: Fix decoding of ilacetest.mov

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bbec14de3126dbc4e1ec2b32ed714dab173386aa)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/ffv1enc: Fix assertion failure with non zero bits per sample
Michael Niedermayer [Fri, 5 Aug 2016 23:53:30 +0000 (01:53 +0200)]
avcodec/ffv1enc: Fix assertion failure with non zero bits per sample

Fixes Ticket5736
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c1bfeda5a34631787e07702f7a3569a41751caeb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/oggdec: Fix integer overflow with invalid pts
Michael Niedermayer [Wed, 3 Aug 2016 11:34:40 +0000 (13:34 +0200)]
avformat/oggdec: Fix integer overflow with invalid pts

If negative pts are possible for some codecs in ogg then the code needs to be
changed to use signed values.

Found-by: Thomas Guilbert <tguilbert@google.com>
Fixes: clusterfuzz_usan-2016-08-02
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c5cc3b08e56fc95665977544486bd9f06e4b7a72)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoffplay: Fix invalid array index
Michael Niedermayer [Wed, 3 Aug 2016 11:15:14 +0000 (13:15 +0200)]
ffplay: Fix invalid array index

Found-by: Thomas Guilbert <tguilbert@google.com>
Fixes: clusterfuzz_usan-2016-08-02
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6cd9a8b67a95a136ea15bfe3c3bab6cf5e6d1cc9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/vp9_parser: Check the input frame sizes for being consistent
Michael Niedermayer [Mon, 1 Aug 2016 11:50:21 +0000 (13:50 +0200)]
avcodec/vp9_parser: Check the input frame sizes for being consistent

Suggested-by: BBB
Fixed-by: BBB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 77b0f3f26d33d4f46f274896e0583ad1f5936b7c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agolibavformat/rtpdec_asf: zero initialize the AVIOContext struct
Kacper Michajłow [Sat, 23 Jul 2016 21:47:39 +0000 (23:47 +0200)]
libavformat/rtpdec_asf: zero initialize the AVIOContext struct

This fixes crash in avformat_open_input() when accessing
protocol_whitelist field.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e947b75b1c76ef6793209c2c445b8c224a28717a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agolibavutil/opt: Small bugfix in example.
Kacper Michajłow [Sat, 23 Jul 2016 19:43:06 +0000 (21:43 +0200)]
libavutil/opt: Small bugfix in example.

Fix const corectness and zero init the struct. This example code would actually crash when initializing string.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 69630f4d304a4e35d90957d6a170744af87cbf93)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agolibx264: Increase x264 opts character limit to 4096
Sasi Inguva [Fri, 22 Jul 2016 01:52:41 +0000 (18:52 -0700)]
libx264: Increase x264 opts character limit to 4096

Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 282477bf4534439ecb06f14d46446a4f1ab82284)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/mov: Check sample size
Michael Niedermayer [Tue, 28 Jun 2016 21:49:36 +0000 (23:49 +0200)]
avformat/mov: Check sample size

Fixes integer overflow
Fixes: poc.mp4

Found-by: ajax secure <ajax4sec@hotmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8a3221cc67a516dfc1700bdae3566ec52c7ee823)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/format: Fix registering a format more than once and related races
Michael Niedermayer [Thu, 7 Apr 2016 15:26:56 +0000 (17:26 +0200)]
avformat/format: Fix registering a format more than once and related races

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4cc896ea5f06f8b1ebcde6d876d9c5b59ef9a016)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/flac_parser: Raise threshold for detecting invalid data
Michael Niedermayer [Wed, 22 Jun 2016 18:19:40 +0000 (20:19 +0200)]
avcodec/flac_parser: Raise threshold for detecting invalid data

Fixes regression from Ticket5428

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b0b3676e136a09a13767859f429a0aa416d929cd)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavfilter/vf_telecine: Make frame writable before writing into it
Michael Niedermayer [Tue, 14 Jun 2016 15:13:51 +0000 (17:13 +0200)]
avfilter/vf_telecine: Make frame writable before writing into it

Fixes Ticket 5627

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fa0097e008a145ea8324879d4e24c1881bb86279)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mpc8: Correct end truncation
Michael Niedermayer [Sat, 11 Jun 2016 12:28:24 +0000 (14:28 +0200)]
avcodec/mpc8: Correct end truncation

Fixes Ticket5478

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b21f674876badefc68e4deecdb4a1d46de10b67c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mpegvideo: Do not clear the parse context during init
Michael Niedermayer [Fri, 10 Jun 2016 13:38:26 +0000 (15:38 +0200)]
avcodec/mpegvideo: Do not clear the parse context during init

It is allocated before, this cannot work
Fixes Ticket5613

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 24f513619680b5bef40b02db6ca07a8a009c2ece)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoMAINTAINERs cleanup (remove myself from things i de facto dont maintain)
Michael Niedermayer [Fri, 10 Jun 2016 07:59:21 +0000 (09:59 +0200)]
MAINTAINERs cleanup (remove myself from things i de facto dont maintain)

x86 is maintained entirely by others these days
ML, mostly too

remove myself from a few spots that have other maintainers and where i
just dont know the code that well anyway to do an ideal job

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bb5bc08ba6f88af2a4a2e00ea03261b142f79f8f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/h264: Fix off by 1 context count
Michael Niedermayer [Tue, 7 Jun 2016 20:17:38 +0000 (22:17 +0200)]
avcodec/h264: Fix off by 1 context count

Fixes fate-h264-xavc-4389 with slice threads
(cherry picked from commit 27c1eae55f24e9ed005a6634cd4ddd867118fa48)

Conflicts:

libavcodec/h264.c

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/alsdec: Check r to prevent out of array read
Michael Niedermayer [Tue, 7 Jun 2016 18:50:38 +0000 (20:50 +0200)]
avcodec/alsdec: Check r to prevent out of array read

No testcase known

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c36fc857b5a8f8bdf2bcc54ce72bbf817902edcf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/alsdec: fix max bits in ltp prefix code
Umair Khan [Fri, 11 Mar 2016 21:04:30 +0000 (02:34 +0530)]
avcodec/alsdec: fix max bits in ltp prefix code

The maximum number of bits int the prefix code for
p(0) is 4. By setting it as 3, we were missing the
last 0 bit.
This fixes bug #4715 present on the trac.

Signed-off-by: Umair Khan <omerjerk@gmail.com>
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5d64ba9d18294a305f4f46c9a64e592dc5d34aa9)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/utils: check skip_samples signedness
Michael Niedermayer [Tue, 7 Jun 2016 01:48:09 +0000 (03:48 +0200)]
avcodec/utils: check skip_samples signedness

Fixes Ticket5528

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 153ab83bd37cbbcc79d8303cc6efbf81089b8123)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/mpegts: Do not trust BSSD descriptor, it is sometimes not an S302M stream
Michael Niedermayer [Mon, 6 Jun 2016 19:43:01 +0000 (21:43 +0200)]
avformat/mpegts: Do not trust BSSD descriptor, it is sometimes not an S302M stream

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a5eb70ad9569c62158b4b2d18f2143db791f7d27)

Conflicts:

libavformat/mpegts.c

3 years agoavcodec/bmp_parser: Check fsize
Michael Niedermayer [Mon, 6 Jun 2016 12:32:48 +0000 (14:32 +0200)]
avcodec/bmp_parser: Check fsize

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 43a4276c6964a2ec57e08c3c622bb94d35c0441f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/bmp_parser: reset state
Michael Niedermayer [Mon, 6 Jun 2016 12:30:40 +0000 (14:30 +0200)]
avcodec/bmp_parser: reset state

Fixes part of ticket 5598

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 37005e65eb17b1480d9e1755eeba3f50ee3b9555)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/bmp_parser: Fix remaining size
Michael Niedermayer [Mon, 6 Jun 2016 12:27:20 +0000 (14:27 +0200)]
avcodec/bmp_parser: Fix remaining size

Fixes part of ticket 5598

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 250b620d296adba7bd3a3104a9c30e820fb0bc36)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/bmp_parser: Fix frame_start_found in cross frame cases
Michael Niedermayer [Mon, 6 Jun 2016 12:01:43 +0000 (14:01 +0200)]
avcodec/bmp_parser: Fix frame_start_found in cross frame cases

Fixes part of ticket 5598

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bfe945ac3a0c328371dc4b4cc3409b7da5784cb8)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavfilter/af_amix: dont fail if there are no samples in output_frame()
Michael Niedermayer [Thu, 28 Apr 2016 18:49:13 +0000 (20:49 +0200)]
avfilter/af_amix: dont fail if there are no samples in output_frame()

Fixes Ticket5326

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit abc957e896beb3ce33c5691b9b3701993a381852)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/allformats: Making av_register_all() thread-safe.
Vivekanand [Thu, 7 Apr 2016 10:46:23 +0000 (16:16 +0530)]
avformat/allformats: Making av_register_all() thread-safe.

When multiple threads tries to call av_register_all(), the first thread sets
initialized to 1 and do the register process. At the same time, other thread might
also call av_register_all(), which returns immediately because initialized is set to 1
(even when it has not completed registering codecs). We can avoid this problem
if we set initialised to 1 while exiting from function.

Github: Closes #196
(cherry picked from commit b092ee701f4d0ef2b8a4171cd38101d1ee9a1034)

Conflicts:

libavformat/allformats.c

3 years agoavcodec/mpegvideo: Deallocate last/next picture earlier
Michael Niedermayer [Sat, 4 Jun 2016 23:46:18 +0000 (01:46 +0200)]
avcodec/mpegvideo: Deallocate last/next picture earlier

Fixes regression with mplayers direct rendering and reduces buffer count
pressure in some cases

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 39c0b22df42088cf4fb1ceb2447291c224a5c7ed)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/bmp_parser: Fix state
Michael Niedermayer [Tue, 31 May 2016 20:01:13 +0000 (22:01 +0200)]
avcodec/bmp_parser: Fix state

Fixes Ticket5598

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d0388bd32e1c84a9ef87ba6c448c7fffb6a9f259)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/oggparseopus: Fix Undefined behavior in oggparseopus.c and libavformat/utils.c
Thomas Guilbert [Fri, 27 May 2016 22:50:25 +0000 (15:50 -0700)]
avformat/oggparseopus: Fix Undefined behavior in oggparseopus.c and libavformat/utils.c

Fixes: usan_granule_overflow

constant type fix by commiter
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1a82d2cf8fb6a7e854e7548dfcf73c3d046b34ac)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agodoc/developer.texi: Add a code of conduct
Michael Niedermayer [Wed, 18 May 2016 18:40:08 +0000 (20:40 +0200)]
doc/developer.texi: Add a code of conduct

See: [FFmpeg-devel] [Vote] Code of Conduct

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 89e9393022373bf97d528e6e9f2601ad0b3d0fc1)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/avidec: Detect index with too short entries
Michael Niedermayer [Wed, 18 May 2016 21:27:54 +0000 (23:27 +0200)]
avformat/avidec: Detect index with too short entries

Fixes Ticket5498

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d08f2c172fd2baab022f0118f49e5b2852a2d463)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/utils: Check negative bps before shifting in ff_get_pcm_codec_id()
Chris Cunningham [Tue, 17 May 2016 18:28:32 +0000 (11:28 -0700)]
avformat/utils: Check negative bps before shifting in ff_get_pcm_codec_id()

Fixes: undefined shift.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2875745d354ab0ebc4af1ebaca5c5a8d26ccdc03)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/utils: Do not compute the bitrate from duration == 0
Michael Niedermayer [Mon, 16 May 2016 11:43:02 +0000 (13:43 +0200)]
avformat/utils: Do not compute the bitrate from duration == 0

Fixes division by 0 in fate-acodec-ra144

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 635b2ec5f20d6cdef1adf4907ca28f8f09abcecc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoffmpeg: Check that r_frame_rate is set before attempting to use it
Michael Niedermayer [Mon, 16 May 2016 10:49:06 +0000 (12:49 +0200)]
ffmpeg: Check that r_frame_rate is set before attempting to use it

Avoids unexpected occurance and dependency on NaN behavior and divisions by 0

Testcase: fate-lavf-fate-avi_cram

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6085d6b2aeef28671614f625601a23cfc922d282)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoswresample/rematrix: Use clipping s16 rematrixing if overflows are possible
Michael Niedermayer [Sun, 15 May 2016 19:34:37 +0000 (21:34 +0200)]
swresample/rematrix: Use clipping s16 rematrixing if overflows are possible

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2f76157eb05bf63725f96167feda6b2e07501c7e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoswresample/rematrix: Use error diffusion to avoid error in the DC component of the...
Michael Niedermayer [Sun, 15 May 2016 16:33:09 +0000 (18:33 +0200)]
swresample/rematrix: Use error diffusion to avoid error in the DC component of the matrix

This fixes the sum of the integer coefficients ending up summing to a value
larger than the value representing unity.

This issue occurs with qN0.dts when converting to stereo

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7fe81bc4f8ba684626fa08f7bef46da3e8abe373)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agolibavformat/oggdec: Free stream private when header parsing fails.
Chris Cunningham [Mon, 9 May 2016 22:27:29 +0000 (15:27 -0700)]
libavformat/oggdec: Free stream private when header parsing fails.

Leaking this private structure opens up the possibility that it may
be re-used when parsing later packets in the stream. This is
problematic if the later packets are not the same codec type (e.g.
private allocated during Vorbis parsing, but later packets are Opus
and the private is assumed to be the oggopus_private type in
opus_header()).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 542f725964e52201000ec34e2f23229cf534ad3a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/utils: Check bps before using it in a shift in ff_get_pcm_codec_id()
Michael Niedermayer [Tue, 10 May 2016 22:00:52 +0000 (00:00 +0200)]
avformat/utils: Check bps before using it in a shift in ff_get_pcm_codec_id()

Fixes undefined shift
Fixes: usan_shift

Found-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ea791c080dd5494b3bee0c618a3f52e371b5f320)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/oggparseopus: Check that granule pos is within the supported range
Michael Niedermayer [Tue, 10 May 2016 21:12:58 +0000 (23:12 +0200)]
avformat/oggparseopus: Check that granule pos is within the supported range

Larger values would imply file durations of astronomic proportions and cause
overflows

Fixes integer overflow
Fixes: usan_int64_overflow

Found-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8efaee3710baa87af40556a622bf2d96a27c6425)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mjpegdec: Do not try to detect last scan but apply idct after all scans for...
Michael Niedermayer [Mon, 2 May 2016 10:45:14 +0000 (12:45 +0200)]
avcodec/mjpegdec: Do not try to detect last scan but apply idct after all scans for progressive jpeg

Fixes: IMG-20160418-WA0002.jpg

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit deaf58abf236e09fc9b97db29f1edd064e4b5ad4)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/options_table: Add missing identifier for very strict compliance
Michael Niedermayer [Mon, 2 May 2016 20:00:55 +0000 (22:00 +0200)]
avformat/options_table: Add missing identifier for very strict compliance

Fixes Ticket5443

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 11db7eee9b001d6992c34b65ee7b0d64f6f5c758)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agolibrtmp: Avoid an infiniloop setting connection arguments
Luca Barbato [Wed, 22 Jun 2016 04:36:31 +0000 (06:36 +0200)]
librtmp: Avoid an infiniloop setting connection arguments

The exit condition was missing.

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
(cherry picked from commit e85d38c20a8893cb59d7c86f74481f2497882196)
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
3 years agoavformat/oggparsevp8: fix pts calculation on pages ending with an invisible frame
James Almer [Tue, 12 Jul 2016 20:05:42 +0000 (17:05 -0300)]
avformat/oggparsevp8: fix pts calculation on pages ending with an invisible frame

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 5adfbd391847fcdaea1e9b105fae2dd90af2a733)

3 years agoChangelog: update n2.8.7
Michael Niedermayer [Fri, 29 Apr 2016 11:27:40 +0000 (13:27 +0200)]
Changelog: update

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/motion_est: Attempt to fix "short data segment overflowed" on IA64
Michael Niedermayer [Fri, 15 Jan 2016 22:58:51 +0000 (23:58 +0100)]
avcodec/motion_est: Attempt to fix "short data segment overflowed" on IA64

This decreases the MV related encoding table sizes
This should have little effect on real world video encoding performance

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d7c75a5db0cf3674e1a5c3e51ac024ef2ef6f09f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/ffmdec: Check pix_fmt
Michael Niedermayer [Thu, 28 Apr 2016 20:50:48 +0000 (22:50 +0200)]
avformat/ffmdec: Check pix_fmt

Fixes crash
Fixes Ticket5412

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 78baa450d9939957f52d5187beb95d763d2f1f18)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoupdate for 2.8.7
Michael Niedermayer [Wed, 27 Apr 2016 03:43:39 +0000 (05:43 +0200)]
update for 2.8.7

3 years agoavcodec/ttaenc: Reallocate packet if its too small
Michael Niedermayer [Tue, 26 Apr 2016 17:17:19 +0000 (19:17 +0200)]
avcodec/ttaenc: Reallocate packet if its too small

Fixes assertion failure
Fixes Ticket5394

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 005c61c6b8982f977e415aa69d2d2b42e6b7f3f2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agopgssubdec: fix subpicture output colorspace and range
Jan Ekström [Sun, 24 Apr 2016 14:30:56 +0000 (17:30 +0300)]
pgssubdec: fix subpicture output colorspace and range

Functionality used before didn't widen the values from limited to
full range. Additionally, now the decoder uses BT.709 where it
should be used according to the video resolution.

Default for not yet set colorimetry is BT.709 due to most observed
HDMV content being HD.

BT.709 coefficients were gathered from the first two parts of BT.709
to BT.2020 conversion guide in ARIB STD-B62 (Pt. 1, Chapter 6.2.2).
They were additionally confirmed by manually calculating values.

Fixes #4637
(cherry picked from commit 9779b6262471d553c1ed811ff7312564e39d8adf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/ac3dec: Reset SPX when switching from EAC3 to AC3
Michael Niedermayer [Mon, 25 Apr 2016 02:08:21 +0000 (04:08 +0200)]
avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3

Fixes Ticket5319

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9ac154d1facd4756db6918f866dccf3e3ffb698c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavfilter/vf_drawtext: Check return code of load_glyph()
Michael Niedermayer [Sun, 24 Apr 2016 10:30:20 +0000 (12:30 +0200)]
avfilter/vf_drawtext: Check return code of load_glyph()

Fixes segfault
Fixes Ticket5347

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2e67a99fbc6b99315925de40fc6fa7161576be10)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/takdec: add code that got somehow lost in process of REing
Paul B Mahol [Wed, 20 Apr 2016 20:45:05 +0000 (22:45 +0200)]
avcodec/takdec: add code that got somehow lost in process of REing

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 38797a8033d061ade58b30b8ac86da222fe42a84)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/apedec: fix decoding of stereo files with one channel full of silence
Paul B Mahol [Tue, 12 Apr 2016 08:51:30 +0000 (10:51 +0200)]
avcodec/apedec: fix decoding of stereo files with one channel full of silence

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 9149e9c0baaec122bc3da925d6068dffa60b5427)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/avpacket: Fix off by 5 error
Michael Niedermayer [Wed, 20 Apr 2016 20:38:26 +0000 (22:38 +0200)]
avcodec/avpacket: Fix off by 5 error

Fixes out of array read
Fixes: mozilla bug 1266129
Found-by: Tyson Smith
Tested-by: Tyson Smith
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9f36ea57ae6eefb42432220feab0350494f4144c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/h264: Fix for H.264 configuration parsing
Ivan [Tue, 12 Apr 2016 20:32:04 +0000 (16:32 -0400)]
avcodec/h264: Fix for H.264 configuration parsing

Sometimes video fails to decode if H.264 configuration changes mid stream.
The reason is that configuration parser assumes that nal_ref_idc is equal to 11b
while actually some codecs but 01b there. The H.264 spec is somewhat
vague about this but it looks like it allows any non-zero nal_ref_idc for sps/pps.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3a727606c474d3d0b9efa3c900294a84bdb5e331)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/bmp_parser: Ensure remaining_size is not too small in startcode packet crossi...
Michael Niedermayer [Thu, 14 Apr 2016 13:10:31 +0000 (15:10 +0200)]
avcodec/bmp_parser: Ensure remaining_size is not too small in startcode packet crossing corner case

Fixes Ticket 5438

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8e26bdd59bf559d00c7e60c53fff292de10139ff)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavfilter/src_movie: fix how we check for overflows with seek_point
Marios Titas [Sat, 2 Apr 2016 18:11:44 +0000 (21:11 +0300)]
avfilter/src_movie: fix how we check for overflows with seek_point

Currently, if the movie source filter is used and a seek_point is
specified on a file that has a negative start time, ffmpeg will fail.

An easy way to reproduce this is as follows:
$ ffmpeg -vsync passthrough -filter_complex 'color=d=10,setpts=PTS-1/TB' test.mp4
$ ffmpeg -filter_complex 'movie=filename=test.mp4:seek_point=2' -f null -

The problem is caused by checking for int64_t overflow the wrong way.
In general, to check whether a + b overflows, it is not enough to do:
    a > INT64_MAX - b
because b might be negative; the correct way is:
    b > 0 && > a > INT64_MAX - b

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c1f9734f977f59bc0034096afbe8e43e40d93a5d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/j2kenc: Add attribution to OpenJPEG project:
Aaron Boxer [Thu, 31 Mar 2016 20:02:14 +0000 (16:02 -0400)]
avcodec/j2kenc: Add attribution to OpenJPEG project:

http://ghostscript.com/~tor/gs-browse/gs/openjpeg/libopenjpeg/t1.c

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b6b4b0a65e02495edf9d7e5b23bef99a92921147)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/h264_slice: Check PPS more extensively when its not copied
Michael Niedermayer [Fri, 25 Mar 2016 14:29:26 +0000 (15:29 +0100)]
avcodec/h264_slice: Check PPS more extensively when its not copied

Fixes Ticket5371
Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c50be7a52bc1e8e18a0059e489743ec12a43f257)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames...
Michael Niedermayer [Thu, 24 Mar 2016 19:55:30 +0000 (20:55 +0100)]
avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set

Reviewed-by: maintainer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0cd9ff4e3aa23318a855c21d60b1c9035b2b99d2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/rtpdec_jpeg: fix low contrast image on low quality setting
Ico Doornekamp [Thu, 24 Mar 2016 13:31:38 +0000 (14:31 +0100)]
avformat/rtpdec_jpeg: fix low contrast image on low quality setting

Original mail and my own followup on ffmpeg-user earlier today:

I have a device sending out a MJPEG/RTP stream on a low quality setting.
Decoding and displaying the video with libavformat results in a washed
out, low contrast, greyish image. Playing the same stream with VLC results
in proper color representation.

Screenshots for comparison:

  http://zevv.nl/div/libav/shot-ffplay.jpg
  http://zevv.nl/div/libav/shot-vlc.jpg

A pcap capture of a few seconds of video and SDP file for playing the
stream are available at

  http://zevv.nl/div/libav/mjpeg.pcap
  http://zevv.nl/div/libav/mjpeg.sdp

I believe the problem might be in the calculation of the quantization
tables in the function create_default_qtables(), the attached patch
solves the issue for me.

The problem is that the argument 'q' is of the type uint8_t. According to the
JPEG standard, if 1 <= q <= 50, the scale factor 'S' should be 5000 / Q.
Because the create_default_qtables() reuses the variable 'q' to store the
result of this calculation, for small values of q < 19, q wil subsequently
overflow and give wrong results in the calculated quantization tables. The
patch below uses a new variable 'S' (same name as in RFC2435) with the proper
range to store the result of the division.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e3e6a2cff4af9542455d416faec4584d5e823d5d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mjpegenc_common: Store approximate aspect if exact cannot be stored
Michael Niedermayer [Sat, 19 Mar 2016 14:41:30 +0000 (15:41 +0100)]
avcodec/mjpegenc_common: Store approximate aspect if exact cannot be stored

Fixes Ticket5244

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 068026b0f7845e0f1850094d974f60d181480d64)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agolavc/hevc: Allow arbitrary garbage in bytestream as long as at least one NAL unit...
Mark Thompson [Thu, 17 Mar 2016 13:41:02 +0000 (13:41 +0000)]
lavc/hevc: Allow arbitrary garbage in bytestream as long as at least one NAL unit is found.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fbec157ea08f61063847bbe0dba28525e6283ff5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/resample: Remove disabled and faulty code
Michael Niedermayer [Wed, 16 Mar 2016 18:40:32 +0000 (19:40 +0100)]
avcodec/resample: Remove disabled and faulty code

Fixes Ticket5345

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 50ef7361cb5f78c94da2323f3bae86c6bbd618c8)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoindeo2: Fix banding artefacts
Luca Barbato [Tue, 23 Feb 2016 00:58:19 +0000 (19:58 -0500)]
indeo2: Fix banding artefacts

Rename luma table to delta table and change how it is used.

CC: libav-stable@libav.org
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit f8c34f4b8d62afad3f63cf3d9617d73735bef8c1)
(cherry picked from commit 73f3c8f73edf0a69502233b2c50fa9e7104f99ec)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoindeo2data: K&R formatting cosmetics
Luca Barbato [Tue, 23 Feb 2016 00:58:18 +0000 (19:58 -0500)]
indeo2data: K&R formatting cosmetics

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit d4066a702407352a0648af882c34ea81a404fa2b)
(cherry picked from commit 522ab0b9a92962edda7156a91a494a1e2b8a7f64)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/imgconvert: Support non-planar colorspaces while padding
Przemysław Sobala [Fri, 18 Sep 2015 13:40:58 +0000 (15:40 +0200)]
avcodec/imgconvert: Support non-planar colorspaces while padding

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0d097a869c38850c9ac09bccef60a229470f489b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavutil/random_seed: Add the runtime in cycles of the main loop to the entropy pool
Michael Niedermayer [Wed, 9 Dec 2015 14:18:53 +0000 (15:18 +0100)]
avutil/random_seed: Add the runtime in cycles of the main loop to the entropy pool

This should theoretically improve the randomness slightly

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2540d884f3fd7cfac503e048112098967be2569a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavutil/channel_layout: AV_CH_LAYOUT_6POINT1_BACK not reachable in parsing
Martin Cracauer [Tue, 1 Dec 2015 22:59:36 +0000 (17:59 -0500)]
avutil/channel_layout: AV_CH_LAYOUT_6POINT1_BACK not reachable in parsing

Trying to make heads and tails out of DTS 6.1 I can across this typo.

I also noticed that this wiki page is incorrect or misleading, the
channel order for 6.1 given does not match the source code.  At the
least it should be clarified that the layout given does not apply to
DTS.  https://trac.ffmpeg.org/wiki/AudioChannelManipulation

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 73d1398f0c4ce2de16790f46e05a79242137d153)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/concatdec: set safe mode to enabled instead of auto
Michael Niedermayer [Tue, 19 Jan 2016 21:13:14 +0000 (22:13 +0100)]
avformat/concatdec: set safe mode to enabled instead of auto

This is safer, as a selected demuxer could still mean that it was auto-detected
by a user application

Reviewed-previously-by: Nicolas George <george@nsup.org>
Reviewed-previously-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 689211d5727231c3fe92762d224dbadebdbf4e30)

Conflicts:

libavformat/concatdec.c

3 years agoavformat/utils: fix dts from pts code in compute_pkt_fields() during ascending delay
Michael Niedermayer [Tue, 8 Mar 2016 01:42:10 +0000 (02:42 +0100)]
avformat/utils: fix dts from pts code in compute_pkt_fields() during ascending delay

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit de1de4932419d0fb49c9c23f62e68cdbe90d0ee3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMAT
Boris Nagels [Sun, 6 Mar 2016 15:31:36 +0000 (16:31 +0100)]
avformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMAT

RTCP synchronization packet was broken since commit in ffmpeg version > 2.8.3
(commit: e04b039b1528f4c7df5c2b93865651bfea168a19) Since this commit (2e814d0329aded98c811d0502839618f08642685)
"rtpenc: Simplify code by introducing a macro for rescaling NTP timestamps", NTP_TO_RTP_FORMAT
uses av_rescale_rnd() function to add the data to the packet.

This causes an overflow in the av_rescale_rnd() function and it will return INT64_MIN.
Causing the NTP stamp in the RTCP packet to have an invalid value.

Github: Closes #182

Reverting commit '2e814d0329aded98c811d0502839618f08642685' solves the problem.
(cherry picked from commit 1109ed7973c7fd1e7001898adc4976590d862122)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/cache: Fix memleak of tree entries
Michael Niedermayer [Wed, 2 Mar 2016 13:09:23 +0000 (14:09 +0100)]
avformat/cache: Fix memleak of tree entries

Found-by: jamrial
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 554f6e930ce05a4c5449efcaae36bdafe2d9de74)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agolavf/mov: downgrade sidx errors to non-fatal warnings; fixes trac #5216
Rodger Combs [Tue, 23 Feb 2016 00:34:01 +0000 (18:34 -0600)]
lavf/mov: downgrade sidx errors to non-fatal warnings; fixes trac #5216
(cherry picked from commit 22dbc1caaf13e4bb17c9e0164a5b1ccaf490e428)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agolavf/mov: fix sidx with edit lists
Rodger Combs [Thu, 18 Feb 2016 18:57:37 +0000 (12:57 -0600)]
lavf/mov: fix sidx with edit lists
(cherry picked from commit 3617e69d50dd9dd07b5011dfb9477a9d1a630354)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mjpegdec: Fix decoding slightly odd progressive jpeg
Michael Niedermayer [Sun, 28 Feb 2016 17:10:23 +0000 (18:10 +0100)]
avcodec/mjpegdec: Fix decoding slightly odd progressive jpeg

Fixes: ebd58db6-dc86-11e5-91c2-59daeddf50c7.jpg

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c6f4720b8664e6e22eb5b3da6bb48ed5b113f746)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agolibwebpenc_animencoder: print library messages in verbose log levels
James Almer [Thu, 17 Mar 2016 04:01:02 +0000 (01:01 -0300)]
libwebpenc_animencoder: print library messages in verbose log levels

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit f875ba48739f59691661393eed1f7cc2371c93f1)

3 years agolibwebpenc_animencoder: zero initialize the WebPAnimEncoderOptions struct
James Almer [Thu, 17 Mar 2016 03:50:08 +0000 (00:50 -0300)]
libwebpenc_animencoder: zero initialize the WebPAnimEncoderOptions struct

This zeroes the WebPAnimEncoderOptions.verbose field, silencing library info messages
printed to stderr.

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 626b6b769ced6d3e55d2661985ab2a1cb89f481e)

3 years agodoc/utils: fix typo for min() description
Paul B Mahol [Wed, 2 Mar 2016 10:20:07 +0000 (11:20 +0100)]
doc/utils: fix typo for min() description

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit bdf474bcff29f5b40fe14f6fa1dbe10e69c73ab7)
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
3 years agoavcodec/avpacket: clear priv in av_init_packet()
Michael Niedermayer [Wed, 24 Feb 2016 14:48:28 +0000 (15:48 +0100)]
avcodec/avpacket: clear priv in av_init_packet()

This should fix leaving uninitialized pointers in priv which can confuse
user applications.
See: https://github.com/golang/go/issues/14426

Only for release branches

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>