]> git.sesse.net Git - ffmpeg/log
ffmpeg
6 years agolavf/mov.c: Set st->start_time for video streams explicitly.
Sasi Inguva [Tue, 29 May 2018 22:36:07 +0000 (15:36 -0700)]
lavf/mov.c: Set st->start_time for video streams explicitly.

If start_time is not set, ffmpeg takes the duration from the global
movie instead of the per stream duration.
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agolavf/mov.c: Fix timestamps to be strictly monotonic for video also.
Sasi Inguva [Thu, 29 Mar 2018 22:58:09 +0000 (15:58 -0700)]
lavf/mov.c: Fix timestamps to be strictly monotonic for video also.

We already do this for audio, but it should be done for video too.
If we don't, seeking back to the start of the file, for example, can
become quite broken, since the first N packets will have repeating
and nonmonotonic PTS, yet they need to be decoded even if they are
to be discarded.

Signed-off-by: Sasi Inguva <isasi@isasi.mtv.corp.google.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
6 years agoAdds TensorFlow backend for dnn inference module.
Sergey Lavrushkin [Sun, 3 Jun 2018 17:22:50 +0000 (20:22 +0300)]
Adds TensorFlow backend for dnn inference module.

Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
6 years agoavcodec/magicyuvenc: mark as not more experimental
Paul B Mahol [Tue, 5 Jun 2018 09:28:48 +0000 (11:28 +0200)]
avcodec/magicyuvenc: mark as not more experimental

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavcodec/magicyuvenc: write max huffman length and extradata too
Paul B Mahol [Thu, 25 Jan 2018 13:55:17 +0000 (14:55 +0100)]
avcodec/magicyuvenc: write max huffman length and extradata too

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agodoc/filters: mention required compile options for some filters
Lou Logan [Tue, 5 Jun 2018 00:38:20 +0000 (16:38 -0800)]
doc/filters: mention required compile options for some filters

Signed-off-by: Lou Logan <lou@lrcd.com>
6 years agoavcodec/opus_silk: Change silk_lsf2lpc() slightly toward silk/NLSF2A.c
Michael Niedermayer [Sat, 2 Jun 2018 23:33:54 +0000 (01:33 +0200)]
avcodec/opus_silk: Change silk_lsf2lpc() slightly toward silk/NLSF2A.c

Fixes: runtime error: signed integer overflow: -1440457022 - 785819492 cannot be represented in type 'int'
Fixes: 7700/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OPUS_fuzzer-6595838684954624
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/amrwbdec: Fix division by 0 in find_hb_gain()
Michael Niedermayer [Sat, 2 Jun 2018 22:48:06 +0000 (00:48 +0200)]
avcodec/amrwbdec: Fix division by 0 in find_hb_gain()

This restructures the code slightly toward D_UTIL_dec_synthesis()

Fixes: 7420/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AMRWB_fuzzer-6577305112543232
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agofftools/ffmpeg: fix for all forced key frames when 'copyts' is enabled
Vishwanath Dixit [Sun, 6 May 2018 17:08:59 +0000 (22:38 +0530)]
fftools/ffmpeg: fix for all forced key frames when 'copyts' is enabled

Forced key frames generation functionality was assuming the first PTS
value as zero, but, when 'copyts' is enabled, the first PTS can be any
big number. This was eventually forcing all the frames as key frames.
To resolve this issue, update has been made to use first input pts as
reference pts.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/vc1: fix out-of-bounds reference pixel replication
Jerome Borsboom [Tue, 29 May 2018 12:26:17 +0000 (14:26 +0200)]
avcodec/vc1: fix out-of-bounds reference pixel replication

Out-of-bounds reference pixel replication should take into account the frame
coding mode of the reference frame(s), not the frame coding mode of the
current frame.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agoavfilter/drawtext: present 'hms' formatted 'pts' in 24h format
Vishwanath Dixit [Mon, 7 May 2018 13:16:42 +0000 (18:46 +0530)]
avfilter/drawtext: present 'hms' formatted 'pts' in 24h format

HMS is formatted as HH:MM:SS.mmm, but, HH part is not limited to
24 hours. For example, the the drawn text may look like this:
243029:20:30.342. To present the timestamp in more readable and
user friendly format, this patch provides an additional option
to limit the hour part in the range 0-23.

Note: Actually the above required format can be obtained with
format options 'localtime' and 'gmtime', but,  milliseconds part
is not supported in those formats.

