]> git.sesse.net Git - ffmpeg/log
ffmpeg
7 years agoavcodec/htmlsubtitles: Replace very slow redundant sscanf() calls by cleaner and...
Michael Niedermayer [Sun, 11 Jun 2017 15:58:45 +0000 (17:58 +0200)]
avcodec/htmlsubtitles: Replace very slow redundant sscanf() calls by cleaner and faster code

This reduces the worst case from O(n²) to O(n) time

Fixes Timeout
Fixes: 2127/clusterfuzz-testcase-minimized-6595787859427328
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/takdec: Fixes: integer overflow in AV_SAMPLE_FMT_U8P output
Michael Niedermayer [Sun, 18 Jun 2017 12:37:19 +0000 (14:37 +0200)]
avcodec/takdec: Fixes: integer overflow in AV_SAMPLE_FMT_U8P output

Fixes: runtime error: signed integer overflow: 2147483543 + 128 cannot be represented in type 'int'
Fixes: 2234/clusterfuzz-testcase-minimized-6266896041115648
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/iff: Cleanup on init failure
Michael Niedermayer [Sun, 18 Jun 2017 12:05:12 +0000 (14:05 +0200)]
avcodec/iff: Cleanup on init failure

Fixes: memleak
Fixes: 2272/clusterfuzz-testcase-minimized-5059103858622464
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agolibavformat/file: return AVERROR_EOF on EOF
Daniel Kucera [Mon, 5 Jun 2017 18:30:16 +0000 (20:30 +0200)]
libavformat/file: return AVERROR_EOF on EOF

Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agolibavformat/subfile: return AVERROR_EOF on EOF
Daniel Kucera [Mon, 5 Jun 2017 18:32:39 +0000 (20:32 +0200)]
libavformat/subfile: return AVERROR_EOF on EOF

Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/jpeg2000dsp: Reorder operations in ict_int() to avoid 2 integer overflows
Michael Niedermayer [Sat, 17 Jun 2017 13:06:21 +0000 (15:06 +0200)]
avcodec/jpeg2000dsp: Reorder operations in ict_int() to avoid 2 integer overflows

Fixes: runtime error: signed integer overflow: 58065 * 51981 cannot be represented in type 'int'
Fixes: 2271/clusterfuzz-testcase-minimized-5778297776504832
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/hevcpred_template: Fix left shift of negative value
Michael Niedermayer [Sat, 17 Jun 2017 12:54:19 +0000 (14:54 +0200)]
avcodec/hevcpred_template: Fix left shift of negative value

Fixes: runtime error: left shift of negative value -1
Fixes: 2250/clusterfuzz-testcase-minimized-5693382112313344
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavformat/libssh: check the user provided a password before trying to use it
James Almer [Sun, 11 Jun 2017 17:17:30 +0000 (14:17 -0300)]
avformat/libssh: check the user provided a password before trying to use it

Fixes ticket #6413

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
7 years agoavcodec/hevcdec: Fix signed integer overflow in decode_lt_rps()
Michael Niedermayer [Fri, 16 Jun 2017 22:34:08 +0000 (00:34 +0200)]
avcodec/hevcdec: Fix signed integer overflow in decode_lt_rps()

Fixes: runtime error: signed integer overflow: 2147483647 + 6 cannot be represented in type 'int'
Fixes: 2263/clusterfuzz-testcase-minimized-4800359627227136
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/gdv: Fix undefined shift
Michael Niedermayer [Fri, 16 Jun 2017 21:31:42 +0000 (23:31 +0200)]
avcodec/gdv: Fix undefined shift

Fixes: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 2249/clusterfuzz-testcase-minimized-5388542379294720
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/jpeg2000dec: Check nonzerobits more completely
Michael Niedermayer [Fri, 16 Jun 2017 17:57:08 +0000 (19:57 +0200)]
avcodec/jpeg2000dec: Check nonzerobits more completely

Fixes: runtime error: shift exponent 36 is too large for 32-bit type 'int'
Fixes: 2239/clusterfuzz-testcase-minimized-5639766592716800
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/wavpack: Change wp_log2() to unsigned
Michael Niedermayer [Fri, 9 Jun 2017 11:49:30 +0000 (13:49 +0200)]
avcodec/wavpack: Change wp_log2() to unsigned

Fixes: runtime error: signed integer overflow: 2143315325 + 4186162 cannot be represented in type 'int'
Fixes: 2134/clusterfuzz-testcase-minimized-4619258405322752
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/shorten: Sanity check maxnlpc
Michael Niedermayer [Fri, 9 Jun 2017 00:16:54 +0000 (02:16 +0200)]
avcodec/shorten: Sanity check maxnlpc

