Commit Graph

38093 Commits

Author SHA1 Message Date
Michael Niedermayer
d2657d225c avcodec/flicvideo: Check for chunk overread
Fixes integer overflow
Fixes: 1292/clusterfuzz-testcase-minimized-5795512143839232

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-04 19:52:23 +02:00
Michael Niedermayer
c1c3a14073 libavcodec/mpeg4videodec: Convert sprite_offset to 64bit
This avoids intermediates from overflowing (the final values are checked)
Fixes: runtime error: signed integer overflow: -167712 + -2147352576 cannot be represented in type 'int'

Fixes: 1298/clusterfuzz-testcase-minimized-5955580877340672

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-04 19:49:45 +02:00
Michael Niedermayer
a0296fc056 avcodec/pngdec: Use ff_set_dimensions()
Fixes OOM
Fixes: 1314/clusterfuzz-testcase-minimized-4621997222920192

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-04 18:41:30 +02:00
Michael Niedermayer
cabfed6895 avcodec/msvideo1: Check buffer size before re-getting the frame
Fixes timeout
Fixes: 1306/clusterfuzz-testcase-minimized-6152296217968640

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-04 17:15:43 +02:00
Clément Bœsch
3f17751eeb Merge commit '11a9320de54759340531177c9f2b1e31e6112cc2'
* commit '11a9320de54759340531177c9f2b1e31e6112cc2':
  build: Move build-system-related helper files to a separate subdirectory

"ffbuild" directory name is used instead of "avbuild".

Merged-by: Clément Bœsch <u@pkh.me>
2017-05-03 16:49:12 +02:00
Michael Niedermayer
48b3117844 avcodec/svq3: Reject dx/dy beyond 16bit
The code does use 16bit sized arrays later so larger deltas would not work

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-03 11:57:34 +02:00
Michael Niedermayer
382b4fc9b5 avcodec/svq3: Increase offsets to prevent integer overflows
Fixes: 1280/clusterfuzz-testcase-minimized-6102353767825408

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-03 11:57:34 +02:00
Carl Eugen Hoyos
a75ef1506a lavc/jpeg2000dec: Fix jp2 inner atom size used for overread checks. 2017-05-03 03:45:33 +02:00
James Almer
b3570f0389 avcodec/decode: also check for FF_CODEC_CAP_SETS_PKT_DTS in audio decoders
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-02 20:47:33 -03:00
Muhammad Faiz
9b4648a2cd avcodec/decode: do not treat discarded frames as eof when draining
Fix fate failures:
    make fate-mov THREADS=32

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-05-03 01:31:48 +07:00
James Almer
0a6ca7aa0a avcodec/internal: update FF_CODEC_CAP_SETS_PKT_DTS doxy
The code it refers to was moved to decode.c in 00fb745a10
2017-05-01 20:38:34 -03:00
Carl Eugen Hoyos
f4c133c708 lavc/mips/iirfilter_mips: Include config.h.
Fixes the following warning:
libavcodec/mips/iirfilter_mips.c:57:5: warning: "HAVE_INLINE_ASM" is not defined
2017-05-01 23:46:28 +02:00
Carl Eugen Hoyos
a88b0b0ba7 lavc/mips/hevc_idct_msa: Add missing const qualifier.
Fixes many warnings:
initialization discards 'const' qualifier from pointer target type
2017-05-01 23:44:21 +02:00
Michael Niedermayer
b29feec982 avcodec/indeo2: Check remaining bits in ir2_decode_plane()
Fixes: 1290/clusterfuzz-testcase-minimized-5815578902134784
Fixes: timeout

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-01 18:54:41 +02:00
Michael Niedermayer
2f00300b77 avcodec/vp3: Check remaining bits in unpack_dct_coeffs()
Decreases the time spend decoding junk.

May fix: 1283/clusterfuzz-testcase-minimized-6221126759874560

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-01 18:48:39 +02:00
Michael Niedermayer
63b8d4146d avcodec/bmp: Use ff_set_dimensions()
Fixes out of memory

Fixes: 1282/clusterfuzz-testcase-minimized-5400131681648640

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-01 17:55:22 +02:00
Martin Vignali
37f4d22075 libavcodec/exr : fix piz uncompress on big endian
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-01 11:40:57 +02:00
James Almer
cac8de2da5 avcodec/options: do a more thorough clean up in avcodec_copy_context()
Free coded_frame, coded_side_data and unref hw_device_ctx to prevent
potential leaks.

Reviewed-by: Aaron Levinson <alevinsn@aracnet.com>
Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-30 23:18:05 -03:00
James Almer
54a4c9b4e9 avcodec/options: factorize avcodec_copy_context() cleanup code
Reviewed-by: Aaron Levinson <alevinsn@aracnet.com>
Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-30 23:18:04 -03:00
Muhammad Faiz
d535e0c140 avcodec/pthread_frame, decode: allow errors to happen on draining
So, all frames and errors are correctly reported in order.
Also limit the numbers of error during draining to prevent infinite loop.

