Commit Graph

93143 Commits

Author SHA1 Message Date
Kevin Backhouse via RT
1f00c97bc3 avcodec/htmlsubtitles: Fixes denial of service due to use of sscanf in inner loop for tag scaning
Fixes: [Semmle Security Reports #19438]
Fixes: dos_sscanf1.mkv

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-02-17 10:29:42 +01:00
Michael Niedermayer
7246bf365a avcodec/mpegvideo_enc: Use av_assert1() instead of assert()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-02-17 10:29:42 +01:00
Michael Niedermayer
d1afa7284c avformat/matroskadec: Do not leak queued packets on sync errors
Fixes: memleak
Fixes: clusterfuzz-testcase-minimized-audio_decoder_fuzzer-5649187601121280

Reported-by: Chris Cunningham <chcunningham@google.com>
Tested-by: Chris Cunningham <chcunningham@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-02-17 09:12:06 +01:00
Gyan Doshi
a9452fe6dc doc/fftools-common-opts: add example for codec option stream specifiers 2019-02-17 11:28:31 +05:30
Reto Kromer
7a51fed0f0 doc/muxers: grammar fix
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
2019-02-17 10:56:38 +05:30
Carl Eugen Hoyos
fe7d8c993f lavc/libgsmenc: Force mono and use 13k as default bitrate. 2019-02-17 01:04:18 +01:00
gxw
1466dc140d avcodec/mips: [loongson] optimize theora decoding with mmi.
Optimize theora decoding with mmi in functions:
1. ff_vp3_idct_add_mmi
2. ff_vp3_idct_put_mmi
3. ff_vp3_idct_dc_add_mmi
4. ff_put_no_rnd_pixels_l2_mmi

Theora decoding speed improved about 32%(from 88fps to 116fps, Tested on loongson 3A3000).

Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-02-16 19:56:57 +01:00
Michael Niedermayer
1f686d023b avcodec/mpeg4videodec: Clear interlaced_dct for studio profile
Fixes: Out of array access
Fixes: 13090/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5408668986638336

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-02-16 19:56:57 +01:00
Philip Langdale
d6fc5dc24a avcodec/version: Bump micro-version for nvdec/cuviddec changes
I forgot to add the version bump and changelog within the changes.
2019-02-16 10:43:24 -08:00
Philip Langdale
317b7b06fd avcodec/cuviddec: Add support for decoding HEVC 4:4:4 content
This is the equivalent change for cuviddec after the previous change
for nvdec. I made similar changes to the copying routines to handle
pixel formats in a more generic way.

Note that unlike with nvdec, there is no confusion about the ability
of a codec to output 444 formats. This is because the cuvid parser is
used, meaning that 444 JPEG content is still indicated as using a 420
output format.
2019-02-16 10:21:26 -08:00
Philip Langdale
83c7ac2e47 avcodec/nvdec: Explicitly mark codecs that support 444 output formats
With the introduction of HEVC 444 support, we technically have two
codecs that can handle 444 - HEVC and MJPEG. In the case of MJPEG,
it can decode, but can only output one of the semi-planar formats.

That means we need additional logic to decide whether to use a
444 output format or not.
2019-02-16 08:47:36 -08:00
Philip Langdale
e06ccfbe1d avcodec/nvdec: Add support for decoding HEVC 4:4:4 content
The latest generation video decoder on the Turing chips supports
decoding HEVC 4:4:4. Supporting this is relatively straight-forward;
we need to account for the different chroma format and pick the
right output and sw formats at the right times.

There was one bug which was the hard-coded assumption that the
first chroma plane would be half-height; I fixed this to use the
actual shift value on the plane.

We also need to pass the SPS and PPS range extension flags.
2019-02-16 08:47:36 -08:00
Philip Langdale
f4ea930a11 avcodec/hevc_ps: Expose all SPS and PPS range extension flags
We need all the flags to be exposed to be able to pass them on to
HW decoders. I did not attempt to nuance any of the warnings about
flags being unsupported as there's no way, at the point we extract
flags, to say whether an HW decoder is being used.
2019-02-16 08:47:36 -08:00
Timo Rothenpieler
9e1e521393 avutil/cuda_check: fix usage of removed .c file
Why did this not break compilation?
2019-02-15 00:44:12 +01:00
Michael Niedermayer
b0d8b7cb8e avformat/mov: Do not use reference stream in mov_read_sidx() if there is no reference stream
Fixes: NULL pointer dereference
Fixes: clusterfuzz-testcase-minimized-audio_decoder_fuzzer-5634316373721088

Reported-by: Chris Cunningham <chcunningham@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-02-14 21:55:43 +01:00
Roman Arzumanyan
f1f66df6a2 avcodec/nvenc: add b_as_ref support for HEVC
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2019-02-14 13:22:09 +01:00
Timo Rothenpieler
15c6390139 avutil/cuda_check: avoid pointlessly exporting same symbol from two libraries 2019-02-14 13:21:07 +01:00
Marton Balint
dbfd042983 avformat/utils: parse some stream specifiers recursively
This removes lots of code duplication and also allows more complex specifiers,
for example you can use p:204:aⓂ️language:eng to select the English language
audio stream from program 204.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-02-13 23:21:53 +01:00
Marton Balint
b35843e391 avformat/mpegts: also convert strings without a specified encoding to UTF-8
The default codepage (ISO6937) should be used in this case.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-02-13 22:01:39 +01:00
Marton Balint
dd6dd49f1d avformat/mpegts: fix charset of type 0x11
ISO-10646 alone means UCS-4 for iconv, the specs refers to the Basic
Multilingual Plane (BMP), therefore we need UCS-2. VLC also using that.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-02-13 22:01:39 +01:00
Reto Kromer
bf78aa9ee9 doc/muxers: fix typo
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
2019-02-13 18:47:16 +05:30
Jun Zhao
ff5ed7abd6 avfilter/tests/integral: Correct the comment
Correct the comment

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2019-02-13 19:59:39 +08:00
Moritz Barsnick
a84af760b8 configure: fix dependencies for mlp and truehd encoders
Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
2019-02-12 22:53:03 +01:00
Jan Ekström
466cb4ed56 lavc/libaribb24: use integer math to calculate font scaling 2019-02-12 20:16:40 +02:00
Jan Ekström
1ed9e8e937 lavc/libaribb24: add missing type struct members to AVOptions 2019-02-12 20:16:40 +02:00
Jan Ekström
03824afdb4 lavc/libaribb24: protect handled value with parenthesis in RGB_TO_BGR 2019-02-12 20:16:40 +02:00
Jan Ekström
4beccf400d lavc/libaribb24: add error handling to region handling
Fixes some rather embarrassing mistakes that somehow passed my
eyes.

* Now catches if memory allocation has failed during bprint usage
  by checking av_bprint_is_complete().
* Now catches if adding an ASS rectangle into an AVSubtitle failed.
* Returns AVERROR_INVALIDDATA if we get an invalid region buffer
  length.
2019-02-12 20:16:40 +02:00
Jun Zhao
84e7aff608 tests/api/api-h264-test: Add AV_NOPTS_VALUE check for AVFrame.pkt_dts/pts
Use av_ts2str() for AVFrame.pkt_dts/pts to avoid print the
pkt_dts/pts as negative number like:
"0,    3616613, -9223372036854775808,     1001,  3110400, 0x75e37a65"

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2019-02-12 22:28:15 +08:00
Jun Zhao
9f33b0ed39 avfilter/tests/integral: Fix build warning after adjust the location
Fix build warning like "warning: ISO C90 forbids mixed declarations
and code" after adjust the location for malloc fail check.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2019-02-12 09:09:29 +08:00
Jun Zhao
6382d03347 avfilter/tests/integral: Check malloc fail before using it
Need to check malloc fail before using it, so adjust the location
in the code.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2019-02-12 09:08:27 +08:00
Marton Balint
0c3333faf6 configure: warn about disabled explicitly enabled components
If we enable a component but a dependant library is disabled, then the enabled
component gets silently disabled. Warning about disabled explicitly enabled components
allows configure to show the missing dependencies and if --fatal-warnings is
used it can also fail if the user wants it so.

For example if libdav1d is not availble ./configure --enable-decoder=libdav1d
succeeds but the libdav1d decoder is not be enabled. After the patch configure
will warn about this:

WARNING: Disabled libdav1d_decoder because not all dependencies are satisfied: libdav1d

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-02-11 22:01:48 +01:00
Charles Liu
aa25198f1b avformat/mov: fix hang while seek on a kind of fragmented mp4
Binary searching would hang if the fragment items do NOT have timestamp for the
specified stream.

For example, a fmp4 consists of separated 'moof' boxes for each track, and
separated 'sidx' for each segment, but no 'mfra' box.  Then every fragment item
only have the timestamp for one of its tracks.

Example:
ffmpeg -f lavfi -i testsrc -f lavfi -i sine -movflags dash+frag_keyframe+skip_trailer+separate_moof -t 1 out.mp4
ffmpeg -ss 0.5 -i out.mp4 -f null none

Also fixes the hang in ticket #7572, but not the reason for having
AV_NOPTS_VALUE timestamps there.

Signed-off-by: Charles Liu <liuchh83@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-02-11 22:01:06 +01:00
James Almer
00fd38f184 avformat/mov: don't rescale mastering display values from the SmDm atom
Simplifies code.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-02-11 16:58:27 -03:00
Reto Kromer
6174686bc3 doc/faq: update macOS and URLs
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
2019-02-11 10:13:31 +05:30
James Almer
3e8b8b6b50 avcodec/cbs_av1: don't call cbs_av1_read_trailing_bits() when no bits remain in the OBU
Reviewed-by: jkqxz
Signed-off-by: James Almer <jamrial@gmail.com>
2019-02-10 17:43:26 -03:00
Carl Eugen Hoyos
6de396c216 lavf/img2: Move "loop" into common options.
While the image2pipe demuxer ignores the option - confusing users -
the autodetecting demuxers that are favoured over image2 act on it.
2019-02-10 18:56:46 +01:00
Carl Eugen Hoyos
826cc58deb lavf/img2dec: Split img2 and img2pipe options. 2019-02-10 17:56:01 +01:00
Reto Kromer
21858b060f doc/snow: fix typos 2019-02-10 16:46:56 +01:00
Moritz Barsnick
885a80d189 doc: fix various typos
Found with the help of codespell-1.14.0.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
2019-02-10 21:12:40 +05:30
Reto Kromer
d20902fd23 doc/filters: fix typos
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
2019-02-10 12:17:09 +05:30
Steven Liu
9ec1f7634a avformat/hlsenc: fix fmp4_init_filename file name with %v problem
when set option fmp4_init_filename to init_%v.mp4
before patch:
the init file will be init_%v_0.mp4, init_%v_1.mp4
after patch:
the init file will be init_0.mp4, init_1.mp4

Reported-By: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-02-10 14:45:43 +08:00
Jan Ekström
a03885b745 lavf/mpegts: add reading of ARIB data coding descriptor
This enables us to read the data coding type utilized for
a specific private data stream, of which we currently are
interested in ARIB caption streams.

The component tag limitations are according to ARIB TR-B14,
and the component IDs are defined in ARIB STD-B10.
2019-02-10 03:30:56 +02:00
Jan Ekström
100bfac6d6 add libaribb24 ARIB STD-B24 caption decoder
* Outputs ASS lines with basic coloring and font scaling for each
  given region.
* Sets the default style to the resolution of the subtitle plane
  (for example, 960x540 / 36pt font for profile A).
* Has options to:
  * Disable ruby text (which is coded as regions which have
    half-height text in libaribb24).
    Enabled by default as without positioning ruby text only
    confuses as it is usually coded in the beginning of the decoded
    subtitle line.
  * Set the working directory, in which libaribb24 will read
    configuration as well as into which it may save broadcast extra
    symbols as PNG.
    Unset by default.

The unconventional library check can be explained by the library's
current master branch being licensed as LGPLv3, but at the time of
writing the latest official release is still licensed under GPLv3.

Thus, one either has to wait for the following release, or enable
GPLv3.
2019-02-10 03:30:52 +02:00
Carl Eugen Hoyos
5c515b5f7d lavf/mpegts: Convert service_name and service_provider to utf-8.
Fixes ticket #6320.
2019-02-09 23:49:51 +01:00
Reto Kromer
5b32f94b97 doc/ffprobe: fix typo and update URL in man 2019-02-09 20:01:18 +01:00
Michael Niedermayer
dfae0e295a tools/target_dec_fate.list: Extend selftests upto issue 2000
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-02-09 14:40:50 +01:00
Michael Niedermayer
4cde7e62db avcodec/sbrdsp_fixed.c: remove input value limit for sbr_sum_square_c()
Fixes: 1377/clusterfuzz-testcase-minimized-5487049807233024
Fixes: assertion failure in sbr_sum_square_c()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-02-09 14:40:50 +01:00
Carl Eugen Hoyos
0cac68bcf9 lavu/parseutils: Allow to parse >= 100 hours.
Reported and tested by gamnark.
Fixes ticket #7721.
2019-02-09 13:59:10 +01:00
Michael Niedermayer
7f8bfbee36 avcodec/h264_parse: Clear ref_list[1] if only [0] is used
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-02-08 12:00:59 +01:00
Decai Lin
9d800d39d5 avcodec/h264_parse: no need check ref list1 for P slices.
This is robust for some corner case there is incorrect list1 count
in pps header, but it's a P slice and can be decoded well.

Signed-off-by: Decai Lin <decai.lin@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-02-08 12:00:59 +01:00