ffmpeg.git
2 years agoChangelog: update n3.0.3
Michael Niedermayer [Sun, 4 Sep 2016 23:29:52 +0000 (01:29 +0200)]
Changelog: update

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 agoavformat/utils: End probing if the expected codec surpasses AVPROBE_SCORE_STREAM_RETRY
Michael Niedermayer [Fri, 26 Aug 2016 23:12:49 +0000 (01:12 +0200)]
avformat/utils: End probing if the expected codec surpasses AVPROBE_SCORE_STREAM_RETRY

Fixes Ticket5800

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c75273310cf1becffee79bab0e2bba0b1606afb7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
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 agoavformat/wtvdec: Check pointer before use
Michael Niedermayer [Sun, 21 Aug 2016 19:30:36 +0000 (21:30 +0200)]
avformat/wtvdec: Check pointer before use

Fixes out of array read
Fixes: 049fdf78565f1ce5665df236d90f8657/asan_heap-oob_10a5a97_1026_42f9d4855547329560f385768de2f3fb.wtv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cc5e5548df4af48674c7aef518e831b19e99f9fc)
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>
2 years agoavcodec/cfhd: Increase minimum band dimension to 3
Michael Niedermayer [Fri, 19 Aug 2016 19:34:38 +0000 (21:34 +0200)]
avcodec/cfhd: Increase minimum band dimension to 3

The implementation does not currently support len=2

Fixes out of array accesses
Fixes: 29d1b3db5ba2205e82b0b3a533e057a3/asan_heap-oob_12b650c_9254_3b8c4e4d931eb2c32841c18ebb297f1d.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b8b36717217c6f45db71c77ad4e7c65521e7d9ff)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 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>
2 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>
2 years agoavcodec/rawdec: Fix bits_per_coded_sample checks
Michael Niedermayer [Fri, 19 Aug 2016 00:07:22 +0000 (02:07 +0200)]
avcodec/rawdec: Fix bits_per_coded_sample checks

Fixes assertion failure
Fixes: 9eb9cf5b8c26dd0fa7107ed0348dcc1f/signal_sigabrt_7ffff6ae7c37_8926_4609a5c3f071d555d2d557625f9687b1.swf

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 237207645b36fb79759d313c0399ee93ba467b9d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agolavc/mjpegdec: Do not skip reading quantization tables.
Carl Eugen Hoyos [Fri, 2 Sep 2016 15:10:57 +0000 (17:10 +0200)]
lavc/mjpegdec: Do not skip reading quantization tables.

They may contain 0xFFs, confusing the start code finding algorithm.

Fixes ticket #5819.
(cherry picked from commit cef5bc0e6e2320d3903cf063d59cef83e91dbc3c)

Conflicts:
libavcodec/mjpegdec.c

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>
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 agoUpdate for 3.0.3
Michael Niedermayer [Sat, 13 Aug 2016 12:12:19 +0000 (14:12 +0200)]
Update for 3.0.3

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 agoavformat/flacdec: Fix seeking close to EOF
Michael Niedermayer [Wed, 22 Jun 2016 18:33:09 +0000 (20:33 +0200)]
avformat/flacdec: Fix seeking close to EOF

Fixes Ticket5428

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

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 agoavformat/flvdec: Accept last size if its off by 1
Michael Niedermayer [Tue, 21 Jun 2016 21:38:23 +0000 (23:38 +0200)]
avformat/flvdec: Accept last size if its off by 1

Fixes part of Ticket5648

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agotests/api/api-codec-param-test: Do not directly access caps_internal
Michael Niedermayer [Thu, 16 Jun 2016 07:14:44 +0000 (09:14 +0200)]
tests/api/api-codec-param-test: Do not directly access caps_internal

The caps_internal field has moved without major bump and direct
access causes crashes, found when testing 3.1

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec: Add avpriv_codec_get_cap_skip_frame_fill_param()
Michael Niedermayer [Wed, 20 Apr 2016 17:19:25 +0000 (19:19 +0200)]
avcodec: Add avpriv_codec_get_cap_skip_frame_fill_param()

