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

40606 Commits

Author SHA1 Message Date
Zhong Li
900487043b lavc/qsvenc: add quality status to side_data
Add fix a memory leak issue as James's comments.

V2: use a local pict_type since coded_frame is deprecated.

Signed-off-by: Zhong Li <zhong.li@intel.com>
2018-08-22 15:26:35 +08:00
Jacob Trimble
7e0df5910e avcodec/opus_parser: Handle complete frames flag.
Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-21 19:45:56 -03:00
Paul B Mahol
24b24e14d6 avcodec/codec_desc: mark Duck TrueMotion 2.0 Real Time as intra only 2018-08-21 17:11:43 +02:00
Timo Rothenpieler
dc2d56a66b avcodec/nvenc: add option to turn off a53 closed caption embedding 2018-08-21 15:14:56 +02:00
Paul B Mahol
42a99b76de avcodec: add IMM4 decoder
This work is sponsored by VideoLAN.
2018-08-21 11:52:06 +02:00
Michael Niedermayer
77429b4217 avcodec/cfhd: Use the actual count instead of the expected in peak_table()
Fixes: out of array access (no testcase)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-20 02:32:41 +02:00
Michael Niedermayer
2c1613ac94 avcodec/cfhd: Move peak_table() and difference_coding() calls after the existing coefficient count check
Fixes: out of array access
Fixes: 9509/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5283250636324864
Fixes: 9572/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-4920757409808384
Fixes: 9596/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5114917580439552
Fixes: 9640/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-6247840698335232
Fixes: 9659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-6079554987753472

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-20 02:32:41 +02:00
Michael Niedermayer
dbac849c4d avcodec/lagarith: Optimize FRAME_SOLID_RGBA
Changes 5466110 decicycles to 1798072 decicycles (tested with fate-suite/lagarith/lag-rgb32.avi)

Fixes: Timeout
Fixes: 9484/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LAGARITH_fuzzer-5707859156271104

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-20 02:32:41 +02:00
James Almer
728760de35 Revert "avcodec/libaomdec: auto insert dump_extra bitstream filter"
This reverts commit e45ed15594.