6 years agov4l2_m2m: Mark V4L2 M2M decoders as unsuitable for probing
Mark Thompson [Sat, 26 May 2018 16:13:20 +0000 (17:13 +0100)]
v4l2_m2m: Mark V4L2 M2M decoders as unsuitable for probing

6 years agoavfilter/f_drawgraph: fix drawing of first point for non-first metadata key
Paul B Mahol [Sun, 3 Jun 2018 16:50:04 +0000 (18:50 +0200)]
avfilter/f_drawgraph: fix drawing of first point for non-first metadata key

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavfilter/vf_zoompan: do not increase VAR_IN twice, also count from 0
Paul B Mahol [Sun, 3 Jun 2018 12:49:57 +0000 (14:49 +0200)]
avfilter/vf_zoompan: do not increase VAR_IN twice, also count from 0

Fixes #7242.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavfilter/avf_showspectrum: also show sample rate and channel layout
Paul B Mahol [Sun, 3 Jun 2018 10:43:43 +0000 (12:43 +0200)]
avfilter/avf_showspectrum: also show sample rate and channel layout

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavfilter/avf_showspectrum: avoid overwritting text
Paul B Mahol [Sun, 3 Jun 2018 10:26:43 +0000 (12:26 +0200)]
avfilter/avf_showspectrum: avoid overwritting text

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavfilter/avf_showspectrum: improve axes drawing
Paul B Mahol [Sun, 3 Jun 2018 10:06:35 +0000 (12:06 +0200)]
avfilter/avf_showspectrum: improve axes drawing

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavcodec/vp3: Fix end of bitstream check in unpack_superblocks()
Michael Niedermayer [Wed, 30 May 2018 20:51:33 +0000 (22:51 +0200)]
avcodec/vp3: Fix end of bitstream check in unpack_superblocks()

Fixes: regression
Found-by: Frank Liberato <liberato@google.com>
Tested-by: Frank Liberato <liberato@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavfilter/vf_lut3d: unbreak haldclut with planar rgb formats
Paul B Mahol [Sat, 2 Jun 2018 17:14:26 +0000 (19:14 +0200)]
avfilter/vf_lut3d: unbreak haldclut with planar rgb formats

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agolavfi/Makefile: move dnn_*.o under vf_srcnn
Jan Ekström [Sat, 2 Jun 2018 15:07:22 +0000 (18:07 +0300)]
lavfi/Makefile: move dnn_*.o under vf_srcnn

These files depend on libavformat, and the vf_srcnn filter
currently is the only thing utilizing these dnn_* files and
already happens to have a dependency on libavformat.

This fixes compilation in cases where libavformat is not a
dependency for libavfilter.

Reported by Kam_ on IRC.

6 years agodoc/ffmpeg: rewrite Stream Selection chapter
Gyan Doshi [Thu, 24 May 2018 13:41:00 +0000 (19:11 +0530)]
doc/ffmpeg: rewrite Stream Selection chapter

Flesh out with details and examples to show quirks and limitations.

6 years agoavfilter: add adeclick and adeclip audio filters
Paul B Mahol [Mon, 8 Jan 2018 14:02:59 +0000 (15:02 +0100)]
avfilter: add adeclick and adeclip audio filters

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agolibavformat/mov: Fix heap buffer overflow.
Jacob Trimble [Thu, 31 May 2018 17:41:29 +0000 (10:41 -0700)]
libavformat/mov: Fix heap buffer overflow.

Found by Chrome's ClusterFuzz: https://crbug.com/847060

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agolavc/libx265: allow users to set closed GOP via generic lavc flag
Gyan Doshi [Fri, 1 Jun 2018 10:44:02 +0000 (16:14 +0530)]
lavc/libx265: allow users to set closed GOP via generic lavc flag

lavc flag 'cgop' can be used to set closed GOP.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
6 years agoavcodec/dpx: Support for RGBA 12-bit packed decoding
Jérôme Martinez [Fri, 1 Jun 2018 08:09:01 +0000 (10:09 +0200)]
avcodec/dpx: Support for RGBA 12-bit packed decoding

Limited to widths multiple of 2 due to lack of test files for such corner case

This partially fixes ticket #5639

6 years agoavcodec/dnxhdenc: do not free nonexistent slice threads data when frame threading...
Paul B Mahol [Fri, 1 Jun 2018 08:54:39 +0000 (10:54 +0200)]
avcodec/dnxhdenc: do not free nonexistent slice threads data when frame threading is used