Fixes OOM
Fixes: 2131/clusterfuzz-testcase-minimized-4718045157130240
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoconfigure: use -x instead of -wN ..@ to strip assembly files
Rostislav Pehlivanov [Tue, 16 May 2017 11:08:37 +0000 (12:08 +0100)]
configure: use -x instead of -wN ..@ to strip assembly files

Reduces the amount of debugging information of external asm from
uselessly verbose to informative enough.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Reviewed-by: James Darnley <james.darnley@gmail.com>
7 years agoavcodec/aacps: move checks for valid length outside the stereo_interpolate dsp function
James Almer [Sat, 3 Jun 2017 17:01:46 +0000 (14:01 -0300)]
avcodec/aacps: move checks for valid length outside the stereo_interpolate dsp function

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agox86/vorbisdsp: optimize ff_vorbis_inverse_coupling_sse
James Almer [Fri, 16 Jun 2017 02:20:05 +0000 (23:20 -0300)]
x86/vorbisdsp: optimize ff_vorbis_inverse_coupling_sse

About 7% faster.

7 years agoavcodec/parser: assert that there is a past buffer if theres a reference into the...
Michael Niedermayer [Thu, 15 Jun 2017 23:35:35 +0000 (01:35 +0200)]
avcodec/parser: assert that there is a past buffer if theres a reference into the past

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/truemotion2: Move skip computation after checks
Michael Niedermayer [Thu, 15 Jun 2017 21:41:46 +0000 (23:41 +0200)]
avcodec/truemotion2: Move skip computation after checks

Fixes: runtime error: signed integer overflow: 630067357 * 4 cannot be represented in type 'int'
Fixes: 2233/clusterfuzz-testcase-minimized-5943031318446080
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/jpeg2000: Fixes integer overflow in ff_jpeg2000_ceildivpow2()
Michael Niedermayer [Thu, 15 Jun 2017 21:26:18 +0000 (23:26 +0200)]
avcodec/jpeg2000: Fixes integer overflow in ff_jpeg2000_ceildivpow2()

Fixes: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 2231/clusterfuzz-testcase-minimized-4565181982048256
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/dnxhd_parser: Do not return invalid value from dnxhd_find_frame_end() on...
Michael Niedermayer [Wed, 14 Jun 2017 14:58:20 +0000 (16:58 +0200)]
avcodec/dnxhd_parser: Do not return invalid value from dnxhd_find_frame_end() on error

Fixes: Null pointer dereference
Fixes: CVE-2017-9608
Found-by: Yihan Lian
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agovc2enc: decrease default strictness level
Rostislav Pehlivanov [Thu, 15 Jun 2017 17:30:08 +0000 (18:30 +0100)]
vc2enc: decrease default strictness level

Given how incredibly limited the official specifications are (limiting all use
to only the most common broadcasting formats), permit all supported inputs
by default. This makes the encoder more useful.

7 years agovorbisenc: Stop tracking number of samples per frame
Tyler Jones [Wed, 14 Jun 2017 20:59:07 +0000 (14:59 -0600)]
vorbisenc: Stop tracking number of samples per frame

Each frame is now padded with 0 values if not enough samples are
present, and all frames are guaranteed to have exactly
1 << (venc->log2_blocksize[1] - 1) samples.

Signed-off-by: Tyler Jones <tdjones879@gmail.com>
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
7 years agovorbisenc: Apply and output correct length window and mdct
Tyler Jones [Wed, 14 Jun 2017 20:58:55 +0000 (14:58 -0600)]
vorbisenc: Apply and output correct length window and mdct

Usage of blocksize, window, mode, and mdct indexes are switched from
default 0 to a default of 1 to better align with specs. A flag of 0
should correspond with short windows, a flag of 1 with long.

Signed-off-by: Tyler Jones <tdjones879@gmail.com>
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
7 years agovorbisenc: Separate copying audio samples from windowing
Tyler Jones [Wed, 14 Jun 2017 20:58:22 +0000 (14:58 -0600)]
vorbisenc: Separate copying audio samples from windowing

Audio samples are shifted around when copying from the frame queue so that
analysis can be done without negatively impacting calculation of the MDCT.

Window coefficients are applied to the current two overlapped windows
simultaneously instead of applying overlap for the next frame ahead of time.
This improves readability when applying windows of varying lengths.

