ffmpeg.git
7 months agoavcodec/rasc: Move ff_get_buffer() after frame checks
Michael Niedermayer [Tue, 22 Jan 2019 23:19:14 +0000 (00:19 +0100)]
avcodec/rasc: Move ff_get_buffer() after frame checks

If the frame1/2 checks fail this avoids doing the allocation of a new frame

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9f4af97aff899571663342fbe68df8caee30097f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 months agoavcodec/rasc: Check uncompressed dlta size
Michael Niedermayer [Tue, 22 Jan 2019 23:16:02 +0000 (00:16 +0100)]
avcodec/rasc: Check uncompressed dlta size

We assume that if the compressed size is bigger than if each byte is encoded in a single raw packet
that the data is invalid.

Fixes: Out of memory
Fixes: 12208/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5648916473708544

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f4079d5174c20eddbc99eef6ebe98d411f8014c5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 months agoavcodec/fic: Check that there is input left in fic_decode_block()
Michael Niedermayer [Tue, 22 Jan 2019 23:30:53 +0000 (00:30 +0100)]
avcodec/fic: Check that there is input left in fic_decode_block()

Fixes: Timeout
Fixes: 12450/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5661984622641152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit db1c4acd02af4de5dfbea6012c296470679aa7a6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 months agoavcodec/ilbcdec: Fix undefined integer overflow lsf2poly()
Michael Niedermayer [Mon, 14 Jan 2019 23:09:30 +0000 (00:09 +0100)]
avcodec/ilbcdec: Fix undefined integer overflow lsf2poly()

The addition is moved up into the context where the variable is unsigned avoiding
the undefined behavior

Fixes: runtime error: signed integer overflow: 2147481972 + 4096 cannot be represented in type 'int'
Fixes: 12444/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ILBC_fuzzer-5755706244857856

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4523cc5e75c8ecfba8975d16e96c29f9bf70973f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 months agoavcodec/ilbcdec: Fix integer overflow in construct_vector()
Michael Niedermayer [Mon, 14 Jan 2019 23:02:25 +0000 (00:02 +0100)]
avcodec/ilbcdec: Fix integer overflow in construct_vector()

webrtc contains explicit code to ignore the undefined behavior (RTC_NO_SANITIZE / OverflowingAddS32S32ToS32())

Probably fixes: Integer overflow (unreproducable here)
Probably fixes: 12215/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ILBC_fuzzer-5767142427852800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c95d0fb23917c35886f3b62daa05af20d2700a1e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoUpdate for 4.1.1
Michael Niedermayer [Mon, 21 Jan 2019 07:34:57 +0000 (08:34 +0100)]
Update for 4.1.1

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/prosumer: Error out if decompress() stops reading data
Michael Niedermayer [Sat, 12 Jan 2019 21:36:00 +0000 (22:36 +0100)]
avcodec/prosumer: Error out if decompress() stops reading data

if 0 is encountered in the LUT then decompress() will continue to output 0 bytes but never read more data.
Without a specification it is impossible to say if this is invalid or a feature.
None of the valid prosumer files tested cause a 0 to be read, so it is likely
not a intended feature.

Fixes: Timeout
Fixes: 11266/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PROSUMER_fuzzer-5681827423977472

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 62f8d27ef1995354d6529ea0d9428501d7f914b4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/tiff: Check for 12bit gray fax
Michael Niedermayer [Sat, 12 Jan 2019 18:37:18 +0000 (19:37 +0100)]
avcodec/tiff: Check for 12bit gray fax

Fixes: Assertion failure
Fixes: 11898/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5759794191794176

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ec28a85107cccece4dce17c0ccb633defe2d6e98)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavutil/imgutils: Optimize memset_bytes() by using av_memcpy_backptr()
Michael Niedermayer [Tue, 25 Dec 2018 22:15:20 +0000 (23:15 +0100)]
avutil/imgutils: Optimize memset_bytes() by using av_memcpy_backptr()

This is strongly based on code by Marton Balint, and depends on the previous commit

Fixes: Timeout
Fixes: 11502/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920
Before: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 in 11209 ms
After:  Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 in  4104 ms

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f64c0dffa13e6263de3fdff0058ab2fdb03ac1d6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavutil/mem: Optimize fill32() by unrolling and using 64bit
Michael Niedermayer [Thu, 17 Jan 2019 21:35:10 +0000 (22:35 +0100)]
avutil/mem: Optimize fill32() by unrolling and using 64bit

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 12b1338be376a3e5fb606d9fe41b58dc4a9e62c7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoconfigure: bump year
James Almer [Tue, 1 Jan 2019 18:26:31 +0000 (15:26 -0300)]
configure: bump year

Happy new year!