Forgotten in 28e9ba951d1a0b0aca53b242aa64f484ca75e874.
Fixes #7241.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agodoc/ffmpeg: remove non-existent vdt option
Gyan Doshi [Thu, 31 May 2018 19:53:12 +0000 (01:23 +0530)]
doc/ffmpeg: remove non-existent vdt option

6 years agoavfilter: use av_clip_uintp2_c where clip is variable
John Cox [Thu, 31 May 2018 14:22:59 +0000 (16:22 +0200)]
avfilter: use av_clip_uintp2_c where clip is variable

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavformat/mxfdec: add some missing picture_essence_container_uls
Marton Balint [Sun, 20 May 2018 16:32:11 +0000 (18:32 +0200)]
avformat/mxfdec: add some missing picture_essence_container_uls

Signed-off-by: Marton Balint <cus@passwd.hu>
6 years agoavformat/mxfdec: use int math for sample count calculation
Marton Balint [Sat, 26 May 2018 08:51:16 +0000 (10:51 +0200)]
avformat/mxfdec: use int math for sample count calculation

This also changes the rounding to nearest.

Signed-off-by: Marton Balint <cus@passwd.hu>
6 years agoavformat/mxfdec: fix klv_decode_ber_length return value usage
Marton Balint [Sun, 27 May 2018 18:39:09 +0000 (20:39 +0200)]
avformat/mxfdec: fix klv_decode_ber_length return value usage

Signed-off-by: Marton Balint <cus@passwd.hu>
6 years agotools/crypto_bench: add missing RC4 implementation from tomcrypt
James Almer [Wed, 30 May 2018 17:34:57 +0000 (14:34 -0300)]
tools/crypto_bench: add missing RC4 implementation from tomcrypt

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agotools/crypto_bench: add missing RC4 implementation from gcrypt
James Almer [Wed, 30 May 2018 16:52:28 +0000 (13:52 -0300)]
tools/crypto_bench: add missing RC4 implementation from gcrypt

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agotools/crypto_bench: add support for mbedcrypto
James Almer [Sun, 27 May 2018 21:17:54 +0000 (18:17 -0300)]
tools/crypto_bench: add support for mbedcrypto

Requires mbed TLS 2.7.0 or newer

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavcodec/h263dec: Reinitialize idct context if it has not been setup for the active...
Michael Niedermayer [Mon, 28 May 2018 20:29:58 +0000 (22:29 +0200)]
avcodec/h263dec: Reinitialize idct context if it has not been setup for the active profile

The profile after reading headers can be different from when the context was initialized

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/idctdsp: Clear idct/idct_add for studio profile
Michael Niedermayer [Mon, 28 May 2018 20:29:57 +0000 (22:29 +0200)]
avcodec/idctdsp: Clear idct/idct_add for studio profile

This does not leave them "as before" which may be a value from a previous profile

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/idctdsp: Transmit studio_profile to init instead of using AVCodecContext...
Michael Niedermayer [Mon, 28 May 2018 19:19:08 +0000 (21:19 +0200)]
avcodec/idctdsp: Transmit studio_profile to init instead of using AVCodecContext profile

These 2 fields are not always the same, it is simpler to always use the same field
for detecting studio profile

Fixes: null pointer dereference
Fixes: ffmpeg_crash_3.avi
Found-by: Thuan Pham <thuanpv@comp.nus.edu.sg>, Marcel Böhme, Andrew Santosa and Alexandru RazvanCaciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavfilter/af_aiir: draw IR frequency response
Paul B Mahol [Wed, 30 May 2018 10:43:09 +0000 (12:43 +0200)]
avfilter/af_aiir: draw IR frequency response

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavfilter/af_afir: fix picking of IR channel
Paul B Mahol [Wed, 30 May 2018 10:30:24 +0000 (12:30 +0200)]
avfilter/af_afir: fix picking of IR channel

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoflvenc: Fix sequence header update timestamps
Alex Converse [Thu, 26 Apr 2018 20:46:28 +0000 (13:46 -0700)]
flvenc: Fix sequence header update timestamps

6 years agoflvenc: Factorize timestamp writing
Alex Converse [Fri, 11 May 2018 01:08:01 +0000 (18:08 -0700)]
flvenc: Factorize timestamp writing

