1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

94183 Commits

Author SHA1 Message Date
Michael Niedermayer
5f64f6058e avcodec/alsdec: Fix integer overflow with buffer number
Fixes: signed integer overflow: 65313 * 65313 cannot be represented in type 'int'
Fixes: 15290/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5738074249625600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-06 22:50:21 +02:00
Michael Niedermayer
7f527021df avcodec/alsdec: Fixes signed integer overflow in LSB addition
Fixes: signed integer overflow: 8 * 536870912 cannot be represented in type 'int'
Fixes: 15281/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5744458785619968

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-06 22:50:21 +02:00
Michael Niedermayer
0794494c8f avcodec/alsdec: Check opt_order / sb_length in ra_block handling
Fixes: out of array access
Fixes: 15277/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5184853437317120
Fixes: 15280/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5741062137577472

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-06 22:50:21 +02:00
Michael Niedermayer
a3bd4b260e avcodec/alsdec: Fix integer overflow with shifting samples
Fixes: signed integer overflow: -346039050 * 8 cannot be represented in type 'int'
Fixes: 15283/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5692700268953600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-06 22:50:21 +02:00
Michael Niedermayer
51f6870c37 avcodec/alsdec: Fix undefined behavior in decode_rice()
Fixes: left shift of 72 by 26 places cannot be represented in type 'int'
Fixes: 15279/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5700665621348352

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-06 22:50:21 +02:00
Michael Niedermayer
e131568752 avcodec/alsdec: Fixes invalid shifts in read_var_block_data() and INTERLEAVE_OUTPUT()
Fixes: left shift of negative value -6
Fixes: 15275/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5742361767837696
Fixes: signed integer overflow: 41582592 * 256 cannot be represented in type 'int'
Fixes: 15296/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5739558227935232

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-06 22:50:21 +02:00
Andreas Rheinhardt
eb33be188d matroskadec: Fix overflow introduced in a569a7b3
This commit fixes an overflow introduced in a569a7b3 that affected EBML
elements that the Matroska demuxer doesn't want to parse like CRC-32
elements. The return value of avio_skip (the new position on success or
an AVERROR on failure) has been assigned to an integer which meant that
new positions in the range of 2GB to 4GB-1 etc. were considered errors.

Fixes ticket #8001.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-07-06 14:48:54 -03:00
Paul B Mahol
b9a6106842 avfilter/af_afftfilt: remove invalid scaling 2019-07-06 12:01:38 +02:00
Jun Zhao
feade2b403 doc/filters: Document missing options for scale in/out color matrix
Document missing options for scale in/out color matrix

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-07-06 13:12:13 +08:00
Jun Zhao
3ed0b3f6f7 lavfi/scale: Add sub-options for in_color_matrix/out_color_matrix
Add sub-options for in_color_matrix/out_color_matrix

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-07-06 13:12:13 +08:00
James Almer
7c644989a5 avcodec/hevc_ps: fix range of num_tile_{columns,rows}_minus1
From 7.4.3.3.1:

num_tile_columns_minus1 shall be in the range of 0 to PicWidthInCtbsY - 1, inclusive.
num_tile_rows_minus1 shall be in the range of 0 to PicHeightInCtbsY - 1, inclusive.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-07-05 16:30:40 -03:00
Cameron Cawley
0cbdedbd2f avformat/rpl: Calculate the duration of the video track
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-05 18:14:11 +02:00
Cameron Cawley
1f8336fd98 avformat/rpl: Allow a file to have audio, but not video
Signed-off-by: Cameron Cawley <ccawley2011@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-05 17:08:44 +02:00
Cameron Cawley
dcf3f8b368 avformat/rpl: Fix detection of 8-bit linear formats
Was previously broken by commit 8cf5f94.
Fixes ticket #7859

Signed-off-by: Cameron Cawley <ccawley2011@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-05 17:08:44 +02:00
Paul B Mahol
0f39ef4db2 avfilter/vf_lut: fix regression with >8bit planar filtering 2019-07-05 12:55:02 +02:00
Steven Liu
a514244319 avformat/dashdec: fix code style in dash_read_packet 2019-07-05 11:52:49 +08:00
Jun Zhao
9269bccbb3 doc/muxers: fix docs format for DASH muxer
fix docs format for DASH muxer

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-07-04 19:42:01 +08:00
Steven Liu
6e988b75df avformat/dashdec: refine and fix code style of dash_read_header
move the temp variable to the top of the expression paragraph
rename the pls to rep(representation)
2019-07-04 16:11:47 +08:00
Steven Liu
43e0ddd33d avformat/dashdec: simplified code in open_demux_for_component
change from pls->ctx->streams[i]->codecpar to ist->codecpar