(cherry picked from commit 3209d7b3930bab554bf7d97d8041d9d0b88423a8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/tests/rangecoder: initialize array to avoid valgrind warning
Michael Niedermayer [Fri, 4 Jan 2019 01:46:29 +0000 (02:46 +0100)]
avcodec/tests/rangecoder: initialize array to avoid valgrind warning

Found-by: jamrial
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c15972f0af7679b466dd4a10a54ab2f04f9372c8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/gdv: Optimize and factorize scaling loops
Michael Niedermayer [Fri, 4 Jan 2019 18:51:04 +0000 (19:51 +0100)]
avcodec/gdv: Optimize and factorize scaling loops

Fixes: Timeout
Fixes: 11067/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5686623711264768

Before change: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5686623711264768 in 34386 ms
After  change: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5686623711264768 in 24327 ms

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6e23736aefa83859fdb6faae4fd14c169f1a41ab)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/h264_slice: Fix integer overflow in implicit_weight_table()
Michael Niedermayer [Fri, 4 Jan 2019 19:00:38 +0000 (20:00 +0100)]
avcodec/h264_slice: Fix integer overflow in implicit_weight_table()

Fixes: signed integer overflow: 2 * 2132811760 cannot be represented in type 'int'
Fixes: 11156/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-6237685933408256

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 77e56d74f972537aecd5bc2c5c4111e1d6ad0963)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/exr: set layer_match in all branches
Michael Niedermayer [Tue, 25 Dec 2018 20:30:54 +0000 (21:30 +0100)]
avcodec/exr: set layer_match in all branches

Otherwise it is left to the value from the previous iteration

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 433d2ae4353f3c513a45780845d9d8ca252cd4dc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/exr: Check for duplicate channel index
Michael Niedermayer [Tue, 25 Dec 2018 17:41:58 +0000 (18:41 +0100)]
avcodec/exr: Check for duplicate channel index

Fixes: Out of memory
Fixes: 11582/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5730204559867904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f9728feaf90eb7493f8872356f54150efafb59cc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavfilter/vf_tonemap_opencl: Make static tables const
Michael Niedermayer [Mon, 31 Dec 2018 19:54:12 +0000 (20:54 +0100)]
avfilter/vf_tonemap_opencl: Make static tables const

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 47c3a10b16f2721c7afa333869aafa8c007fb419)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agodoc/indevs: fix upto typo
Michael Niedermayer [Mon, 31 Dec 2018 19:45:17 +0000 (20:45 +0100)]
doc/indevs: fix upto typo

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b33de557470471fe5d3a07fb441ec3f548f1d50a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/4xm: Fix returned error codes
Michael Niedermayer [Mon, 31 Dec 2018 17:11:44 +0000 (18:11 +0100)]
avcodec/4xm: Fix returned error codes

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 07607a1db879d0d96e2c91e1354bc4e425937d3a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavformat/libopenmpt: Fix successfull typo
Michael Niedermayer [Fri, 28 Dec 2018 21:22:52 +0000 (22:22 +0100)]
avformat/libopenmpt: Fix successfull typo

Reviewed-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 571af98a5959d72c65a6753eb8e82cde407f4cd0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/v4l2_m2m: fix cant typo
Michael Niedermayer [Fri, 28 Dec 2018 21:22:53 +0000 (22:22 +0100)]
avcodec/v4l2_m2m: fix cant typo

Reviewed-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 062bf5639359e183e016bcb795ac10735f83e863)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/mjpegbdec: Fix some misplaced {} and spaces
Michael Niedermayer [Fri, 28 Dec 2018 21:22:56 +0000 (22:22 +0100)]
avcodec/mjpegbdec: Fix some misplaced {} and spaces

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 11a8d2ccab1fe165eef4578c048d38731dbe1d6f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavformat/wvdec: detect and error out on WavPack DSD files
David Bryant [Wed, 21 Nov 2018 05:00:47 +0000 (21:00 -0800)]
avformat/wvdec: detect and error out on WavPack DSD files

Not currently supported.

(cherry picked from commit db109373d87b1fa5fe9f3d027d1bb752f725b74a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/mips: Fix failed case: hevc-conformance-AMP_A_Samsung_* when enable msa
gxw [Mon, 24 Dec 2018 06:07:44 +0000 (14:07 +0800)]
avcodec/mips: Fix failed case: hevc-conformance-AMP_A_Samsung_* when enable msa

The AV_INPUT_BUFFER_PADDING_SIZE has been increased to 64, but the value is still 32
in function ff_hevc_sao_edge_filter_8_msa. So, use AV_INPUT_BUFFER_PADDING_SIZE directly.
Also, use MAX_PB_SIZE directly instead of 64. Fate tests passed.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f652c7a45c60427db0a89fae665e63b546af6ebb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/fic: Fail on invalid slice size/off
Michael Niedermayer [Sun, 16 Dec 2018 20:43:07 +0000 (21:43 +0100)]
avcodec/fic: Fail on invalid slice size/off

Fixes: Timeout
Fixes: 11486/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5677133863583744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 30a7a81cdc2ee2eac6d3271439c43f11b7327b3e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/ilbcdec: fix integer overflow in energy
Michael Niedermayer [Sun, 9 Dec 2018 01:26:18 +0000 (02:26 +0100)]
avcodec/ilbcdec: fix integer overflow in energy

webrtc uses a int32_t like the existing code in ilbcdec

Fixes: signed integer overflow: 2080245063 + 257939661 cannot be represented in type 'int'
Fixes: 11037/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ILBC_fuzzer-5682976612941824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fbf409cd91aca2b4738c6b5bc963ae6041f26701)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agopostproc/postprocess_template: remove FF_REG_sp from clobber list
Michael Niedermayer [Thu, 20 Dec 2018 21:40:06 +0000 (22:40 +0100)]
postproc/postprocess_template: remove FF_REG_sp from clobber list