This fix fate failure with THREADS>=4:
  make fate-h264-attachment-631 THREADS=4
This also reverts a755b725ec.

Suggested-by: wm4, Ronald S. Bultje, Marton Balint
Reviewed-by: w4 <nfxjfg@googlemail.com>
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-04-30 05:48:21 +07:00
James Zern
1bee78a019 libvpxenc: allow aq-mode 4 (equator360)
this was added in 1.6.0

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Zern <jzern@google.com>
2017-04-28 17:56:09 -07:00
Rostislav Pehlivanov
f7542d7e35 opus_pvq: use function pointers for recursion
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-27 05:50:39 +01:00
James Almer
453f8ea242 avcodec/opus_pvq: fix recursive inlining compilation failures
They were introduced by f16180f448
2017-04-27 00:33:24 -03:00
Michael Niedermayer
6ca82975b7 avcodec/mdec: Fix runtime error: left shift of negative value -127
Fixes undefined behavior
Fixes: 1275/clusterfuzz-testcase-minimized-6718162017976320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-27 04:25:31 +02:00
Michael Niedermayer
fa8fd0808f avcodec/x86/vc1dsp_init: Fix build failure with --disable-optimizations and clang
compilers doing DCE at -O0 do not necessarily understand "complex" boolean expressions
Build succeeds with this change, this was the only failure

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-27 04:25:31 +02:00
Martin Vignali
e46d637452 libavcodec/exr : fix float to uint16 conversion for negative float value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-27 04:25:31 +02:00
Rostislav Pehlivanov
f16180f448 opus_pvq: merge band encoding and decoding into one function
Most code between the 2 functions was duplicated which made keeping
both in sync difficult.

This also fixes some discovered issues with encoding (incorrect
TF switching buffers) and reduces stack usage (reuse the already
allocated CeltFrame->scratch buffer for the quantized coefficients).

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-27 02:18:32 +01:00
Rostislav Pehlivanov
18a0d9d7ad opus_pvq: remove outdated/incorrect comments and redundant variables
Removes the last style issues with opus_pvq.c

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-26 23:54:21 +01:00
Rostislav Pehlivanov
4d59de3991 opus_pvq: minor cleanups
Removes unneeded variables, renames confusing and innacurate variables
and rewrites and slightly optimizes hadamard interleave/deinterleave
functions.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-26 23:22:25 +01:00
Ben Chang
8de3458a07 avcodec/nvenc: surface allocation reduction
This patch aims to reduce the number of input/output surfaces
NVENC allocates per session. Previous default sets allocated surfaces to 32
(unless there is user specified param or lookahead involved). Having large
number of surfaces consumes extra video memory (esp for higher resolution
encoding). The patch changes the surfaces calculation for default, B-frames,
lookahead scenario respectively.

The other change involves surface selection. Previously, if a session
allocates x surfaces, only x-1 surfaces are used (due to combination
of output delay and lock toggle logic). To prevent unused surfaces,
changing surface rotation to using predefined fifo.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2017-04-26 21:57:54 +02:00
Clément Bœsch
78a5fc4579 lavc/hevcdec: fix invalid use of ff_get_format()
Regression since 76cc100afb.

Spotted-by: James Almer <jamrial@gmail.com>
2017-04-26 17:35:28 +02:00
Clément Bœsch
84a368f6fe Merge commit '373fd76b4dbd9aa03ed28e502f33f2ca8c1ce19a'
* commit '373fd76b4dbd9aa03ed28e502f33f2ca8c1ce19a':
  hevcdec: do not set decoder-global SPS prematurely

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-26 17:25:54 +02:00
Clément Bœsch
0f00eb0e4e Merge commit '2425d7329fdccfa9954faba748f3865151354f0c'
* commit '2425d7329fdccfa9954faba748f3865151354f0c':
  arm64: replace 'bic' with immediate with 'and' with inverted immediate

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-26 16:28:57 +02:00
Clément Bœsch
172b0e2e88 Merge commit 'ea7ee4b4e381e0fa731458de0cbf740430eeb013'
* commit 'ea7ee4b4e381e0fa731458de0cbf740430eeb013':
  ppc: Centralize compiler-specific altivec.h #include handling in one place

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-26 16:23:28 +02:00
Clément Bœsch
3a033bc5cf Merge commit '39929e55eb13eeb8dfbe1bc99301fecf6b8942dd'
* commit '39929e55eb13eeb8dfbe1bc99301fecf6b8942dd':
  ppc: hevcdsp: Use shorthands for vector types

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-26 14:39:28 +02:00
Clément Bœsch
40cc925f93 Merge commit '554e55bbf0e4a3640a784cb512b816e776c56333'
* commit '554e55bbf0e4a3640a784cb512b816e776c56333':
  decode.h: Add missing headers to fix standalone compilation

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-26 14:38:46 +02:00
Clément Bœsch
76cc100afb Merge commit '86157e6db2c7a9222f77fa7e7f50fb9aebc3aa81'
* commit '86157e6db2c7a9222f77fa7e7f50fb9aebc3aa81':
  hevc: decouple calling get_format() from exporting the SPS parameters