The code is trivial but the semantics in the spec are ambiguous. This
should help keep parts of the muxer interpreting them consistently.

6 years agolavfi/tests: Fix 16-bit vf_blend test to avoid memory not aligned to 2 bytes
Andrey Semashev [Wed, 23 May 2018 21:07:36 +0000 (00:07 +0300)]
lavfi/tests: Fix 16-bit vf_blend test to avoid memory not aligned to 2 bytes

Generic C implementation of vf_blend performs reads and writes of 16-bit
elements, which requires the buffers to be aligned to at least 2-byte
boundary.

Also, the change fixes source buffer overrun caused by src_offset being
added to to test handling of misaligned buffers.

Fixes: #7226
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoqt-faststart - stricter input validations
erankor [Tue, 29 May 2018 13:18:05 +0000 (16:18 +0300)]
qt-faststart - stricter input validations

1. validate the moov size before checking for cmov atom
2. avoid performing arithmetic operations on unvalidated numbers
3. verify the stco/co64 offset count does not overflow the stco/co64
atom (not only the moov atom)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/qtrle: Do not output duplicated frames on insufficient input
Michael Niedermayer [Sun, 27 May 2018 19:59:58 +0000 (21:59 +0200)]
avcodec/qtrle: Do not output duplicated frames on insufficient input

This improves performance and makes qtrle behave more similar to other decoders.
Libavcodec does generally not output known duplicated frames, instead the calling Application
can insert them as it needs.

Fixes: Timeout
Fixes: 6383/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QTRLE_fuzzer-6199846902956032
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoffplay: Print codec_name if decoder for codec_id could not be found.
Carl Eugen Hoyos [Tue, 29 May 2018 23:09:49 +0000 (01:09 +0200)]
ffplay: Print codec_name if decoder for codec_id could not be found.

Reviewed-by: Marton Balint
6 years agoavfilter/af_afir: draw IR frequency response
Paul B Mahol [Tue, 29 May 2018 16:24:22 +0000 (18:24 +0200)]
avfilter/af_afir: draw IR frequency response

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoAdds dnn inference module for simple convolutional networks. Reimplements srcnn filte...
Sergey Lavrushkin [Fri, 25 May 2018 17:31:04 +0000 (20:31 +0300)]
Adds dnn inference module for simple convolutional networks. Reimplements srcnn filter based on it.

Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
6 years agodoc/ffmpeg: update disposition values
Gyan Doshi [Tue, 29 May 2018 06:27:58 +0000 (11:57 +0530)]
doc/ffmpeg: update disposition values

Thumbnail example added. Avoid transcoding in older examples.

6 years agoavformat/movenc: creating producer reference time (PRFT) box
Vishwanath Dixit [Mon, 7 May 2018 09:57:51 +0000 (15:27 +0530)]
avformat/movenc: creating producer reference time (PRFT) box

The producer reference time box supplies relative wall-clock times
at which movie fragments, or files containing movie fragments
(such as segments) were produced.
The box is mainly useful in live streaming use cases. A media player
can parse the box and utilize the time fields to measure and improve
the latency during real time playout.

6 years agoavformat/utils: function to get the formatted ntp time
Vishwanath Dixit [Mon, 7 May 2018 09:57:36 +0000 (15:27 +0530)]
avformat/utils: function to get the formatted ntp time

This utility function creates 64-bit NTP time format as per the RFC
5905.
A simple explaination of 64-bit NTP time format is here
http://www.beaglesoft.com/Manual/page53.htm

6 years agoavcodec/vc1: store zero MVs for all blocks in a MB
Jerome Borsboom [Mon, 28 May 2018 21:50:28 +0000 (23:50 +0200)]
avcodec/vc1: store zero MVs for all blocks in a MB

Direct prediction for interlace frame B pictures references the mv in the
second block in an MB in the backward reference frame for the twomv case.
When the backward reference frame is an I frame, this value may be unset.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agoavcodec/vc1: fix mquant calculation for interlace field pictures
Jerome Borsboom [Fri, 18 May 2018 15:06:23 +0000 (17:06 +0200)]
avcodec/vc1: fix mquant calculation for interlace field pictures

For interlace field pictures s->mb_height indicates the height of the full
picture in MBs, i.e. the two fields combined. A single field is half this
size. When calculating mquant for interlace field pictures, the bottom edge
is the last MB row of the field.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agoavcodec/allcodecs: Provide empty codec_list in allcodecs when ossfuzz is used
Michael Niedermayer [Mon, 28 May 2018 00:37:48 +0000 (02:37 +0200)]
avcodec/allcodecs: Provide empty codec_list in allcodecs when ossfuzz is used