Future gcc may no longer support this

Tested-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c1cbeb87db4bfc6e281e4254a6c7fdd3854fc9b9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agopostproc/postprocess_template: Avoid using %4 for the threshold compare
Michael Niedermayer [Thu, 20 Dec 2018 21:40:05 +0000 (22:40 +0100)]
postproc/postprocess_template: Avoid using %4 for the threshold compare

This avoids problems if %4 is the stack pointer
the constraints do not allow %4 to be the stack pointer but gcc 9 may
no longer support specifying such constraints

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4325527e1c4fd2da119e81933172065ee1274eda)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agolibavformat/mov: Fix NULL-dereference read for some encrypted content.
Jacob Trimble [Thu, 20 Dec 2018 00:00:22 +0000 (16:00 -0800)]
libavformat/mov: Fix NULL-dereference read for some encrypted content.

When reading frames, we need to use the fragment for the correct
stream.  Sometimes the "current" fragment is not the same as the one
the frame is for.

Found by Chromium's ClusterFuzz:
https://crbug.com/906392 and https://crbug.com/915524

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 555f332e7adbd492ca74fa7329c492819b52e2ed)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/rpza: Check that there is enough data for all the blocks
Michael Niedermayer [Sun, 16 Dec 2018 18:13:27 +0000 (19:13 +0100)]
avcodec/rpza: Check that there is enough data for all the blocks

Fixes: Timeout
Fixes: 11547/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RPZA_fuzzer-5678435842654208

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e63517e00a1a8375c7fb3b8c4c64c9a7c3da713e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/rpza: Move frame allocation to a later point
Michael Niedermayer [Sun, 16 Dec 2018 18:04:56 +0000 (19:04 +0100)]
avcodec/rpza: Move frame allocation to a later point

This will allow performing some fast checks before the slow allocation

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8a708aa99cb0e8d76e52117b1fd89d221f0055e9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/avcodec: Document the data type for AV_PKT_DATA_MPEGTS_STREAM_ID
Michael Niedermayer [Fri, 7 Dec 2018 20:52:30 +0000 (21:52 +0100)]
avcodec/avcodec: Document the data type for AV_PKT_DATA_MPEGTS_STREAM_ID

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 68e011e4103b9cb5ac2d152d73ca8393065a33fb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavformat/mpegts: Fix side data type for stream id
Michael Niedermayer [Fri, 7 Dec 2018 20:51:48 +0000 (21:51 +0100)]
avformat/mpegts: Fix side data type for stream id

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ab1319d82f0c77308792fa2d88cbfc73c3e47cb7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agotests/fate/filter-video: increase fuzz for fate-filter-refcmp-psnr-rgb
Michael Niedermayer [Thu, 6 Dec 2018 20:51:22 +0000 (21:51 +0100)]
tests/fate/filter-video: increase fuzz for fate-filter-refcmp-psnr-rgb

Fixes: test failure on powerpc

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f8f762c300e29d80ece363edc08e137b371d909f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/mjpegdec: Fix indention of ljpeg_decode_yuv_scan()
Michael Niedermayer [Tue, 18 Dec 2018 13:27:48 +0000 (14:27 +0100)]
avcodec/mjpegdec: Fix indention of ljpeg_decode_yuv_scan()

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ea30ac1e408246382796f61d645d1e087aed390a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agolavf/id3v2: fail read_apic on EOF reading mimetype
chcunningham [Fri, 14 Dec 2018 21:44:07 +0000 (13:44 -0800)]
lavf/id3v2: fail read_apic on EOF reading mimetype

avio_read may return EOF, leaving the mimetype array unitialized. fail
early when this occurs to avoid using the array in an unitialized state.

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ee1e39a576977fd38c3b94fc56125d31d38833e9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/rasc: Check that the number of moves is less than or equal the number of...
Michael Niedermayer [Fri, 14 Dec 2018 23:10:17 +0000 (00:10 +0100)]
avcodec/rasc: Check that the number of moves is less than or equal the number of pixels