Signed-off-by: Tyler Jones <tdjones879@gmail.com>
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
7 years agoavfilter/af_headphone: fix possible memory leaks on failure
Paul B Mahol [Thu, 15 Jun 2017 09:19:12 +0000 (11:19 +0200)]
avfilter/af_headphone: fix possible memory leaks on failure

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/hevcdec: Check nb_sps
Michael Niedermayer [Wed, 14 Jun 2017 23:28:28 +0000 (01:28 +0200)]
avcodec/hevcdec: Check nb_sps

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/hevc_refs: Check nb_refs in add_candidate_ref()
Michael Niedermayer [Wed, 14 Jun 2017 23:26:01 +0000 (01:26 +0200)]
avcodec/hevc_refs: Check nb_refs in add_candidate_ref()

Fixes: runtime error: index 16 out of bounds for type 'int [16]'
Fixes: 2209/clusterfuzz-testcase-minimized-5012343912136704
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavutil/tests: remove float_dsp test
James Almer [Thu, 1 Jun 2017 22:56:17 +0000 (19:56 -0300)]
avutil/tests: remove float_dsp test

It's been ported to checkasm.

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agocheckasm: add float_dsp tests
James Almer [Tue, 11 Apr 2017 20:16:56 +0000 (17:16 -0300)]
checkasm: add float_dsp tests

Ported from libavutil/tests/float_dsp.c

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agocheckasm: add a checkasm_checked_call function that doesn't issue emms
James Almer [Thu, 1 Jun 2017 21:50:49 +0000 (18:50 -0300)]
checkasm: add a checkasm_checked_call function that doesn't issue emms

Meant for DSP functions returning a float or double, as they'd fail if emms
is called after every run on x86_32.

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agoavcodec/mpeg4videodec: Check sprite delta upshift against overflowing.
Michael Niedermayer [Wed, 14 Jun 2017 21:55:17 +0000 (23:55 +0200)]
avcodec/mpeg4videodec: Check sprite delta upshift against overflowing.

Fixes: runtime error: signed integer overflow: -268386304 * 16 cannot be represented in type 'int'
Fixes: 2204/clusterfuzz-testcase-minimized-5616756909408256
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/mpeg4videodec: Fix integer overflow in num_sprite_warping_points=2 case
Michael Niedermayer [Wed, 14 Jun 2017 21:49:23 +0000 (23:49 +0200)]
avcodec/mpeg4videodec: Fix integer overflow in num_sprite_warping_points=2 case

Fixes: runtime error: signed integer overflow: 131072 + 2147352576 cannot be represented in type 'int'
Fixes: 2192/clusterfuzz-testcase-minimized-5370387988742144
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/dnxhdenc: Assert that frame size is not assigned an error code
Michael Niedermayer [Wed, 14 Jun 2017 14:58:35 +0000 (16:58 +0200)]
avcodec/dnxhdenc: Assert that frame size is not assigned an error code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agohevc: Fix scaling list prediction delta for the 32x32 inter matrix
Mark Thompson [Sun, 30 Apr 2017 12:21:03 +0000 (13:21 +0100)]
hevc: Fix scaling list prediction delta for the 32x32 inter matrix

Fixes ticket #6356.

7 years agodoc: Document hwupload, hwdownload and hwmap filters
Mark Thompson [Sun, 30 Apr 2017 21:11:54 +0000 (22:11 +0100)]
doc: Document hwupload, hwdownload and hwmap filters

(cherry picked from commit 66aa9b94dae217a0fc5acfb704490707629d95ed)

7 years agovf_hwmap: Add reverse mapping for hardware frames
Mark Thompson [Sat, 4 Mar 2017 23:57:42 +0000 (23:57 +0000)]
vf_hwmap: Add reverse mapping for hardware frames

This is something of a hack.  It allocates a new hwframe context for
the target format, then maps it back to the source link and overwrites
the input link hw_frames_ctx so that the previous filter will receive
the frames we want from ff_get_video_buffer().  It may fail if
the previous filter imposes any additional constraints on the frames
it wants to use as output.

(cherry picked from commit 81a4cb8e58636d4efd200c2b4fec786a7e948d8b)

7 years agovf_hwmap: Add device derivation
Mark Thompson [Sat, 4 Mar 2017 23:57:41 +0000 (23:57 +0000)]
vf_hwmap: Add device derivation

Also refactor a little and improve error messages to make failure
cases easier to understand.

(cherry picked from commit 38cb05f1c89cae1862b360d4e7e3f0cd2b5bbb67)

7 years agohwcontext: Improve allocation in derived contexts
Mark Thompson [Sat, 4 Mar 2017 23:57:40 +0000 (23:57 +0000)]
hwcontext: Improve allocation in derived contexts