The last workaround is not sufficient to make oss fuzz work with the iterate API
as it did not provide a FFmpeg that external libs can be linked to.

This patch does not fully restore the pre iterate functionality. My attempts to
do this have so far failed.

The problem with this solution is that it renders the fuzzers virtual system
ffmpeg (libs) non functional. Which differs from a real system compared to the
virtual system tested by the fuzzer.
It should theoretically not matter as the system ffmpeg wouldnt be used.
But with more cases being fuzzed we likely will hit a case where a external
lib is involved and it does matter ...

Working around this may be possible with weak symbols but so far my attempts
failed

Alternatively multiple ffmpeg could be built, this becomes messy though
quickly as they need to be all linked together. That is we need a FFmpeg
that has the iterate API modified so it can work with the resources
available to ossfuzz. And at the same time we need a ffmpeg that has
its full functionality for any external libs which use ffmpeg and are
used by ffmpeg.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agolavf/libssh: translate a read of 0 to EOF
Jan Ekström [Mon, 28 May 2018 00:21:35 +0000 (03:21 +0300)]
lavf/libssh: translate a read of 0 to EOF

Yet another case of forgotten 0 =! EOF translation.

While the documentation for this specific synchronous read
function does not mention it, the documentation for
`sftp_async_read` documents it, as well as looking at the
implementation of this function leads one to find
`if (handle->eof) { return 0; }`.

Reported by stnutt on IRC.

6 years agocmdutils: dump supported hardware devices in print_codec()
Jun Zhao [Sat, 26 May 2018 12:57:45 +0000 (20:57 +0800)]
cmdutils: dump supported hardware devices in print_codec()

dump the supported hardware devices for codec when use the command
like ./ffmpeg -h decoder=h264.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
6 years agocmdutils: print missing caps in print_codec().
Jun Zhao [Fri, 25 May 2018 06:57:48 +0000 (14:57 +0800)]
cmdutils: print missing caps in print_codec().

print full caps type in print_codec().

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
6 years agoavformat/dashenc: Added a warning for incorrect segment name extension
Karthick Jeyapal [Mon, 14 May 2018 05:51:46 +0000 (11:21 +0530)]
avformat/dashenc: Added a warning for incorrect segment name extension

Applicable only to webm output format.
By default all the segment filenames end with .m4s extension.
When someone chooses webm output format, we recommend they also override the relevant segment name options to end with .webm extension. This patch will issue a warning for he same

6 years agoavformat/dashenc: Added option for Segment file format
Karthick Jeyapal [Fri, 4 May 2018 05:15:58 +0000 (10:45 +0530)]
avformat/dashenc: Added option for Segment file format

Right now segment file format is chosen to be either mp4 or webm based on the codec format.
This patch makes that choice configurable by the user, instead of being decided by the muxer.

Also with this change per-stream choice segment file format(based on codec type) is not possible.
All the output audio and video streams should be in the same file format.

6 years agoavcodec/ac3dec: Check that the number of channels with dependant streams is valid
Michael Niedermayer [Fri, 25 May 2018 20:55:19 +0000 (22:55 +0200)]
avcodec/ac3dec: Check that the number of channels with dependant streams is valid

Fixes: left shift of 1 by 63 places cannot be represented in type 'long long'
Fixes: out of array access
Fixes: 7284/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5767914968842240
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/ac3dec: Fix null pointer dereference in ac3_decode_frame()
Michael Niedermayer [Fri, 25 May 2018 20:22:27 +0000 (22:22 +0200)]
avcodec/ac3dec: Fix null pointer dereference in ac3_decode_frame()

Fixes: index 8 out of bounds for type 'uint8_t *[8]'
Fixes: 7273/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-6296497667702784
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/aacdec_fixed: use 64bit to avoid overflow in rounding in apply_dependent_coup...
Michael Niedermayer [Fri, 25 May 2018 20:06:48 +0000 (22:06 +0200)]
avcodec/aacdec_fixed: use 64bit to avoid overflow in rounding in apply_dependent_coupling_fixed()