Fixes: OOM
Fixes: 10307/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5393974559244288

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 092cb17983b2660b4e050a05c739060f8e03d27a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavformat/nutenc: Document trailer index assert better
Michael Niedermayer [Fri, 14 Dec 2018 20:52:09 +0000 (21:52 +0100)]
avformat/nutenc: Document trailer index assert better

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3a95b73abc868995b08ca2b4d8bbf2cda43184f8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agolavf/mov: ensure only one tkhd per trak
chcunningham [Thu, 13 Dec 2018 21:58:40 +0000 (13:58 -0800)]
lavf/mov: ensure only one tkhd per trak

Chromium fuzzing produced a whacky file with extra tkhds. This caused
an AVStream that was already in use to be corrupted by assigning it a
new id, which blows up later in mov_read_trun because the
MOVFragmentStreamInfo.index_entry now points OOB.

Reviewed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c9f7b6f7a9fdffa0ab8f3aa84a1f701cf5b3a6e9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/clearvideo: Check remaining input bits in P macro block loop
Michael Niedermayer [Thu, 6 Dec 2018 00:19:37 +0000 (01:19 +0100)]
avcodec/clearvideo: Check remaining input bits in P macro block loop

Fixes: Timeout
Fixes: 11083/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CLEARVIDEO_fuzzer-5657180351496192

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7aaab127bebb33003105a620736d6cae8c45a6e5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/rasc: Check input space before reading chunk
Michael Niedermayer [Wed, 5 Dec 2018 01:18:51 +0000 (02:18 +0100)]
avcodec/rasc: Check input space before reading chunk

Fixes: Timeout
Fixes: 11118/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5652564066959360

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 52ba824c65817c1db6aad41c470dde7162252036)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/dxv: Check that there is enough data to decompress
Michael Niedermayer [Sat, 1 Dec 2018 20:41:01 +0000 (21:41 +0100)]
avcodec/dxv: Check that there is enough data to decompress

Fixes: Timeout
Fixes: 10979/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-6178582203203584

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2bc3811c0d6b34e43a55a7541722761f548628d0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/ppc/hevcdsp: Fix build failures with powerpc-linux-gnu-gcc-4.8 with --disable...
Michael Niedermayer [Tue, 4 Dec 2018 15:29:40 +0000 (16:29 +0100)]
avcodec/ppc/hevcdsp: Fix build failures with powerpc-linux-gnu-gcc-4.8 with --disable-optimizations

The affected functions could also be changed into macros, this is the
smaller change to fix it though. And avoids (probably) less readable macros
The extra code should be optimized out when optimizations are done as all values
are known at build after inlining.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2c64a6bcd280c64997e6c4799bc89c0a9393bbf3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/msvideo1: Check for too small dimensions
Michael Niedermayer [Sat, 1 Dec 2018 21:16:19 +0000 (22:16 +0100)]
avcodec/msvideo1: Check for too small dimensions

Such low resolution would result in empty output as a minimum of 4x4 is needed
We could also check for multiple of 4 dimensions but that is not needed

Fixes: Timeout
Fixes: 11191/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSVIDEO1_fuzzer-5739529588178944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 953bd58861ad933e614510140b05a61e3d1375be)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/wmv2dec: Skip I frame if its smaller than 1/8 of the minimal size
Michael Niedermayer [Tue, 27 Nov 2018 22:37:03 +0000 (23:37 +0100)]
avcodec/wmv2dec: Skip I frame if its smaller than 1/8 of the minimal size

Frames that small are not valid and of limited use for error concealment, while
being very computationally intensive to process.

Fixes: Timeout
Fixes: 11168/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV2_fuzzer-5733782032744448

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d6f4341522c3eafb046c47b115d79ce684a899fc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/msmpeg4dec: Skip frame if its smaller than 1/8 of the minimal size
Michael Niedermayer [Thu, 29 Nov 2018 01:32:10 +0000 (02:32 +0100)]
avcodec/msmpeg4dec: Skip frame if its smaller than 1/8 of the minimal size

Frames that small are not valid and of limited use for error concealment, while
being very computationally intensive to process.

Fixes: Timeout
Fixes: 11318/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSMPEG4V1_fuzzer-5710884555456512

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 09ec182864d41c990bc18f620eabb77444aeff57)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/truemotion2rt: Fix rounding in input size check
Michael Niedermayer [Sat, 17 Nov 2018 08:24:30 +0000 (09:24 +0100)]
avcodec/truemotion2rt: Fix rounding in input size check

Fixes: Timeout
Fixes: 11332/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2RT_fuzzer-5678456612847616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7f22a4ebc97817fd0968f5ea8295c9a59a6292e0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/diracdec: Check component quant
Michael Niedermayer [Wed, 14 Nov 2018 08:42:44 +0000 (09:42 +0100)]
avcodec/diracdec: Check component quant