The Matroska spec was updated to not remove Sequence Header OBUs from key
frames, so this is no longer needed.
2018-08-17 15:17:59 -03:00
James Almer
96a7099f3e avcodec/av1_parse: take trailing bits into account when initializing the GetBitContext
Also only initialize it in ff_av1_packet_split() and not ff_av1_extract_obu(),
same as h2645_parse, so GetBitContext specific failures may not affect the
latter.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-17 15:09:01 -03:00
Kieran Kunhya
c85852d3de h264: Support multi-field closed captions by using AVBufferRef and not resetting per field
Signed-off-by: Josh de Kock <joshdk@obe.tv>
2018-08-17 16:24:19 +01:00
James Almer
f631c328e6 avcodec/decode: copy the output parameters from the last bsf in the chain back to the AVCodecContext
Certain AVCodecParameters, like the contents of the extradata, may be changed
by the init() function of any of the bitstream filters in the chain.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-16 23:43:13 -03:00
James Almer
94fe138de0 avcodec/decode: flush the internal bsfs instead of constantly reinitalizing them
Initialize the bsfs once when opening the codec and uninitialize them once when
closing it, instead of at every codec flush/seek.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-16 23:43:12 -03:00
James Almer
2954e51393 avcodec/h264_redundant_pps_bsf: implement a AVBSFContext.flush() callback
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-16 23:43:12 -03:00
James Almer
e5b1f2b027 avcodec/mpeg4_unpack_bframes_bsf: implement a AVBSFContext.flush() callback
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-16 23:43:12 -03:00
James Almer
e9980c451e avcodec/vp9_superframe_bsf: implement a AVBSFContext.flush() callback
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-16 23:43:11 -03:00
James Almer
63e0846c66 avcodec/vp9_superframe_split_bsf: implement a AVBSFContext.flush() callback
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-16 23:43:11 -03:00
James Almer
390f156451 avcodec/h264_mp4toannexb_bsf: implement a AVBSFContext.flush() callback
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-16 23:43:10 -03:00
James Almer
b33f5299a5 avcodec/bsf: add a flushing mechanism to AVBSFContext
Meant to reset the internal bsf state without the need to reinitialize it.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-16 23:43:10 -03:00
lee ju
6a0feafebe avcodec/frame_thread_encoder: fix memory leak that occurs when close encoder without sending eof and receiving to end
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-16 03:05:54 +02:00
Michael Niedermayer
3378194ce8 avcodec/scpr: Check for min > max in decompress_p()
Fixes: Timeout
Fixes: 9342/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-4795990841229312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-16 01:06:17 +02:00
Michael Niedermayer
9b604e96a5 avcodec/shorten: Fix signed 32bit overflow in shift in shorten_decode_frame()
Fixes: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 9480/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-6647324284551168 -rss_limit_mb=2000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-16 00:55:39 +02:00
Michael Niedermayer
db7e9082e1 avcodec/shorten: Fix integer overflow in residual/LPC combination
Fixes: signed integer overflow: -540538872 + -2012739576 cannot be represented in type 'int'
Fixes: 9255/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5758630052757504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-16 00:55:37 +02:00
Michael Niedermayer
7007dabec0 avcodec/shorten: Check verbatim length
Fixes: Timeout
Fixes: 9252/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5780720709533696

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-16 00:55:34 +02:00
Thilo Borgmann
72d9b8f4c5 lavc/videotoolboxenc: Fix compilation on osx 10.10.5 Yosemite
Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-08-14 10:01:30 -07:00
Michael Niedermayer
0f4c3b0b8e avcodec/mpegaudio_parser: Initialize poutbuf*
Possibly fixes: null pointer dereference
Possibly fixes: 9352/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MP3ADUFLOAT_fuzzer-5146068961460224
Fixes: Heap-use-after-free
Fixes: 9453/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MP3ADUFLOAT_fuzzer-5137954375729152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-12 21:51:39 +02:00
Michael Niedermayer
bf97d11b08 avcodec/ivi: Factor width dereference out of the loops in ivi_output_plane()
396078 -> 268468 dezicycles

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-12 21:48:15 +02:00
Michael Niedermayer
82920bf494 avcodec/ivi: Only clip samples when needed in ivi_output_plane()
435740 -> 396078 dezicycles

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-12 21:48:11 +02:00
Michael Niedermayer
6d8a289c98 avcodec/indeo5: require initial valid intra/gop headers not just later
Fixes: Timeout
Fixes: 9308/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5284853581873152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-12 21:48:08 +02:00
Michael Niedermayer
f91e7ec9df avcodec/microdvddec: limit style characters in parsing
Fixes: Timeout
Fixes: 9293/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MICRODVD_fuzzer-5643972541153280

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-12 21:47:17 +02:00
Jun Zhao
1581caa7ca lavc/hevcdec: add ONLY_IF_THREADS_ENABLED where it is missing.
add ONLY_IF_THREADS_ENABLED where it is missing.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
2018-08-10 18:48:25 +08:00
hwren
f563e7868f avs2: correct avs2 description
Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
2018-08-08 00:13:13 +05:30
Carl Eugen Hoyos
81f25a1051 lavc/libx264: Support monochrome encoding. 2018-08-07 20:41:02 +02:00
Zhong Li
6088b7b037 lavc/qsvenc: expose qp of encoded frames
Requirement from ticket #7254.
Currently only H264 supported by MSDK.

Signed-off-by: Zhong Li <zhong.li@intel.com>
2018-08-07 11:26:37 +08:00
Gyan Doshi
076b19660e avcodec/libaomenc: correct range for cpu-used
Valid range is [0,8] as stated in aom.git:aom/aomcx.h

Fixes #7343
2018-08-06 10:19:27 +05:30
Aman Gupta
e77a3e996f avcodec/mediacodecdec: fix spurious newline in trace logging
Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-08-05 12:31:13 -07:00
Michael Niedermayer
1940c27c82 avcodec/pnm_parser: Avoid reparsing failed data.
Alternatively the parser could be re implemented / redesigned so as to better
and more efficiently find frame boundaries