Fixes: signed integer overflow: -2141499320 + -14469590 cannot be represented in type 'int'
Fixes: 7351/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-6351214791884800
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agooavcodec/aacpsdsp_template: Use unsigned for hs0X to prevent undefined behavior
Michael Niedermayer [Fri, 25 May 2018 20:02:20 +0000 (22:02 +0200)]
oavcodec/aacpsdsp_template: Use unsigned for hs0X to prevent undefined behavior

Fixes: signed integer overflow: 1073741842 + 1784008138 cannot be represented in type 'int'
Fixes: 6792/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5677589835284480
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/g723_1dec: Clip bits2 in both directions
Michael Niedermayer [Fri, 25 May 2018 19:56:04 +0000 (21:56 +0200)]
avcodec/g723_1dec: Clip bits2 in both directions

Fixes: shift exponent 33 is too large for 32-bit type 'int'
Fixes: 6743/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G723_1_fuzzer-5823772687859712
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/mpeg4videoenc: Use 64 bit for times in mpeg4_encode_gop_header()
Michael Niedermayer [Mon, 21 May 2018 21:08:05 +0000 (23:08 +0200)]
avcodec/mpeg4videoenc: Use 64 bit for times in mpeg4_encode_gop_header()

Fixes truncation
Fixes Assertion n <= 31 && value < (1U << n) failed at libavcodec/put_bits.h:169
Fixes: ffmpeg_crash_2.avi
Found-by: Thuan Pham <thuanpv@comp.nus.edu.sg>, Marcel Böhme, Andrew Santosa and Alexandru RazvanCaciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agolavc/hevcdec: Treat clean random access nals as keyframes for -skip_frame.
Carl Eugen Hoyos [Sun, 27 May 2018 20:51:06 +0000 (22:51 +0200)]
lavc/hevcdec: Treat clean random access nals as keyframes for -skip_frame.

Fixes ticket #7227.

Reviewed-by: Mark Thompson
6 years agolibavformat/mxfenc: Add some () to attempt to workaround build issue on osx
Michael Niedermayer [Tue, 22 May 2018 18:57:13 +0000 (20:57 +0200)]
libavformat/mxfenc: Add some () to attempt to workaround build issue on osx

fixes ticket7209

Tested-by: Jim DeLaHunt <from.ffmpeg-dev@jdlh.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoconfigure: Omit fsanitize flags if they are already specified by the user
Michael Niedermayer [Sat, 26 May 2018 00:28:57 +0000 (02:28 +0200)]
configure: Omit fsanitize flags if they are already specified by the user

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoconfigure: fix check for mbedtls
Reino Wijnsma [Wed, 23 May 2018 00:11:30 +0000 (02:11 +0200)]
configure: fix check for mbedtls

Add missing libraries needed when linking with a static build of MbedTLS.

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavformat/mxf: fix NTSC 59.94 samples per frame layout
Marton Balint [Thu, 24 May 2018 20:03:43 +0000 (22:03 +0200)]
avformat/mxf: fix NTSC 59.94 samples per frame layout

FFmbc uses this.
bmx uses this.
XAVC MXF Mapping and Operating Points prefers this.
Basic rounding rules also yields these numbers.

Signed-off-by: Marton Balint <cus@passwd.hu>
6 years agolavc/cfhd: interlaced frame decoding added
Gagandeep Singh [Tue, 22 May 2018 15:40:21 +0000 (21:10 +0530)]
lavc/cfhd: interlaced frame decoding added

ticket #5522 output of given samples significantly improved

6 years agoavcodec/mlpdec: Only change noise_type if the related fields are valid
Michael Niedermayer [Thu, 17 May 2018 11:58:46 +0000 (13:58 +0200)]
avcodec/mlpdec: Only change noise_type if the related fields are valid

Fixes: inconsistency
Fixes:runtime error: index 8 out of bounds for type 'int32_t [8]'
Fixes: 6686/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEHD_fuzzer-5191383498358784
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoindeo4: Decode all or nothing of a band header.
Michael Niedermayer [Thu, 17 May 2018 11:40:38 +0000 (13:40 +0200)]
indeo4: Decode all or nothing of a band header.

This avoids inconsistent value combinations.
Alternatively it would be possible to add more checks and careful use of
temporary variables, but my try of this quickly seemed to become
a rather large change.
The disadvantage of this, is that the struct is copied back and forth.