Fixes: Timeout
Fixes: 10708/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5730140957442048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 28c96c2ce2781c2cd147a9f3c299e18ce1dc7ff8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/tiff: Limit filtering to decoded data
Michael Niedermayer [Fri, 23 Nov 2018 01:33:04 +0000 (02:33 +0100)]
avcodec/tiff: Limit filtering to decoded data

Fixes: Timeout
Fixes: 11068/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5698456681709568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 90ac0e5f29ba4730cd92d3268938b3730823e52b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/truemotion2: fix integer overflows in tm2_low_chroma()
Michael Niedermayer [Fri, 16 Nov 2018 23:38:53 +0000 (00:38 +0100)]
avcodec/truemotion2: fix integer overflows in tm2_low_chroma()

Fixes: 11295/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-4888953459572736

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2ae39d795613f3c6925c59852b625029b747fe42)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/pngdec: Check compression method
Michael Niedermayer [Fri, 9 Nov 2018 02:12:45 +0000 (03:12 +0100)]
avcodec/pngdec: Check compression method

method 0 (inflate/deflate) is the only specified in the specification and the only supported

Fixes: Timeout
Fixes: 10976/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PNG_fuzzer-5729372588736512

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1f99674ddddcc33f4c37def0a206e31ad7c4c1af)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agofftools/ffmpeg: Repair reinit_filter feature
Michael Niedermayer [Tue, 13 Nov 2018 19:29:40 +0000 (20:29 +0100)]
fftools/ffmpeg: Repair reinit_filter feature

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 35040048793bc5d19942277fe17d1235e915a7d8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/shorten: Fix integer overflow with offset
Michael Niedermayer [Fri, 9 Nov 2018 18:59:27 +0000 (19:59 +0100)]
avcodec/shorten: Fix integer overflow with offset

Fixes: signed integer overflow: -1625810908 - 582229060 cannot be represented in type 'int'
Fixes: 10977/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5732602018267136

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2f888771cd1ce8d68d4b18a1009650c1f260aaf2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/imm4: Use ff_set_dimensions()
Michael Niedermayer [Fri, 9 Nov 2018 22:07:23 +0000 (23:07 +0100)]
avcodec/imm4: Use ff_set_dimensions()

Fixes: Out of memory
Fixes: 10970/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IMM4_fuzzer-5698750043914240

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c305e134ce23b46a1164527ade3e1b7e2ecedf5f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoh264_redundant_pps: Fix logging context
Andreas Rheinhardt [Fri, 9 Nov 2018 05:31:38 +0000 (06:31 +0100)]
h264_redundant_pps: Fix logging context

The first element of H264RedundantPPSContext is not a pointer to an
AVClass as required.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6dafcb6fdb6271d35220b889833561705c2b366f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavfilter/af_asetnsamples: fix last frame props
Marton Balint [Tue, 25 Dec 2018 21:26:18 +0000 (22:26 +0100)]
avfilter/af_asetnsamples: fix last frame props

Frame properties were not copied, so e.g. PTS was not set for the last frame.

Regression since ef3babb2c70f564dc1634b3f29c6e35a2b2dc239.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit f9e947845f9ac5ccb84cf5e6f4121ec2e23b9946)

9 months agocbs_av1: Fix reading of overlong uvlc codes
Mark Thompson [Sun, 2 Dec 2018 20:49:24 +0000 (20:49 +0000)]
cbs_av1: Fix reading of overlong uvlc codes

The specification allows 2^32-1 to be encoded as any number of zeroes
greater than 31, followed by a one.  This previously failed because the
trace code would overflow the array containing the string representation
of the bits if there were more than 63 zeroes.  Fix that by splitting the
trace output into batches, and at the same time move it out of the default
path.

(While this seems likely to be a specification error, libaom does support
it so we probably should as well.)

From a test case by keval shah <skeval65@gmail.com>.

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

9 months agoavcodec/cbs_av1: fix parsing delta_frame_id_minus1
James Almer [Thu, 20 Dec 2018 15:26:43 +0000 (12:26 -0300)]
avcodec/cbs_av1: fix parsing delta_frame_id_minus1

delta_frame_id_minus1 is not a single value in the bitstream, and can
store values up to 17 bits wide.

Fixes parsing files with frame ids.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 064f9505f49816650516c7afe93e43d8f547891a)

9 months agoavfilter/vf_overlay: fix filtering with negative y
Paul B Mahol [Mon, 3 Dec 2018 09:00:01 +0000 (10:00 +0100)]
avfilter/vf_overlay: fix filtering with negative y

(cherry picked from commit 8440835dbe93ef9972ceb940af9bda9bc0e178e7)

9 months agoavformat/movenc: get number of written bytes from bitstream writer
Paul B Mahol [Thu, 22 Nov 2018 20:28:59 +0000 (21:28 +0100)]
avformat/movenc: get number of written bytes from bitstream writer

Update fate test.

(cherry picked from commit 97d1ee437bbf67d7e3897bc73df4f7d9771ac309)