Signed-off-by: Steven Liu <lq@onvideo.cn>
2019-07-04 15:08:41 +08:00
Yonglin Luo
664a27ea40 libavfilter/vf_colorspace.c: fix demarcation point of gamma linearize function
The linearize function (usually refered to EOTF) is the inverse of
delinearize function (usually referred to OETF). Demarcation point of
EOTF should be beta*delta, but the actual value used now in the source
code is beta.

For ITU Rec.709, they are 0.081 (0.018*4.5) and 0.018 respectively
(beta = 0.018 and delta = 4.5), and they correspond to pixel value 5
and 21 for an 8-bit image. Linearized result of pixel within that range
(5-21) will be different, but this commit will make linearize function
of the filter more accurate in the mathematical sense.

Signed-off-by: Yonglin Luo <vincenluo@tencent.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2019-07-03 13:57:11 -04:00
Paul B Mahol
1ac643f066 avfilter/vf_lut2: use time_base from framesync
Fixes non-monotonous timestamps.
2019-07-03 14:54:05 +02:00
Paul B Mahol
cc5c636780 avfilter/vf_midequalizer: use time_base from framesync
Fixes non-monotonous timestamps.
2019-07-03 14:54:05 +02:00
Paul B Mahol
d49d7d238f avfilter/vf_blend: use time_base from framesync
Fixes non-monotonous timestamps.
2019-07-03 14:54:05 +02:00
Paul B Mahol
d71dafb2ab avfilter/vf_maskedclamp: use time_base from framesync
Fixes non-monotonous timestamps.
2019-07-03 14:54:05 +02:00
Paul B Mahol
8a0636a93b avfilter/vf_maskedmerge: use time_base from framesync
Fixes non-monotonous timestamps.
2019-07-03 14:54:05 +02:00
Peter Ross
9654e97572 ifv: populate creation_time
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2019-07-03 21:07:38 +10:00
Paul B Mahol
93a73df54d avfilter/af_deesser: remove extra ; 2019-07-03 08:53:35 +02:00
Jun Zhao
be1643be31 lavf/dump: More disposition flag dump
More disposition flag dump

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-07-03 10:35:16 +08:00
Jun Zhao
11d3b03fcb ffmpeg_opt: Respect default disposition when select audio/video
Respect default disposition when select audio/video

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-07-03 10:33:44 +08:00
Jun Zhao
9521d7dd58 lavf/utils: Respect default disposition when select the AVStream
Respect default disposition when select the AVStream

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-07-03 10:33:31 +08:00
Paul B Mahol
bd5e92ef8a avfilter: add deesser audio filter 2019-07-02 19:02:54 +02:00
Paul B Mahol
1b262004d3 avfilter/af_silenceremove: use input timestamp for timestamp recalculation 2019-07-02 19:01:42 +02:00
Guo, Yejun
231d0c819f doc/filters: update how to generate native model for sr filter
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2019-07-02 10:51:08 +05:30
Guo, Yejun
50e194e6e1 tools/python: add script to convert TensorFlow model (.pb) to native model (.model)
For example, given TensorFlow model file espcn.pb,
to generate native model file espcn.model, just run:
python convert.py espcn.pb

In current implementation, the native model file is generated for
specific dnn network with hard-code python scripts maintained out of ffmpeg.
For example, srcnn network used by vf_sr is generated with
https://github.com/HighVoltageRocknRoll/sr/blob/master/generate_header_and_model.py#L85

In this patch, the script is designed as a general solution which
converts general TensorFlow model .pb file into .model file. The script
now has some tricky to be compatible with current implemention, will
be refined step by step.

The script is also added into ffmpeg source tree. It is expected there
will be many more patches and community needs the ownership of it.