Use the flags argument of av_hwframe_ctx_create_derived() to pass the
mapping flags which will be used on allocation.  Also, set the format
and hardware context on the allocated frame automatically - the user
should not be required to do this themselves.

(cherry picked from commit c5714b51aad41fef56dddac1d542e7fc6b984627)

7 years agohwcontext_qsv: Implement mapping frames to the child device type
Mark Thompson [Sat, 4 Mar 2017 23:57:45 +0000 (23:57 +0000)]
hwcontext_qsv: Implement mapping frames to the child device type

(cherry picked from commit e1c5d56b18b82e3fb42382b1b1f972e8b371fc38)

7 years agohwcontext_qsv: Implement mapping frames from the child device type
Mark Thompson [Sat, 4 Mar 2017 23:57:44 +0000 (23:57 +0000)]
hwcontext_qsv: Implement mapping frames from the child device type

Factorises out existing surface initialisation code to reuse.

(cherry picked from commit eaa5e0710496db50fc164806e5f49eaaccc83bb5)

7 years agohwcontext: Add frame context mapping for nontrivial contexts
Mark Thompson [Sat, 4 Mar 2017 23:57:39 +0000 (23:57 +0000)]
hwcontext: Add frame context mapping for nontrivial contexts

Some frames contexts are not usable without additional format-specific
state in hwctx.  This change adds new functions frames_derive_from and
frames_derive_to to initialise this state appropriately when deriving
a frames context which will require it to be set.

(cherry picked from commit 27978155bc661eec9f22bcf82c9cfc099cff4365)

7 years agohwcontext_qsv: Support derivation from child devices
Mark Thompson [Sat, 4 Mar 2017 23:57:43 +0000 (23:57 +0000)]
hwcontext_qsv: Support derivation from child devices

(cherry picked from commit aa51bb3d2756ed912ee40645efccf5f4a9609696)

7 years agoffmpeg: Support setting the hardware device to use when filtering
Mark Thompson [Sat, 4 Mar 2017 23:57:38 +0000 (23:57 +0000)]
ffmpeg: Support setting the hardware device to use when filtering

This only supports one device globally, but more can be used by
passing them with input streams in hw_frames_ctx or by deriving new
devices inside a filter graph with hwmap.

(cherry picked from commit e669db76108de8d7a36c2274c99da82cc94d1dd1)

7 years agovaapi: Add external control of allow-profile-mismatch
Mark Thompson [Mon, 27 Mar 2017 19:46:11 +0000 (20:46 +0100)]
vaapi: Add external control of allow-profile-mismatch

Uses the just-added ALLOW_PROFILE_MISMATCH flag.

(cherry picked from commit 7acb90333a187b0e847b66f9d3511245423dc0ce)

7 years agolavc: Add flag to allow profile mismatch with hardware decoding
Mark Thompson [Mon, 27 Mar 2017 19:45:21 +0000 (20:45 +0100)]
lavc: Add flag to allow profile mismatch with hardware decoding

(cherry picked from commit 64a5260c695dd8051509d3270295fd64eac56587)

7 years agovaapi_encode: Use gop_size consistently in RC parameters
Mark Thompson [Sun, 2 Apr 2017 22:05:13 +0000 (23:05 +0100)]
vaapi_encode: Use gop_size consistently in RC parameters

The non-H.26[45] codecs already use this form.  Since we don't
currently generate I frames for codecs which support them separately
to IDR, the p_per_i variable is set to infinity by default so that it
doesn't interfere with any other calculation.  (All the code for I
frames still exists, and it works for H.264 if set manually.)

(cherry picked from commit 6af014f4028238b4c50f1731b3369a41d65fa9c4)

7 years agoqsvenc: Allow use of hw_device_ctx to make the internal session
Mark Thompson [Sat, 4 Mar 2017 23:57:37 +0000 (23:57 +0000)]
qsvenc: Allow use of hw_device_ctx to make the internal session

(cherry picked from commit 3d197514e613ccd9eab43180c0a7c8b09a307606)

7 years agoqsvdec: Allow use of hw_device_ctx to make the internal session
Mark Thompson [Sat, 4 Mar 2017 23:57:36 +0000 (23:57 +0000)]
qsvdec: Allow use of hw_device_ctx to make the internal session

(cherry picked from commit 8848ba0bd6b035af77d4f13aa0d8aaaad9806fe8)

7 years agoqsv: Add ability to create a session from a device
Mark Thompson [Sat, 4 Mar 2017 23:57:35 +0000 (23:57 +0000)]
qsv: Add ability to create a session from a device

(cherry picked from commit 4936a48b1e6fc2147599541f8b25f43a8a9d1f16)

