Commit Graph

91414 Commits

Author SHA1 Message Date
Michael Niedermayer
70832333bb avcodec/shorten: Fix undefined integer overflow
Fixes: signed integer overflow: 8454144 * 256 cannot be represented in type 'int'
Fixes: 8788/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5728205041303552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-04 01:10:28 +02:00
Michael Niedermayer
652d7c6348 avcodec/jpeg2000dec: Fixes invalid shifts in jpeg2000_decode_packets_po_iteration()
Fixes: shift exponent 47 is too large for 32-bit type 'int'
Fixes: 9163/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5661750182543360

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-04 01:10:28 +02:00
Michael Niedermayer
0898a3d990 avcodec/jpeg2000dec: Check that there are enough bytes for all tiles
Fixes: OOM
Fixes: 8781/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5810709081358336

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-04 01:10:28 +02:00
Jacob Trimble
7e22f5d457 avformat/mov: Expose encryption info to the app.
This exposes encryption info from the container to the app.  This
includes key ID, IV, and subsample byte ranges.  The info is passed
using the new side-data AV_PKT_DATA_ENCRYPTION_DATA and
AV_PKT_DATA_ENCRYPTION_INIT_DATA.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-04 01:10:28 +02:00
Rostislav Pehlivanov
9fececb6f3 riff: add ATRAC9 guid
Enables demuxing of ATRAC9 files.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-07-03 20:15:06 +01:00
Rostislav Pehlivanov
755e618399 lavc: implement an ATRAC9 decoder
This commit implements a full ATRAC9 decoder, a simple low-delay codec
developed by Sony and used in most PSVita games, some PS3 games and some
PS4 games. Its similar to AAC in that it uses Huffman coded scalefactors
but instead of vector quantization it just Huffman codes the spectral
coefficients (in a way similar to how Opus splits band energy coding
into coarse and fine precision). It opts to write rather large Huffman
codes by packing several small coefficients into one Huffman coded
symbol, though I don't believe this increases efficiency at all.
Band extension implements SBC in a simple way, first it mirrors the
lower spectrum onto the higher frequencies and then it uses one of 5
filters to shape it. Noise substitution is implemented via 2 of them.
Unlike previous ATRAC codecs, there's no QMF, this is a standard MDCT
codec.

Based off of the reverse engineering work of Alex Barney.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-07-03 20:15:01 +01:00
James Almer
3c4af577aa configure: add missing swscale to avfilter when sr filter is enabled
Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-02 22:18:47 -03:00
Danil Iashchenko
581bafa83b lavfi: add sobel, prewitt, roberts filters
Add opencl version of sobel, prewitt, roberts filters.
2018-07-03 00:11:28 +01:00
Pedro Arthur
54b425a7fa libavfilter: vf_sr.c remove warnings 2018-07-02 13:45:38 -03:00
Sergey Lavrushkin
575b718990 Adds ESPCN super resolution filter merged with SRCNN filter.
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2018-07-02 10:47:14 -03:00
Michael Niedermayer
d24c9e55f6 avcodec/dvdsubdec: Check for fully transparent rectangles earlier
Testcase with large transparent rectangles changes from 67 sec to 3 sec decode time

Fixes: Timeout
Fixes: 8728/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVDSUB_fuzzer-5190088756559872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-02 13:55:28 +02:00
Marton Balint
06a8d7ff00 avformat/apngdec: set pts to AV_NOPTS_VALUE
And let the generic code figure out the proper PTS. This is needed because apng
does not provide seek functions, but after a generic seek (e.g. to file start)
timestamps are not reset which causes broken timestamps when looping apngs,
like in ticket #6121.

Signed-off-by: Marton Balint <cus@passwd.hu>
2018-07-02 11:58:08 +02:00
Marton Balint
da36bcbeb7 ffmpeg: fix -stream_loop with multiple inputs
The input thread needs to be properly cleaned up and re-initalized before we
can start reading again in threaded mode. (Threaded input reading is used when
there is mode than one input file).

Fixes ticket #6121 and #7043.