9 months agoavformat/movenc: fix size calculation in mov_write_eac3_tag()
Paul B Mahol [Wed, 21 Nov 2018 10:45:02 +0000 (11:45 +0100)]
avformat/movenc: fix size calculation in mov_write_eac3_tag()

Otherwise it would assert when flushing bits.

(cherry picked from commit 027f032bbce9bdf7bbec40665b98590cade33416)

9 months agoavfilter/vf_overlay: fix crash with negative y
Paul B Mahol [Tue, 20 Nov 2018 22:18:47 +0000 (23:18 +0100)]
avfilter/vf_overlay: fix crash with negative y

(cherry picked from commit 57815cfad5c5d6beb6f3fc0ae86b050a970d3a08)

10 months agoavcodec/mpeg_er: fix clearing chroma blocks for 422 and 444
Marton Balint [Sat, 17 Nov 2018 22:26:24 +0000 (23:26 +0100)]
avcodec/mpeg_er: fix clearing chroma blocks for 422 and 444

Fixes ticket #7494.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit e3a96309826dd0ea33db0300f7c75414fdbea0a4)

10 months agoavfilter/af_afade: fix duration maximum
Marton Balint [Mon, 12 Nov 2018 21:00:49 +0000 (22:00 +0100)]
avfilter/af_afade: fix duration maximum

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit aecd63b926812148014c4f01270473722ae5e945)

10 months agoavfilter/vf_fade: fix start/duration max value
Mark Harris [Mon, 12 Nov 2018 06:54:04 +0000 (22:54 -0800)]
avfilter/vf_fade: fix start/duration max value

A fade out (usually at the end of a video) can easily start beyond
INT32_MAX (about 36 minutes).  Regression since d40dc64173.

(cherry picked from commit ae4323548ae821db81b73bc66cf5a2f9885296cb)

10 months agoavcodec/cbs_av1: fix parsing signed integer values
James Almer [Sun, 11 Nov 2018 01:52:12 +0000 (22:52 -0300)]
avcodec/cbs_av1: fix parsing signed integer values

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit f0f2832a5ce93bad9b1d29f99df6bda2380fc41c)

10 months agoavcodec/cbs_av1: fix storage size for segmentation_params feature_value fields
James Almer [Sun, 11 Nov 2018 01:51:18 +0000 (22:51 -0300)]
avcodec/cbs_av1: fix storage size for segmentation_params feature_value fields

The valid range is -255 to 255.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 79831f4531d98c3c1eab96c10f1135d08abef5f3)

10 months agoconfigure: Add missing xlib dependency for VAAPI X11 code
Mark Thompson [Wed, 14 Nov 2018 22:56:18 +0000 (22:56 +0000)]
configure: Add missing xlib dependency for VAAPI X11 code

Fixes #7538.

(cherry picked from commit 2ce3a48f30fe3cec7153aa3f18a1012a366aca3a)

10 months agoavcodec/hevcdec: fix non-ref frame judgement
Mark Wu [Tue, 23 Oct 2018 04:49:08 +0000 (12:49 +0800)]
avcodec/hevcdec: fix non-ref frame judgement

After inspecting the source code of x265, mpv and ffmpeg, I've found that
ffmpeg mistakenly regards EVC_NAL_BLA_N_LP and HEVC_NAL_IDR_N_LP as non-
reference frames, which are acutally reference frames according to the
specification in x265, and drops them.

This patch should address the problem. I have tested it with mpv.

Signed-off-by: Mark Wu <wfwf1997@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 10bc4c3a7df7bb26303067b97311b7eeedfd453e)

10 months agocbs_av1: Support redundant frame headers n4.1
Mark Thompson [Sun, 4 Nov 2018 23:58:01 +0000 (23:58 +0000)]
cbs_av1: Support redundant frame headers

(cherry picked from commit f5894178fb8063ec17c61c04df96a70607ca2daa)

10 months agocbs_av1: Fix header writing when already aligned
Mark Thompson [Sun, 4 Nov 2018 23:56:39 +0000 (23:56 +0000)]
cbs_av1: Fix header writing when already aligned

(cherry picked from commit 6bdb7712ae0267ba4f69c7434d2b3dee12762d1d)

10 months agoconfigure: Add missing V4L2 M2M decoder BSF dependencies
Mark Thompson [Mon, 5 Nov 2018 14:22:10 +0000 (14:22 +0000)]
configure: Add missing V4L2 M2M decoder BSF dependencies

(cherry picked from commit e9d2e3fdaacb6872dd689ffd5a65e476b70dee3d)

10 months agoconfigure: Add missing IVF muxer BSF dependency
Mark Thompson [Mon, 5 Nov 2018 14:22:05 +0000 (14:22 +0000)]
configure: Add missing IVF muxer BSF dependency

(cherry picked from commit a4fb2b115071220f23ad7b3d82037647e94279ed)