With this the use of the caps_internal from libavformat can be avoided

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 agoavformat/mpegts: adjust probe score for low check_count
Michael Niedermayer [Mon, 13 Jun 2016 23:36:15 +0000 (01:36 +0200)]
avformat/mpegts: adjust probe score for low check_count

Fixes mis-detection of tiff as mpegts
Fixes Ticket5565

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

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 agoavformat/mp3dec: Increase probe score slightly when the whole data from begin to...
Michael Niedermayer [Sat, 11 Jun 2016 00:41:45 +0000 (02:41 +0200)]
avformat/mp3dec: Increase probe score slightly when the whole data from begin to end is mp3

Improves score for 1000-frames-of-noise-encoded-with-lame.mp3 without file extension

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/cfhd: Set dimensions unconditionally
Michael Niedermayer [Fri, 10 Jun 2016 18:22:02 +0000 (20:22 +0200)]
avcodec/cfhd: Set dimensions unconditionally

Fixes Ticket5215

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 056a4ae771b00645184c639fe9fd6b7217eb6d87)

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 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 agoRevert "configure: Enable GCC vectorization on ≥4.9 on x86"
James Almer [Sat, 9 Jul 2016 19:00:06 +0000 (16:00 -0300)]
Revert "configure: Enable GCC vectorization on ≥4.9 on x86"

This reverts commit cb8646af24bd8e9627cc5e1c62b049a00fe0b07b.

This change has brough more issues than benefits, between compilation
time failures depending on flags used and code miscompilation causing
runtime crashes.

See the "[PATCH 2/2] configure: Enable GCC vectorization on ≥4.9"
thread in the ffmpeg-devel mailing list for the relevant discussion.

(cherry picked from commit fd6dbc53855fbfc9a782095d0ffe11dd3a98905f)

3 years agoavcodec/libopenjpegenc: Set numresolutions by default to a value that is not too...
Michael Niedermayer [Sun, 26 Jun 2016 15:34:37 +0000 (17:34 +0200)]
avcodec/libopenjpegenc: Set numresolutions by default to a value that is not too large

Fixes issues with libopenjpeg 2.1

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

3 years agoffplay: Fix usage of private lavfi API
Timo Rothenpieler [Wed, 29 Jun 2016 09:15:39 +0000 (11:15 +0200)]
ffplay: Fix usage of private lavfi API

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1bd9fb6de59bb96144ece914643d2d205818168d)

3 years agotests/checkasm/checkasm: Disable checkasm_check_pixblockdsp for ppc64be
Michael Niedermayer [Sun, 26 Jun 2016 01:43:52 +0000 (03:43 +0200)]
tests/checkasm/checkasm: Disable checkasm_check_pixblockdsp for ppc64be

See: Ticket5508

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

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 agoavformat/utils: avoid overflow in compute_chapters_end() with huge durations
Michael Niedermayer [Sat, 28 May 2016 21:51:35 +0000 (23:51 +0200)]
avformat/utils: avoid overflow in compute_chapters_end()  with huge durations

Fixes: usan_granule_overflow

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/utils: avoid overflow in update_stream_timings() with huge durations
Michael Niedermayer [Sat, 28 May 2016 21:51:35 +0000 (23:51 +0200)]
avformat/utils: avoid overflow in update_stream_timings() with huge durations

Fixes: usan_granule_overflow

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

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 agoffserver: fixed deallocation bug in build_feed_streams
Gregor Riepl [Tue, 24 May 2016 13:17:22 +0000 (15:17 +0200)]
ffserver: fixed deallocation bug in build_feed_streams

Signed-off-by: Gregor Riepl <onitake@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d970f7ba31246040787e5ea6eb73bb85cafb932b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/diracdec: Fix potential integer overflow
Michael Niedermayer [Thu, 19 May 2016 16:02:53 +0000 (18:02 +0200)]
avcodec/diracdec: Fix potential integer overflow