Signed-off-by: Marton Balint <cus@passwd.hu>
2018-07-02 11:58:08 +02:00
Marton Balint
b181cd359b ffmpeg: factorize input thread creation and destruction
Signed-off-by: Marton Balint <cus@passwd.hu>
2018-07-02 11:58:08 +02:00
Michael Niedermayer
9f0077cc03 tools/target_dec_fuzzer: Fix parser_avctx memleak on error path
Fixes: oss-fuzz issue 9195

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-30 16:13:48 +02:00
Michael Niedermayer
d08d4a8c73 avcodec/vc1_block: Fix mqaunt check for negative values
Fixes: out of array access
Fixes: ffmpeg_bof_4.avi
Fixes: ffmpeg_bof_5.avi
Fixes: ffmpeg_bof_6.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Reviewed-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-30 00:41:35 +02:00
Wang Cao
5a99e00023 libavformat/yuv4mpeg: Add color range support for Y4M Add color_range support in Y4M.
Set pixel format and color_range for YUVJ pixel formats. Also set
color_range based on AVFormatContext.

Signed-off-by: Wang Cao <wangcao@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-30 00:41:35 +02:00
Carl Eugen Hoyos
27662ed681 Changelog: Mention vc1 improvements by Jerome Borsboom. 2018-06-29 01:34:23 +02:00
Jerome Borsboom
efde2a70ff avcodec/vc1: fix check for missing CBPTAB
CBPTAB must be present in (non skipped) P and B pictures.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
2018-06-29 01:19:10 +02:00
Jerome Borsboom
975a1a81b2 avcodec/vc1: fix overlap filter for frame interlaced pictures
The overlap filter is not correct for vertical edges in frame interlaced
I and P pictures. When filtering macroblocks with different FIELDTX values,
we have to match the lines at both sides of the vertical border. In addition,
we have to use the correct rounding values, depending on the line we are
filtering.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
2018-06-29 01:18:44 +02:00
Jerome Borsboom
f92e95e9b5 avcodec/vc1: change the internal ordering of blocks within a macroblock
The overlap filter needs to cover a full macroblock vertical edge when the
FIELDTX value for two neighbouring macroblocks is not equal. By changing
the internal ordering of the blocks from row major to column major, we do
not need to reinterlace a FIELDTX coded macroblock before running the overlap
filter.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
2018-06-29 01:17:23 +02:00
Jerome Borsboom
1cf6129d13 avcodec/vc1: fix condition guarding overlap filter on I picture
The overlap filter needs to run when PQUANT is 9 or higher, irrespective
of CONDOVER.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
2018-06-29 01:16:51 +02:00
Jun Zhao
6b453a81bc hwcontext_opencl: remove an unused variable
remove an unused variable

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-06-29 05:23:49 +08:00
Jun Zhao
e6ac328b79 hwcontext_opencl: Remove the opencl_device_init in opencl_device_derive
In opencl device derived case, don't need to call opencl_device_init.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-06-29 05:23:20 +08:00
Jun Zhao
2730a0fdf4 configure: fix check for opencl_vaapi_intel_media.
opencl_vaapi_intel_media doesn't depend on libmfx, OpenCL™ Drivers
and Runtimes for Intel® Architectureis is a standalone release, more
information can be found in the link:
https://software.intel.com/en-us/articles/opencl-drivers.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-06-29 05:17:36 +08:00
John Stebbins
08b1d1d812 h264_slice: Fix return of incomplete frames from decoder
When not using libavformat for demuxing, AVCodecContext.has_b_frames
gets set too late causing the recovery frame heuristic in h264_refs to
incorrectly flag an early frame as recovered.