10 months agoavcodec/cbs_av1: fix decoder/encoder_buffer_delay variable types
James Almer [Sun, 4 Nov 2018 20:07:39 +0000 (17:07 -0300)]
avcodec/cbs_av1: fix decoder/encoder_buffer_delay variable types

buffer_delay_length_minus_1 is five bits long, meaning decode_buffer_delay and
encoder_buffer_delay can have values up to 32 bits long.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 89a0d33e3a53e8edefd734b131a7035d13052947)

10 months agoconfigure: Fix av1_metadata BSF dependency
Mark Thompson [Mon, 5 Nov 2018 00:01:54 +0000 (00:01 +0000)]
configure: Fix av1_metadata BSF dependency

(cherry picked from commit 34429182b93123a25e38819ef15bdae42793209f)

10 months agoavformat/ivfenc: use the av1_metadata bsf to insert Temporal Delimiter OBUs if needed
James Almer [Wed, 3 Oct 2018 00:08:54 +0000 (21:08 -0300)]
avformat/ivfenc: use the av1_metadata bsf to insert Temporal Delimiter OBUs if needed

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 2d2af23349cae0d84c8ed51c249bfc1e6f2e28a2)

10 months agoavformat/ftp: allow nonstandard 202 reply to OPTS UTF8
Marton Balint [Thu, 1 Nov 2018 20:03:59 +0000 (21:03 +0100)]
avformat/ftp: allow nonstandard 202 reply to OPTS UTF8

Fixes ticket #7481.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 8e5a2495a8dad262e0a00fbca09b7779b4ebf0bf)

10 months agoavcodec/cavsdec: Propagate error codes inside decode_mb_i()
Michael Niedermayer [Sun, 4 Nov 2018 19:00:16 +0000 (20:00 +0100)]
avcodec/cavsdec: Propagate error codes inside decode_mb_i()

Fixes: Timeout
Fixes: 10702/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5669940938407936

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c1cee0565692c541f589aefd7f375d37f55b9d94)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 months agoavcodec/mpeg4videodec: Clear partitioned frame in decode_studio_vop_header()
Michael Niedermayer [Sun, 4 Nov 2018 18:02:55 +0000 (19:02 +0100)]
avcodec/mpeg4videodec: Clear partitioned frame in decode_studio_vop_header()

partitioned_frame is also set/cleared in decode_vop_header()

Fixes: out of array read
Fixes: 9789/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5638681627983872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 074187d599a2ece2bdf77bd08b4b797c5800eda6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 months agoavcodec/mpegaudio_parser: Consume more than 0 bytes in case of the unsupported mp3adu...
Michael Niedermayer [Sun, 28 Oct 2018 20:08:39 +0000 (21:08 +0100)]
avcodec/mpegaudio_parser: Consume more than 0 bytes in case of the unsupported mp3adu case

Fixes: Timeout
Fixes: 10966/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MP3ADU_fuzzer-5348695024336896
Fixes: 10969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MP3ADUFLOAT_fuzzer-5691669402877952

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit df91af140c5543cfbbed187f696e79b554d2c135)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 months agoavcodec/prosumer: Simplify bit juggling of the c variable in decompress()
Michael Niedermayer [Wed, 31 Oct 2018 09:19:43 +0000 (10:19 +0100)]
avcodec/prosumer: Simplify bit juggling of the c variable in decompress()

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 66425add270cd262a22c0fdaf6aad09a0db6f8c0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 months agoavcodec/prosumer: Remove always true check in decompress()
Michael Niedermayer [Wed, 31 Oct 2018 09:19:08 +0000 (10:19 +0100)]
avcodec/prosumer: Remove always true check in decompress()

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1dfa0b6f36d29293f2d0219c4095dc8bb7a4b0dc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 months agoavcodec/prosumer: Remove unneeded ()
Michael Niedermayer [Wed, 31 Oct 2018 09:18:45 +0000 (10:18 +0100)]
avcodec/prosumer: Remove unneeded ()

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 506839a3e9cc34c8f719937430008fc12d132fce)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 months agoavcodec/prosumer: Check for bytestream eof in decompress()
Michael Niedermayer [Wed, 31 Oct 2018 02:06:59 +0000 (03:06 +0100)]
avcodec/prosumer: Check for bytestream eof in decompress()

Fixes: Infinite loop
Fixes: 10685/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PROSUMER_fuzzer-5652236881887232

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9acdf17b2c30c44e6e6a3d3b3c22989b7e1117c3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 months agoavfilter/vf_cuda_yadif: Avoid new syntax for vector initialisation
Philip Langdale [Fri, 2 Nov 2018 21:08:18 +0000 (14:08 -0700)]
avfilter/vf_cuda_yadif: Avoid new syntax for vector initialisation

This requires a newer version of CUDA than we want to require.

(cherry picked from commit 8e50215b5e02074b0773dfcf55867654ee59c179)