Fixes: index 6 out of bounds for type 'const uint16_t [5][16]'
Fixes: 6557/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO4_fuzzer-4787296550256640
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/ac3dec: Use frame_size if superframe_size is 0
Michael Niedermayer [Thu, 17 May 2018 23:48:38 +0000 (01:48 +0200)]
avcodec/ac3dec: Use frame_size if superframe_size is 0

Fixes: Infinite loop
Fixes: 7669/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-4689042185650176
Fixes: 7670/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_AC3_fuzzer-4706306762997760
Fixes: 7672/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-4702108499574784
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agolavc/hevc_ps: Use correct pix_fmt AV_PIX_FMT_GRAY9 for 9-bit 4:0:0 input.
Carl Eugen Hoyos [Fri, 25 May 2018 18:46:11 +0000 (20:46 +0200)]
lavc/hevc_ps: Use correct pix_fmt AV_PIX_FMT_GRAY9 for 9-bit 4:0:0 input.

6 years agolavc/j2kenc: Support AV_PIX_FMT_PAL8.
Carl Eugen Hoyos [Tue, 22 May 2018 00:21:04 +0000 (02:21 +0200)]
lavc/j2kenc: Support AV_PIX_FMT_PAL8.

6 years agolavf/img2dec: Auto-detect xwd images.
Carl Eugen Hoyos [Fri, 25 May 2018 18:06:34 +0000 (20:06 +0200)]
lavf/img2dec: Auto-detect xwd images.

6 years agodoc/codecs: Remove option sc_factor.
Carl Eugen Hoyos [Thu, 24 May 2018 16:21:05 +0000 (18:21 +0200)]
doc/codecs: Remove option sc_factor.

Fixes ticket #7228.
The option was disabled since 4a62f477 and removed in 6e69525e.

6 years agoavformat/hlsenc: support http method for hls fmp4
Steven Liu [Thu, 24 May 2018 03:55:58 +0000 (11:55 +0800)]
avformat/hlsenc: support http method for hls fmp4

fix ticket: 7160

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
6 years agoavformat/dashdec: replace user-agent to user_agent for deprecate warning message
Steven Liu [Thu, 24 May 2018 03:43:35 +0000 (11:43 +0800)]
avformat/dashdec: replace user-agent to user_agent for deprecate warning message

6 years agoavformat/dashdec: Fix for ticket 7149 (Segfault when decoding dash streams)
Colin NG [Thu, 24 May 2018 03:10:17 +0000 (11:10 +0800)]
avformat/dashdec: Fix for ticket 7149 (Segfault when decoding dash streams)

simplify the code to check common init section

6 years agoavformat/dashdec: Fix for ticket 7149 (Segfault when decoding dash streams)
Colin NG [Thu, 24 May 2018 03:09:20 +0000 (11:09 +0800)]
avformat/dashdec: Fix for ticket 7149 (Segfault when decoding dash streams)

Add NULL pointer check for init_section

6 years agohwcontext_vaapi: Fix mapping from DRM
Mark Thompson [Thu, 24 May 2018 00:17:12 +0000 (01:17 +0100)]
hwcontext_vaapi: Fix mapping from DRM

This was broken by bed670a1de29b58fcb3fe046562d8bd125b1457f, which added
an assert that always failed.

6 years agoavformat/mov: replace a value error by clipping into valid range in mov_read_stsc()
Michael Niedermayer [Mon, 21 May 2018 01:16:58 +0000 (03:16 +0200)]
avformat/mov: replace a value error by clipping into valid range in mov_read_stsc()

Fixes: #7165
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/bintext: Reduce detection for random .bin files as it more likely is not...
Michael Niedermayer [Sat, 12 May 2018 16:33:26 +0000 (18:33 +0200)]
avformat/bintext: Reduce detection for random .bin files as it more likely is not a multimedia related file

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agolavc/jpeg2000dec: Move a variable declaration closer to its usage.
Carl Eugen Hoyos [Tue, 22 May 2018 10:55:46 +0000 (12:55 +0200)]
lavc/jpeg2000dec: Move a variable declaration closer to its usage.

6 years agolavc/jpeg2000dec: Use a define to clarify the meaning of a constant.
Carl Eugen Hoyos [Tue, 22 May 2018 10:54:32 +0000 (12:54 +0200)]
lavc/jpeg2000dec: Use a define to clarify the meaning of a constant.

6 years agolavc/h264_parse: Remove a superfluous linebreak.
Carl Eugen Hoyos [Tue, 22 May 2018 10:48:53 +0000 (12:48 +0200)]
lavc/h264_parse: Remove a superfluous linebreak.