Fixes: Timeout
Fixes: 9210/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PBM_fuzzer-4770771833454592
Fixes: 9214/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PPM_fuzzer-5741633353023488
Fixes: 9219/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGM_fuzzer-6249230237696000
Fixes: 9550/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PAM_fuzzer-5312669836902400

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-04 16:17:01 +02:00
Michael Niedermayer
83dab8183e avcodec/simple_idct_template: Fix several integer overflows
Fixes: simple_idct_template.c:184:30: runtime error: signed integer overflow: -1065517056 - 1392182838 cannot be represented in type 'int'
Fixes: simple_idct_template.c:269:21: runtime error: signed integer overflow: 16384 * 259254 cannot be represented in type 'int'
Fixes: simple_idct_template.c:164:17: runtime error: signed integer overflow: 21407 * 210162 cannot be represented in type 'int'
Fixes: simple_idct_template.c:167:17: runtime error: signed integer overflow: 21407 * 210162 cannot be represented in type 'int'
Fixes: simple_idct_template.c:169:19: runtime error: signed integer overflow: 22725 * 259190 cannot be represented in type 'int'
Fixes: simple_idct_template.c:171:19: runtime error: signed integer overflow: 19265 * 259190 cannot be represented in type 'int'
Fixes: simple_idct_template.c:173:19: runtime error: signed integer overflow: 12873 * 259190 cannot be represented in type 'int'
Fixes: simple_idct_template.c:183:28: runtime error: signed integer overflow: 1860878336 + 585177665 cannot be represented in type 'int'
Fixes: simple_idct_template.c:159:17: runtime error: signed integer overflow: 16384 * 189520 cannot be represented in type 'int'
Fixes: simple_idct_template.c:170:22: runtime error: signed integer overflow: 19265 * 130147 cannot be represented in type 'int'
Fixes: simple_idct_template.c:174:23: runtime error: signed integer overflow: -22725 * 130147 cannot be represented in type 'int'
Fixes: simple_idct_template.c:183:20: runtime error: signed integer overflow: 16384 * -175206 cannot be represented in type 'int'
Fixes: simple_idct_template.c:184:22: runtime error: signed integer overflow: -16384 * -175206 cannot be represented in type 'int'
Fixes: simple_idct_template.c:185:22: runtime error: signed integer overflow: -16384 * -175206 cannot be represented in type 'int'
Fixes: simple_idct_template.c:186:20: runtime error: signed integer overflow: 16384 * -175206 cannot be represented in type 'int'
Fixes: simple_idct_template.c:195:26: runtime error: signed integer overflow: 19265 * 150747 cannot be represented in type 'int'
Fixes: simple_idct_template.c:198:27: runtime error: signed integer overflow: -22725 * 150747 cannot be represented in type 'int'
Fixes: simple_idct_template.c:184:37: runtime error: signed integer overflow: 21407 * -171941 cannot be represented in type 'int'
Fixes: simple_idct_template.c:185:37: runtime error: signed integer overflow: 21407 * -171941 cannot be represented in type 'int'
Fixes: simple_idct_template.c:192:27: runtime error: signed integer overflow: -12873 * 206341 cannot be represented in type 'int'
Fixes: simple_idct_template.c:185:30: runtime error: signed integer overflow: 1196441600 + 1703756981 cannot be represented in type 'int'
Fixes: simple_idct_template.c:176:23: runtime error: signed integer overflow: -12873 * 168461 cannot be represented in type 'int'
Fixes: simple_idct_template.c:191:27: runtime error: signed integer overflow: -22725 * -140062 cannot be represented in type 'int'
Fixes: simple_idct_template.c:197:26: runtime error: signed integer overflow: 19265 * -140062 cannot be represented in type 'int'
Fixes: simple_idct_template.c:183:34: runtime error: signed integer overflow: 8867 * -243046 cannot be represented in type 'int'
Fixes: simple_idct_template.c:186:34: runtime error: signed integer overflow: 8867 * -243046 cannot be represented in type 'int'
Fixes: simple_idct_template.c:186:28: runtime error: signed integer overflow: -816234496 - 2139878414 cannot be represented in type 'int'
Fixes: simple_idct_template.c:188:26: runtime error: signed integer overflow: 12873 * -239872 cannot be represented in type 'int'
Fixes: simple_idct_template.c:165:16: runtime error: signed integer overflow: 8867 * -260084 cannot be represented in type 'int'
Fixes: simple_idct_template.c:166:16: runtime error: signed integer overflow: 8867 * -260084 cannot be represented in type 'int'
Fixes: 9135/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-6324422955761664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-04 16:17:01 +02:00
Michael Niedermayer
40c2f870ae avcodec/aacdec_template: Check for duplicate elements
Fixes: Timeout
Fixes: 9552/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-6027842339995648

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-04 16:17:01 +02:00
Michael Niedermayer
47db5763e2 avcodec/aacpsdsp_template: Fix integer overflow in ps_stereo_interpolate_c()
Fixes: signed integer overflow: -1813244069 + -1407981383 cannot be represented in type 'int'
Fixes: 8823/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5643295618236416

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-04 16:17:01 +02:00
Aman Gupta
476fd6ba3a avcodec/mediacodecdec: fix SEGV on modern nvidia decoders
This code came originally from gstreamer, where it was added in [1]
as a work-around for the Tegra 3. (The alignment was changed in [2]
as a response to [3], from 32-bit to 16-bit).