7 years agovf_deinterlace_vaapi: Add support for field rate output
Mark Thompson [Mon, 27 Feb 2017 21:29:46 +0000 (21:29 +0000)]
vf_deinterlace_vaapi: Add support for field rate output

In order to work correctly with the i965 driver, this also fixes the
direction of forward/backward references - forward references are
intended to be those from the past to the current frame, not from the
current frame to the future.

(cherry picked from commit 9aa251c98ce60e5ee83156e5292547a7671ced3a)

7 years agoffmpeg: Document the -init_hw_device option
Mark Thompson [Sun, 19 Mar 2017 16:25:37 +0000 (16:25 +0000)]
ffmpeg: Document the -init_hw_device option

(cherry picked from commit 303fadf5963e01b8edf4ba2701e45f7e9e586aeb)

7 years agoffmpeg: Enable generic hwaccel support for VDPAU
Mark Thompson [Sat, 4 Mar 2017 23:57:34 +0000 (23:57 +0000)]
ffmpeg: Enable generic hwaccel support for VDPAU

(cherry picked from commit aa6b2e081c504cb99f5e2e0ceb45295ef24bdac2)

7 years agoffmpeg: Enable generic hwaccel support for VAAPI
Mark Thompson [Sat, 4 Mar 2017 23:57:31 +0000 (23:57 +0000)]
ffmpeg: Enable generic hwaccel support for VAAPI

(cherry picked from commit 62a1ef9f26c654a3e988aa465c4ac1d776c4c356)

7 years agoffmpeg: Generic device setup
Mark Thompson [Sat, 4 Mar 2017 23:57:30 +0000 (23:57 +0000)]
ffmpeg: Generic device setup

Not yet enabled for any hwaccels.

(cherry picked from commit d2e6dd32a445b5744a51d090c0822dbd7e434592)
(cherry picked from commit 9203aac22874c7259e155b7d00f1f33bb1355129)

7 years agohwcontext: Make it easier to work with device types
Mark Thompson [Sat, 4 Mar 2017 23:57:29 +0000 (23:57 +0000)]
hwcontext: Make it easier to work with device types

Adds functions to convert to/from strings and a function to iterate
over all supported device types.  Also adds a new invalid type
AV_HWDEVICE_TYPE_NONE, which acts as a sentinel value.

(cherry picked from commit b7487f4f3c39b4b202e1ea7bb2de13902f2dee45)

7 years agohwcontext: Add device derivation
Mark Thompson [Sat, 4 Mar 2017 23:57:28 +0000 (23:57 +0000)]
hwcontext: Add device derivation

Creates a new device context from another of a different type which
refers to the same underlying hardware.

(cherry picked from commit b266ad56fe0e4ce5bb70118ba2e2b1dabfaf76ce)

7 years agovaapi_encode: Discard output buffer if picture submission fails
Mark Thompson [Thu, 16 Feb 2017 00:02:29 +0000 (00:02 +0000)]
vaapi_encode: Discard output buffer if picture submission fails

Previously this was leaking, though it actually hit an assert making
sure that the buffer had already been cleared when freeing the picture.

(cherry picked from commit 17aeee5832b9188b570c3d3de4197e4cdc54c634)

7 years agohwcontext_vaapi: Try to support the VDPAU wrapper
Mark Thompson [Mon, 30 Jan 2017 19:11:28 +0000 (19:11 +0000)]
hwcontext_vaapi: Try to support the VDPAU wrapper

The driver is somewhat bitrotten (not updated for years) but is still
usable for decoding with this change.  To support it, this adds a new
driver quirk to indicate no support at all for surface attributes.

Based on a patch by wm4 <nfxjfg@googlemail.com>.

(cherry picked from commit e791b915c774408fbc0ec9e7270b021899e08ccc)

7 years agolavc/aarch64/simple_idct: fix build with Xcode 7.2
Matthieu Bouron [Wed, 14 Jun 2017 11:28:18 +0000 (13:28 +0200)]
lavc/aarch64/simple_idct: fix build with Xcode 7.2

7 years agovp9: fix overwrite in ff_vp9_ipred_dr_16x16_16_avx2.
Ronald S. Bultje [Wed, 14 Jun 2017 13:44:26 +0000 (09:44 -0400)]
vp9: fix overwrite in ff_vp9_ipred_dr_16x16_16_avx2.

Fixes trac issue 6459.

7 years agoavfilter/vf_signature: fix memory leaks in error cases
Timo Rothenpieler [Sun, 11 Jun 2017 13:29:35 +0000 (15:29 +0200)]
avfilter/vf_signature: fix memory leaks in error cases