10 months agoavcodec/nvdec: Increase frame pool size to help deinterlacing
Philip Langdale [Thu, 25 Oct 2018 01:38:44 +0000 (18:38 -0700)]
avcodec/nvdec: Increase frame pool size to help deinterlacing

With the cuda yadif filter in use, the number of mapped decoder
frames could increase by two, as the filter holds on to additional
frames.

(cherry picked from commit 1b41115ef70896d9b98ce842dc5f21c465396ce2)

10 months agoavfilter/vf_yadif_cuda: CUDA accelerated yadif deinterlacer
Philip Langdale [Sun, 21 Oct 2018 20:49:16 +0000 (13:49 -0700)]
avfilter/vf_yadif_cuda: CUDA accelerated yadif deinterlacer

This is a cuda implementation of yadif, which gives us a way to
do deinterlacing when using the nvdec hwaccel. In that scenario
we don't have access to the nvidia deinterlacer.

(cherry picked from commit d5272e94ab22bfc8f01fa3174e2c4664161ddf5a)

10 months agolibavfilter/vf_yadif: Make frame management logic and options shareable
Philip Langdale [Wed, 24 Oct 2018 18:52:42 +0000 (11:52 -0700)]
libavfilter/vf_yadif: Make frame management logic and options shareable

I'm writing a cuda implementation of yadif, and while this
obviously has a very different implementation of the actual
filtering, all the frame management is unchanged. To avoid
duplicating that logic, let's make it shareable.

From the perspective of the existing filter, the only real change
is introducing a function pointer for the filter() function so it
can be specified for the specific filter.

(cherry picked from commit 598f0f39271d6033588b4d8ccc672c5bdc85fec7)

10 months agofate/api-h264-slice-test: use cleaner error handling
Josh de Kock [Tue, 30 Oct 2018 14:38:42 +0000 (14:38 +0000)]
fate/api-h264-slice-test: use cleaner error handling

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

10 months agofate/api-h264-slice-test: don't use ssize_t
Josh de Kock [Tue, 30 Oct 2018 14:38:41 +0000 (14:38 +0000)]
fate/api-h264-slice-test: don't use ssize_t

Fixes ticket #7521

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

10 months agoRELEASE_NOTES: Based on the version from 4.0
Michael Niedermayer [Fri, 2 Nov 2018 00:36:21 +0000 (01:36 +0100)]
RELEASE_NOTES: Based on the version from 4.0

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 months agoUpdate for 4.1
Michael Niedermayer [Fri, 2 Nov 2018 00:33:08 +0000 (01:33 +0100)]
Update for 4.1

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 months agoBump minor versions for branching 4.1
Michael Niedermayer [Thu, 1 Nov 2018 23:15:32 +0000 (00:15 +0100)]
Bump minor versions for branching 4.1

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 months agoChangelog: next is 4.1
Michael Niedermayer [Thu, 1 Nov 2018 22:54:35 +0000 (23:54 +0100)]
Changelog: next is 4.1

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 months agodoc/APIchanges: Update for 4.1
Michael Niedermayer [Thu, 1 Nov 2018 22:53:01 +0000 (23:53 +0100)]
doc/APIchanges: Update for 4.1

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 months agoavformat/ftp: return AVERROR_EOF for EOF
Marton Balint [Thu, 1 Nov 2018 19:48:55 +0000 (20:48 +0100)]
avformat/ftp: return AVERROR_EOF for EOF

Without this FTP just hangs on eof...

Signed-off-by: Marton Balint <cus@passwd.hu>
10 months agoavdevice/libndi_newtek_dec: add extra_ips option to libndi_newtek allowing use remote...
Anton Platov [Mon, 29 Oct 2018 12:57:31 +0000 (15:57 +0300)]
avdevice/libndi_newtek_dec: add extra_ips option to libndi_newtek allowing use remote network sources

Signed-off-by: Anton Platov <anton@platov.net>
Signed-off-by: Marton Balint <cus@passwd.hu>
10 months agoavdevice/decklink_dec: fix codec_tag of RGBA formats
BIGLER Don (Framatome) [Thu, 1 Nov 2018 16:49:37 +0000 (17:49 +0100)]
avdevice/decklink_dec: fix codec_tag of RGBA formats

Fixes ticket #7505.

Signed-off-by: Marton Balint <cus@passwd.hu>
10 months agodoc/filter: add some loop filter trivial examples
Paul B Mahol [Thu, 1 Nov 2018 12:50:51 +0000 (13:50 +0100)]
doc/filter: add some loop filter trivial examples

10 months agoavcodec/vdpau: Initialise driver version variable explicitly
Philip Langdale [Wed, 31 Oct 2018 23:58:09 +0000 (16:58 -0700)]
avcodec/vdpau: Initialise driver version variable explicitly

If the identification string ever changed, we might not match anything
in the sscanf(). At least have predictable behaviour.