Another technical direction is to do the conversion in c/c++ code within
ffmpeg source tree. While .pb file is organized with protocol buffers,
it is not easy to do such work with tiny c/c++ code, see more discussion
at http://ffmpeg.org/pipermail/ffmpeg-devel/2019-May/244496.html. So,
choose the python script.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2019-07-01 10:23:47 -03:00
Andreas Rheinhardt
4877b5869e libavformat/subfile: Improve AVSEEK_SIZE/SEEK_END seeking
The subfile protocol treats an end of 0 as meaning "until EOF"; this got
implemented by simply setting the end to INT64_MAX. But seeking relative
to EOF or AVSEEK_SIZE seeking hasn't been adapted; the result is that
e.g. the duration of transport streams isn't correctly determined when
this option is used. This is fixed in this patch.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-07-01 12:12:04 +02:00
Zhong Li
e51cc7ed85 lavc/mjpegdec: make code aligned
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-07-01 13:24:57 +08:00
Zhong Li
a6c648f2b4 lavc/mjpegdec: replace number with marker name
Make it easier to read.

Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-07-01 13:24:01 +08:00
Zhong Li
4dc3d93880 lavc/qsvenc: fix the incorrent map from bits to bytes
Reported-by:Maggie Sun <maggie.sun@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-07-01 13:24:01 +08:00
sfan5
034b72fc0b avformat/dashdec: Fix reading values from SegmentTimeline inside Period
This was missed in commit e752da5464.
2019-07-01 11:06:06 +08:00
Bela Bodecs
1476d82e73 avformat/hlsenc: changing all filename length to MAX_URL_SIZE
Throughout hlsenc code, all filename related buffer lengths are set
hardcoded as 1024. This PATCH change it to general value as MAX_URL_SIZE
in internal.h

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
2019-07-01 10:24:21 +08:00
Michael Niedermayer
3b2082c663 avcodec/hevc_ps: Change num_tile_rows/columns checks to sps->ctb_height/weight
Suggested-by: James Almer <jamrial@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-30 17:53:00 +02:00
Michael Niedermayer
c692051252 avcodec/hevc_ps: Fix integer overflow with num_tile_rows and num_tile_columns
Fixes: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int'
Fixes: 14880/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5130977304641536

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-30 17:52:13 +02:00
Michael Niedermayer
3d4f4f4a15 avcodec/apedec: Add k < 24 check to the only k++ case which lacks such a check
Fixes: 15255/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5718831688843264
Fixes: left shift of 1 by 31 places 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>
2019-06-30 17:46:12 +02:00
Michael Niedermayer
0334632d5c avformat/aviobuf: Delay buffer downsizing until asserts are met
Fixes: Assertion failure
Fixes: 15151/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5757079496687616
Fixes: 15205/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5767573242642432
May fix: Ticket7094

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-30 17:43:50 +02:00
Michael Niedermayer
eb82d19f03 avcodec/fitsdec: Check data_min/max
Fixes: division by 0
Fixes: 15206/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FITS_fuzzer-5657260212092928

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-30 14:27:04 +02:00
Michael Niedermayer
89b96900fa avcodec/m101: Fix off be 2 error
Fixes: out of array read
Fixes: 15263/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_M101_fuzzer-5728999453491200

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-29 19:22:19 +02:00
Michael Niedermayer
8d8b8c4ac6 avcodec/qdm2: Move fft_order check up
This avoids undefined computations with unchecked values

Fixes: shift exponent -21 is negative
Fixes: 15262/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDM2_fuzzer-5651261753393152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-29 19:22:19 +02:00
Michael Niedermayer
cf3c245566 avcodec/libvorbisdec: Check extradata size
Fixes: out of array read
Fixes: 15261/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVORBIS_fuzzer-5764908467093504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-29 19:22:19 +02:00
Michael Niedermayer
7c30ff3888 avformat/vqf: Check header_size
Fixes: 15271/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5735262606327808
Fixes: signed integer overflow: -2147483648 - 8 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>
2019-06-29 19:22:19 +02:00
Michael Niedermayer
fb4a4557d1 avcodec/atrac9dec: Check q_unit_cnt in parse_band_ext()
Fixes: global-buffer-overflow
Fixes: 15247/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC9_fuzzer-5671602181636096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-29 19:22:19 +02:00