See 786032cad8 (which has been reverted
and replaced with Anton's version to reduce diffs between the two
projects).

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-26 14:32:09 +02:00
Clément Bœsch
91f8ccdda0 Merge commit '730c02326094bcfb1fa67f10a7e7b22f03f5a88f'
* commit '730c02326094bcfb1fa67f10a7e7b22f03f5a88f':
  binkaudio: switch to the new send/receive API

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-25 19:12:05 +02:00
Philip Langdale
dd49eff930 avcodec/crystalhd: Another attempt at using mpeg4_unpack_bframes bsf
I tried doing this before, but it resulted in weird behaviour with
certain samples. I want to say I think I've got it sorted out now,
and the new autobsf stuff makes it trivial to turn on.

The native support for packed bframes is buggy and I think buggy
in ways beyond what I already try to account for, so this should be
a net improvements.
2017-04-23 15:33:36 -07:00
Philip Langdale
181aa1be49 avcodec/crystalhd: Explicitly set frame pts at all times
Previously, the pts value was initialised to AV_NOPTS_VALUE and so
it was not necessary to always set it. Now, with the new-new decode
API, this is no longer true. I'm not sure why I avoided setting the
pts when the decoder value was also AV_NOPTS_VALUE - it clearly
wouldn't have changed anything previously, but here we are.

Failing to do this, means the frame pts will be some random uninitalised
value.
2017-04-23 15:33:36 -07:00
Vittorio Giovara
960b4d4761 decode: Initialize ret before using it
libavcodec/decode.c:608:9: warning: variable 'ret' is
      used uninitialized whenever 'if' condition is false

(cherry picked from libav commit efddf2c09a)
2017-04-23 19:29:12 -03:00
Philip Langdale
f95c81ce10 avcodec/movtextenc: Ignore unmatched closing style tags
The existing code will segfault if a closing tag shows up when there
was never an opening tag. This isn't a well formed style, but it's also
not a reason to crash.

Fixes: https://trac.ffmpeg.org/ticket/6303
2017-04-23 10:46:11 -07:00
Philip Langdale
41b0561dc7 avcodec/crystalhd: Switch to the new generic filtering mechanism
This lets us drop all the code for handling the mp4toannexb
conversion.
2017-04-23 09:45:46 -07:00
James Almer
16c88465a1 avcodec/decode: also update consumed bytes on last_pkt_props->size 2017-04-23 12:52:48 -03:00
Paul B Mahol
ac30754a14 avcodec/dnxhd_parser: fix parsing interlaced video, simplify code
There appears to be no need to treat interlaced videos differently,
also that code is flawed, as for at least one input cur_field would
be always 0.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-23 12:00:22 +02:00
Muhammad Faiz
31f61b0d4f avcodec: do not use AVFrame accessor
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-04-23 14:27:47 +07:00
James Almer
fdeab95a82 Merge commit '03a80925effc2698d21dc0b00290eecf42dd9e68'
* commit '03a80925effc2698d21dc0b00290eecf42dd9e68':
  lavc: add a bitstream filter for splitting VP9 superframes

Merged-by: James Almer <jamrial@gmail.com>
2017-04-22 23:27:05 -03:00
James Almer
58ed9deec8 Merge commit '8fb4210ad8785c01fccf2fc59af6a6fa2892b6b2'
* commit '8fb4210ad8785c01fccf2fc59af6a6fa2892b6b2':
  qsvdec_h2645: switch to the new generic filtering mechanism

Merged-by: James Almer <jamrial@gmail.com>
2017-04-22 23:02:02 -03:00
James Almer
79778bb9b0 Merge commit '972c71e9cb63e24f57ee481e413199c7d88a8813'
* commit '972c71e9cb63e24f57ee481e413199c7d88a8813':
  lavc: add support for filtering packets before decoding

Merged-by: James Almer <jamrial@gmail.com>
2017-04-22 22:35:27 -03:00
Jan Sebechlebsky
f92e1af844 avcodec/bsf: Check for packet payload when setting BSF EOF flag.
Set BSF EOF flag only if pkt == NULL or both data and
side data are not present in packet.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-22 22:32:24 -03:00