Fixes CIDs 1403234 and 1403235

7 years agoavformat/pcmdec: fix memory leak
Timo Rothenpieler [Sun, 11 Jun 2017 13:19:17 +0000 (15:19 +0200)]
avformat/pcmdec: fix memory leak

Fixes CID 1396267

7 years agoavformat/librtmp: check return value of setsockopt
Timo Rothenpieler [Sun, 11 Jun 2017 13:08:43 +0000 (15:08 +0200)]
avformat/librtmp: check return value of setsockopt

Fixes CID 1396837

7 years agoavfilter/vf_scale_npp: fix out-of-bounds reads
Timo Rothenpieler [Sun, 11 Jun 2017 12:56:44 +0000 (14:56 +0200)]
avfilter/vf_scale_npp: fix out-of-bounds reads

Fixes CIDs 1396414 and 1396415

7 years agoavfilter/unsharp: fix uninitialized pointer read
Timo Rothenpieler [Sun, 11 Jun 2017 12:50:01 +0000 (14:50 +0200)]
avfilter/unsharp: fix uninitialized pointer read

Fixes CID 1396855

7 years agolavc/aarch64/simple_idct: fix idct_col4_top coefficient
Matthieu Bouron [Tue, 13 Jun 2017 15:19:51 +0000 (17:19 +0200)]
lavc/aarch64/simple_idct: fix idct_col4_top coefficient

Fixes regression introduced by 5d0b8b1ae307951310c7d9a8fa282fbca9b997cd.

7 years agoavcodec/aacsbr_fixed: Fix signed integer overflow in sbr_hf_inverse_filter()
Michael Niedermayer [Tue, 13 Jun 2017 15:10:30 +0000 (17:10 +0200)]
avcodec/aacsbr_fixed: Fix signed integer overflow in sbr_hf_inverse_filter()

Fixes: runtime error: signed integer overflow: 2147483584 + 128 cannot be represented in type 'int'
Fixes: 2164/clusterfuzz-testcase-minimized-4715936172998656
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/aacsbr_fixed: Check shift in sbr_hf_assemble()
Michael Niedermayer [Tue, 13 Jun 2017 14:25:59 +0000 (16:25 +0200)]
avcodec/aacsbr_fixed: Check shift in sbr_hf_assemble()

Fixes: runtime error: shift exponent -10 is negative
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/sbrdsp_fixed: Return an error from sbr_hf_apply_noise() if operations are...
Michael Niedermayer [Tue, 13 Jun 2017 11:28:23 +0000 (13:28 +0200)]
avcodec/sbrdsp_fixed: Return an error from sbr_hf_apply_noise() if operations are impossible

Fixes: 1775/clusterfuzz-testcase-minimized-5330288148217856
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavfilter: properly set SAR for A->V filters
Paul B Mahol [Tue, 13 Jun 2017 13:07:36 +0000 (15:07 +0200)]
avfilter: properly set SAR for A->V filters

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agolavc/mediacodecdec: switch to the new generic filtering mechanism
Matthieu Bouron [Fri, 9 Jun 2017 22:41:07 +0000 (00:41 +0200)]
lavc/mediacodecdec: switch to the new generic filtering mechanism

7 years agoavcodec/put_bits: Implement put_bits32() in a single pass instead of 2 passes writing...
Michael Niedermayer [Tue, 13 Jun 2017 01:18:21 +0000 (03:18 +0200)]
avcodec/put_bits: Implement put_bits32() in a single pass instead of 2 passes writing 16bits each

820 cpu cycles -> 660 cpu cycles for 100 put_bits32()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/golomb: Assert that the input is not too large in set_ue_golomb()
Michael Niedermayer [Tue, 13 Jun 2017 00:56:58 +0000 (02:56 +0200)]
avcodec/golomb: Assert that the input is not too large in set_ue_golomb()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agotools/sofa2wavs: add license header
Paul B Mahol [Mon, 12 Jun 2017 20:13:09 +0000 (22:13 +0200)]
tools/sofa2wavs: add license header

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/vp9: ipred_dr_16x16_16 avx2 implementation
Ilia Valiakhmetov [Sat, 10 Jun 2017 10:01:12 +0000 (17:01 +0700)]
avcodec/vp9: ipred_dr_16x16_16 avx2 implementation