Fixes CID1361948

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

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/resample: Fix division by 0 with tap_count=1
Michael Niedermayer [Mon, 16 May 2016 03:10:21 +0000 (05:10 +0200)]
swresample/resample: Fix division by 0 with tap_count=1

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

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 agohevc: Fix memory leak related to a53_caption data
Will Kelleher [Thu, 7 Apr 2016 13:58:31 +0000 (08:58 -0500)]
hevc: Fix memory leak related to a53_caption data

Signed-off-by: Will Kelleher <wkelleher@gogoair.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 964f07f68e1cc4e2d585615e2b1a1fade269afb0)

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 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 agodoc/general: update supported DCA extensions
James Almer [Sun, 15 May 2016 02:02:52 +0000 (23:02 -0300)]
doc/general: update supported DCA extensions

3 years agoavcodec/rscc: check input buffer size for deflate mode
James Almer [Wed, 11 May 2016 01:07:19 +0000 (22:07 -0300)]
avcodec/rscc: check input buffer size for deflate mode

Fixes overreads.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit b2244fa0a624f7e38893d58265e9c039bed2e4de)

3 years agoavcodec/dca: fix sync word search error condition
foo86 [Mon, 2 May 2016 20:44:47 +0000 (23:44 +0300)]
avcodec/dca: fix sync word search error condition

This didn't actually check if sync word was found and always errored out
with "-err_detect explode" option enabled.

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

3 years agolavf/mpegts: Return small probe score for very short transport streams.
Carl Eugen Hoyos [Sun, 1 May 2016 13:39:13 +0000 (15:39 +0200)]
lavf/mpegts: Return small probe score for very short transport streams.

Fixes Debian bug 823098.

(cherry picked from commit 88a849c714c17ad80d411f68e6575dfa1c8e8358)

3 years agoChangelog: Fix minor formating inconsistency n3.0.2
Michael Niedermayer [Thu, 28 Apr 2016 01:03:39 +0000 (03:03 +0200)]
Changelog: Fix minor formating inconsistency

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoupdate for 3.0.2
Michael Niedermayer [Wed, 27 Apr 2016 23:40:54 +0000 (01:40 +0200)]
update for 3.0.2

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
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 agoconfigure: build fix for P5600 with mips code restructuring
Shivraj Patil [Tue, 26 Apr 2016 06:47:15 +0000 (12:17 +0530)]
configure: build fix for P5600 with mips code restructuring

Note:- backporting commit 15ef98afd10b3696d29fb6d19606ba03a9dd47ad from head

Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agomips: add support for R6
Vicente Olivert Riera [Tue, 26 Apr 2016 06:47:14 +0000 (12:17 +0530)]
mips: add support for R6

Note:- backporting commit ad16eff64ba78d8dc98a8324640025c7cb2857f3 from head

Understanding the mips32r6 and mips64r6 ISAs in the configure script is
not enough. In order to have full support for MIPS R6 in FFmpeg we need
to be able to build it, and for that we need to make sure we don't use
incompatible assembler code which makes the build fail. Ifdefing the
offending code is sufficient to fix the problem.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
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 agoavformat/mux: Check that deinit is set before calling it
Michael Niedermayer [Sun, 24 Apr 2016 10:07:37 +0000 (12:07 +0200)]
avformat/mux: Check that deinit is set before calling it

Fixes null pointer dereference

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

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 agoavcodec/pngdec: Fix alpha detection with skip_frame
Michael Niedermayer [Fri, 8 Apr 2016 22:47:10 +0000 (00:47 +0200)]
avcodec/pngdec: Fix alpha detection with skip_frame

Fixes Ticket4816

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoChangelog: Make formating consistent
Michael Niedermayer [Mon, 4 Apr 2016 20:45:14 +0000 (22:45 +0200)]
Changelog: Make formating consistent

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>