gstreamer only used this workaround in the case where the decoder
didn't return a slice-height property, but when the code was copied
into avcodec the conditional got lost. This commit restores the guard
and prefers the slice-height from the decoder when it is available.

This fixes segfaults decoding 1920x1080 h264 and mpeg2 videos on the
NVidia SHIELD after upgrading to Android Oreo.

[1] a870e6a5c3
[2] 21ff3ae0b0
[3] https://bugzilla.gnome.org/show_bug.cgi?id=748867

Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-08-03 11:06:46 -07:00
Nikolas Bowe
5aeb3b0080 lavc/svq3: Fix regression decoding some files.
Fixes some SVQ3 encoded files which fail to decode correctly after 6d6faa2a2d.
These files exhibit lots of artifacts and logs show "Media key encryption is not implemented".
However they decode without artifacts before 6d6faa2a2d.
The attatched patch allows these files to successfully decode, but also reject media key files.

Tested on the files in #6094 and http://samples.mplayerhq.hu/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-03 02:10:14 +02:00
Michael Niedermayer
51ac3f43b8 avcodec/mlp_parser: Check if synccode is within buffer
Fixes: undefined shift
Fixes: 9216/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEHD_fuzzer-6281404575907840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-03 02:08:16 +02:00
Michael Niedermayer
7dd836a3f9 avcodec/qtrle: Check remaining bytestream in qtrle_decode_XYbpp()
Fixes: Timeout
Fixes: 9213/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QTRLE_fuzzer-5649753332252672

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-03 02:08:16 +02:00
James Almer
692e323d89 avcodec/av1_parse: return size of the parsed OBU in parse_obu_header()
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:54 -03:00
James Almer
4e937b1a60 avcodec/av1_parse: check for OBU header overread
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:53 -03:00
James Almer
e45ed15594 avcodec/libaomdec: auto insert dump_extra bitstream filter
Some containers, like Matroska, may propagate key frames with no Sequence
Header OBU since it's provided in extradata instead.
With this change, the Sequence Header will be appended to the packet data
before calling aom_codec_decode().

Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:05 -03:00
James Almer
b98bd60bfa avcodec/dump_extradata_bsf: don't allocate a new AVPacket per filtered packet
~4x speedup in dump_extradata()

Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:04 -03:00
James Almer
a9a433564d avcodec/h264_mp4toannexb_bsf: use enum constants for the NAL unit type values
Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-30 17:51:50 -03:00
James Almer
3258cc6507 avcodec/bitstream_filters: check the input argument of av_bsf_get_by_name() for NULL
Fixes crashes like "ffmpeg -h bsf" caused by passing NULL to strcmp()

Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-28 11:14:19 -03:00