Signed-off-by: Ilia Valiakhmetov <zakne0ne@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
7 years agotools: add sofa2wavs
Paul B Mahol [Fri, 9 Jun 2017 11:18:31 +0000 (13:18 +0200)]
tools: add sofa2wavs

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter: add native headphone spatialization filter
Paul B Mahol [Wed, 7 Jun 2017 19:23:14 +0000 (21:23 +0200)]
avfilter: add native headphone spatialization filter

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agox86inc: Add some additional cpuflag relations
Henrik Gramner [Sat, 6 May 2017 10:26:56 +0000 (12:26 +0200)]
x86inc: Add some additional cpuflag relations

Simplifies writing assembly code that depends on available instructions.

LZCNT implies SSE2
BMI1 implies AVX+LZCNT
AVX2 implies BMI2

7 years agoavcodec/libvpxdec: Check that display dimensions fit in the storage dimensions
Michael Niedermayer [Wed, 7 Jun 2017 17:17:30 +0000 (19:17 +0200)]
avcodec/libvpxdec: Check that display dimensions fit in the storage dimensions

Fixes assertion failure
Fixes: 2112/clusterfuzz-testcase-minimized-4526878557732864
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/avpacket: Limit iterations in ff_packet_split_and_drop_side_data()
Michael Niedermayer [Sun, 11 Jun 2017 20:08:04 +0000 (22:08 +0200)]
avcodec/avpacket: Limit iterations in ff_packet_split_and_drop_side_data()

This avoids scaning beyond what a valid packet can contain
Fixes: Timeout
Fixes: 541/clusterfuzz-testcase-610189291657625
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/jpeg2000dwt: Fix runtime error: left shift of negative value -123
Michael Niedermayer [Sun, 11 Jun 2017 18:28:46 +0000 (20:28 +0200)]
avcodec/jpeg2000dwt: Fix runtime error: left shift of negative value -123

Fixes: 2208/clusterfuzz-testcase-minimized-5976593765761024
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/wavpack: Fix runtime error: signed integer overflow: 1886191616 + 277872640...
Michael Niedermayer [Sun, 11 Jun 2017 18:19:59 +0000 (20:19 +0200)]
avcodec/wavpack: Fix runtime error: signed integer overflow: 1886191616 + 277872640 cannot be represented in type 'int'

Fixes: 2181/clusterfuzz-testcase-minimized-6314784322486272
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavformat/mov: add support for reading VP Codec Configuration Box
James Almer [Sat, 27 May 2017 21:58:15 +0000 (18:58 -0300)]
avformat/mov: add support for reading VP Codec Configuration Box

As defined in "VP Codec ISO Media File Format Binding v1.0"
https://github.com/webmproject/vp9-dash/blob/master/VPCodecISOMediaFileFormatBinding.md

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agoavcodec/snowdec: Fix runtime error: left shift of negative value -1
Michael Niedermayer [Sun, 11 Jun 2017 12:34:54 +0000 (14:34 +0200)]
avcodec/snowdec: Fix runtime error: left shift of negative value -1

Fixes: 2197/clusterfuzz-testcase-minimized-6010716676947968
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/aacdec_fixed: Fix runtime error: left shift of negative value -1297616
Michael Niedermayer [Sun, 11 Jun 2017 12:32:35 +0000 (14:32 +0200)]
avcodec/aacdec_fixed: Fix runtime error: left shift of negative value -1297616

Fixes: 2195/clusterfuzz-testcase-minimized-4736721533009920
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/gdv: fix compiler warnings
Paul B Mahol [Sun, 11 Jun 2017 08:26:18 +0000 (10:26 +0200)]
avcodec/gdv: fix compiler warnings

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavformat: add Gremlin Digital Video demuxer
Paul B Mahol [Fri, 2 Jun 2017 09:28:35 +0000 (11:28 +0200)]
avformat: add Gremlin Digital Video demuxer

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec: add Gremlin Digital Video decoder
Paul B Mahol [Fri, 2 Jun 2017 10:52:07 +0000 (12:52 +0200)]
avcodec: add Gremlin Digital Video decoder

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec: add Gremlin DPCM decoder
Paul B Mahol [Fri, 2 Jun 2017 10:43:02 +0000 (12:43 +0200)]
avcodec: add Gremlin DPCM decoder

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/tiff: Fix leak of geotags[].val
Michael Niedermayer [Sat, 10 Jun 2017 23:05:26 +0000 (01:05 +0200)]
avcodec/tiff: Fix leak of geotags[].val

Fixes: 2176/clusterfuzz-testcase-minimized-5908197216878592
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/fft_template: Fix multiple runtime error: signed integer overflow: -194391871...
Michael Niedermayer [Sat, 27 May 2017 10:21:25 +0000 (12:21 +0200)]
avcodec/fft_template: Fix multiple runtime error: signed integer overflow: -1943918714 - 1935113003 cannot be represented in type 'int'