6 years agolibavformat: add mbedTLS based TLS
Thomas Volkert [Sat, 21 Apr 2018 13:53:31 +0000 (15:53 +0200)]
libavformat: add mbedTLS based TLS

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavcodec/libvpxenc: fix setting amount of threads used for encoding
James Almer [Sat, 19 May 2018 18:01:56 +0000 (15:01 -0300)]
avcodec/libvpxenc: fix setting amount of threads used for encoding

The libvpx doxy says that a value of 0 for the g_threads field is
equivalent to a value of 1, whereas for avctx->thread_count it means
the maximum amount of threads possible for the host system.

Use av_cpu_count() to get the correct thread count when auto threads
is requested.

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
6 years agohwcontext: Add test for device creation and derivation
Mark Thompson [Tue, 15 May 2018 22:15:03 +0000 (23:15 +0100)]
hwcontext: Add test for device creation and derivation

This uses any devices it can find on the host system - on a system with no
hardware device support or in builds with no support included it will do
nothing and pass.

6 years agoavformat/mpegts: fix memory leak with merge_pmt_versions=1
Aman Gupta [Mon, 21 May 2018 19:13:06 +0000 (12:13 -0700)]
avformat/mpegts: fix memory leak with merge_pmt_versions=1

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agodoc: remove AVStream private fields from APIchanges
Aman Gupta [Mon, 21 May 2018 19:12:46 +0000 (12:12 -0700)]
doc: remove AVStream private fields from APIchanges

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavformat/mpegts: rename variable to clarify meaning
Aman Gupta [Mon, 21 May 2018 19:11:45 +0000 (12:11 -0700)]
avformat/mpegts: rename variable to clarify meaning

Both stream_id and stream_identifier are used in this file,
and have different meanings. The latter comes from the
stream_identifier_descriptor.

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavformat/mov: Only fail for STCO/STSC contradictions if both exist
Michael Niedermayer [Tue, 15 May 2018 15:07:00 +0000 (17:07 +0200)]
avformat/mov: Only fail for STCO/STSC contradictions if both exist

Fixes regression with playback of GF9720Repeal20the20Eighth20with20Helen20Linehan.m4a
See: crbug 822666

Found-by: "Mattias Wadman <mattias.wadman@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/mov: Break out early if chunk_count is 0 in mov_build_index()
Michael Niedermayer [Tue, 15 May 2018 15:06:59 +0000 (17:06 +0200)]
avformat/mov: Break out early if chunk_count is 0 in mov_build_index()

Without this some operations might overflow (undefined behavior)
even though the index adding loop would never execute

No testcase known

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/vc1: FIELDTX is only present in interlaced frame I/BI pictures
Jerome Borsboom [Sun, 20 May 2018 11:45:56 +0000 (13:45 +0200)]
avcodec/vc1: FIELDTX is only present in interlaced frame I/BI pictures

If v->fieldtx_is_raw is not reset to zero, it may spill over from a previous
interlaced frame I/BI picture.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/mp3dec: require 90% of a file to be mp3 if only 1 mp3 frame is found in...
Michael Niedermayer [Sat, 12 May 2018 16:33:29 +0000 (18:33 +0200)]
avformat/mp3dec: require 90% of a file to be mp3 if only 1 mp3 frame is found in sequence

This eliminates several low score detections of non mp3 files

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/mp3dec: Require 50% of the file to be mp3 frames in the maxframes>200 probin...
Michael Niedermayer [Sat, 12 May 2018 16:33:28 +0000 (18:33 +0200)]
avformat/mp3dec: Require 50% of the file to be mp3 frames in the maxframes>200 probing test

This corrects several misdetections of large files

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/mp3dec: Require probing data to be 50% mp3 frames for low score probing...
Michael Niedermayer [Sat, 12 May 2018 16:33:27 +0000 (18:33 +0200)]
avformat/mp3dec: Require probing data to be 50% mp3 frames for low score probing to succeed

This massively reduces the detection of random data as low score mp3
It may improve security by making it harder to read non multimedia data

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/vc1: fix calculation of the last line of a slice
Jerome Borsboom [Fri, 18 May 2018 15:06:32 +0000 (17:06 +0200)]
avcodec/vc1: fix calculation of the last line of a slice

Only for the last slice of the first field is the last line of the slice
equal to the height of the field.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>