This patch sets has_b_frames earlier to prevent improperly flagging the
frame as recovered.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-28 21:35:01 +02:00
Michael Niedermayer
872ea3dfe5 avformat/movenc: Use mov->fc consistently for av_log()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-28 21:35:01 +02:00
Michael Niedermayer
310a49f71d tools/target_dec_fuzzer: Also optionally fuzz with a parser
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-28 21:35:01 +02:00
Michael Niedermayer
2aa9047486 avcodec/mpeg4videodec: Check read profile before setting it
Fixes: null pointer dereference
Fixes: ffmpeg_crash_7.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-28 21:35:01 +02:00
Michael Niedermayer
95556e27e2 avformat/movenc: Do not pass AVCodecParameters in avpriv_request_sample
Fixes: out of array read
Fixes: ffmpeg_crash_8.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-28 21:35:01 +02:00
Michael Niedermayer
00e8181bd9 avcodec/ac3_parser: Check init_get_bits8() for failure
Fixes: null pointer dereference
Fixes: ffmpeg_crash_6.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-28 21:35:01 +02:00
Michael Niedermayer
ed22dc2221 avformat/movenc: Check that frame_types other than EAC3_FRAME_TYPE_INDEPENDENT have a supported substream id
Fixes: out of array access
Fixes: ffmpeg_bof_1.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-28 21:35:01 +02:00
Michael Niedermayer
75a2db5524 avcodec/dpx: Check elements in 12bps planar path
Fixes: null pointer dereference
Fixes: 8946/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DPX_fuzzer-5078915222601728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-28 21:35:01 +02:00
Mark Thompson
46fb150a81 lavfi/colorspace: Add namespace prefix to global functions 2018-06-28 16:14:35 +01:00
Gyan Doshi
07987404a8 ffmpeg: make loglevel verbose for frame duration warning 2018-06-28 14:08:51 +05:30
Timo Rothenpieler
3f953379e1 avcodec/qsvenc: fix version detection on cygwin 2018-06-27 16:04:08 +02:00
Michael Niedermayer
f59c4e4391 avcodec/escape124: Fix spelling errors in comment
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-27 13:50:14 +02:00
Michael Niedermayer
71ba79702d avcodec/dvbsubdec: Compute scoretab without iterating over pixels multiple times in compute_default_clut()
Improves speed 102->2 sec
Testcase: 8655/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVBSUB_fuzzer-6277869285146624
Fixes: Timeout

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-27 13:43:39 +02:00
Michael Niedermayer
b31189881a avcodec/ra144: Fix integer overflow in ff_eval_refl()
Fixes: signed integer overflow: -4096 * -524288 cannot be represented in type 'int'
Fixes: 8650/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RA_144_fuzzer-5734816036159488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-27 13:43:39 +02:00
Jacob Trimble
69bd73b3ff libavutil/encryption_info: Add unit tests.
Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-27 13:43:39 +02:00
Jacob Trimble
96281ed689 avutil/gitignore: Ignore integer test binary.
Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-27 13:43:38 +02:00
Jacob Trimble
ad2ae21010 avutil/encryption_info: Fix documentation problem.
Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-27 13:43:38 +02:00
Lukas Rusak
7395f13df9 v4l2_m2m: decoder: fix memory leak 2018-06-27 08:38:50 +02:00
Carl Eugen Hoyos
7becc70375 lavf/amr: Fix heuristic to avoid detection of repeated bytes. 2018-06-26 23:04:43 +02:00
Gyan Doshi
4ac88ba548 fftools/ffmpeg: check sseof value and clash with ss
Prioritize -ss
2018-06-26 09:47:32 +05:30
Carl Eugen Hoyos
52e8a0d96d lavc/libopenjpeg: Support GRAY10, GRAY12 and GRAY14. 2018-06-26 00:20:04 +02:00
Michael Niedermayer
78167b498f avcodec/cscd: Check output buffer size for lzo.
Fixes: Timeout
Fixes: 8665/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CSCD_fuzzer-5768442610188288

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2018-06-25 22:58:45 +02:00
Michael Niedermayer
84bbdc255a avcodec/ffv1dec: Check state transition table
Fixes: Timeout
Fixes: 8646/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-5649968353247232

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-25 22:58:45 +02:00
Michael Niedermayer
6677c98626 avcodec/escape124: Check buf_size against num_superblocks
Fixes: Timeout
Fixes: 8722/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ESCAPE124_fuzzer-4843268402577408

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-25 22:58:45 +02:00
Mark Thompson
e7c0b44e74 lavf/mpjpegdec: Mark local variable static 2018-06-25 21:00:54 +01:00