Fixes: 1735/clusterfuzz-testcase-minimized-5350472347025408
This uses unsigned instead of SUINT because the later was rejected by multiple developers
See: [FFmpeg-devel] [PATCH] avcodec/fft_template: Fix multiple runtime error: signed integer overflow: -1943918714 - 1935113003 cannot be represented in type 'int'

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/ra144: Fix runtime error: signed integer overflow: -2200 * 1033073 cannot...
Michael Niedermayer [Sat, 10 Jun 2017 22:45:20 +0000 (00:45 +0200)]
avcodec/ra144: Fix runtime error: signed integer overflow: -2200 * 1033073 cannot be represented in type 'int'

Fixes: 2175/clusterfuzz-testcase-minimized-5809657849315328
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/flicvideo: Fix runtime error: signed integer overflow: 4864 * 459296 cannot...
Michael Niedermayer [Sat, 10 Jun 2017 17:43:25 +0000 (19:43 +0200)]
avcodec/flicvideo: Fix runtime error: signed integer overflow: 4864 * 459296 cannot be represented in type 'int'

Fixes: 2174/clusterfuzz-testcase-minimized-5739234533048320
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/cfhd: Check band parameters before storing them
Michael Niedermayer [Sat, 10 Jun 2017 16:45:08 +0000 (18:45 +0200)]
avcodec/cfhd: Check band parameters before storing them

Fixes out of array read
Fixes: 2169/clusterfuzz-testcase-minimized-5688641642823680
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agofate: add test for -time_base option
Michael Bradshaw [Fri, 9 Jun 2017 22:02:27 +0000 (15:02 -0700)]
fate: add test for -time_base option

Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/h264_parse: Check picture structure when initializing weight table
Michael Niedermayer [Fri, 9 Jun 2017 22:13:07 +0000 (00:13 +0200)]
avcodec/h264_parse: Check picture structure when initializing weight table

Fixes: runtime error: index 49 out of bounds for type 'int [48][2][2]'
Fixes: 2159/clusterfuzz-testcase-minimized-5267945972301824
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/dvbsubdec: Check pixel buffer size constraint from ETSI EN 300 743 V1.3.1
Michael Niedermayer [Fri, 9 Jun 2017 21:16:55 +0000 (23:16 +0200)]
avcodec/dvbsubdec: Check pixel buffer size constraint from ETSI EN 300 743 V1.3.1

Fixes: OOM
Fixes: 2143/clusterfuzz-testcase-minimized-5482288060039168
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/dvbsubdec: Use av_image_check_size2()
Michael Niedermayer [Fri, 9 Jun 2017 21:04:30 +0000 (23:04 +0200)]
avcodec/dvbsubdec: Use av_image_check_size2()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agolavf/mov.c: offset index timestamps by the minimum pts to make first pts zero
Sasi Inguva [Tue, 6 Jun 2017 18:16:01 +0000 (11:16 -0700)]
lavf/mov.c: offset index timestamps by the minimum pts to make first pts zero

If the videos starts with B frame, then the minimum composition time
as computed by stts + ctts will be non-zero. Hence we need to shift
the DTS, so that the first pts is zero. This was the intention of that
code-block. However it was subtracting by the wrong amount.

For example, for one of the videos in the bug nonFormatted.mp4 we have

stts:
sample_count  duration
960           1001

ctts:
sample_count  duration
1             3003
2             0
1             3003
....

The resulting composition times are :  3003, 1001, 2002, 6006, ...

The minimum composition time or PTS is 1001, which should be used to
offset DTS. However the code block was wrongly using ctts[0] which is
3003. Hence the PTS was negative. This change computes the minimum pts
encountered while fixing the index, and then subtracts it from all the
timestamps after the edit list fixes are applied.

Samples files available from:

https://bugs.chromium.org/p/chromium/issues/detail?id=721451
https://bugs.chromium.org/p/chromium/issues/detail?id=723537

fate-suite/h264/twofields_packet.mp4 is a similar file starting with 2
B frames. Before this change the PTS of first two B-frames was -6006
and -3003, and I am guessing one of them got dropped when being decoded
and remuxed  to the framecrc before, and now it is not being dropped.

Signed-off-by: Sasi Inguva <isasi@google.com>
7 years agovf_colorspace: Add a pixdesc API alias name for bt2020nc color space
Vittorio Giovara [Fri, 9 Jun 2017 00:00:19 +0000 (20:00 -0400)]
vf_colorspace: Add a pixdesc API alias name for bt2020nc color space