ffmpeg.git
7 months agoavformat/avidec: fix demuxing of all keyframes of sample 200707170736151.avi
Paul B Mahol [Tue, 14 Aug 2018 18:06:32 +0000 (20:06 +0200)]
avformat/avidec: fix demuxing of all keyframes of sample 200707170736151.avi

7 months agodoc/general: add some missed codecs
Paul B Mahol [Tue, 21 Aug 2018 09:54:45 +0000 (11:54 +0200)]
doc/general: add some missed codecs

7 months agoavcodec: add IMM4 decoder
Paul B Mahol [Fri, 3 Aug 2018 17:43:20 +0000 (19:43 +0200)]
avcodec: add IMM4 decoder

This work is sponsored by VideoLAN.

7 months agoavfilter/buffersrc.h: fix typo of the comment
Steven Liu [Tue, 21 Aug 2018 07:44:33 +0000 (15:44 +0800)]
avfilter/buffersrc.h: fix typo of the comment

8 months agoavformat/nsvdec: Do not parse multiple NSVf
Michael Niedermayer [Thu, 16 Aug 2018 10:23:20 +0000 (12:23 +0200)]
avformat/nsvdec: Do not parse multiple NSVf

The specification states "NSV files may contain a single file header. "
Fixes: out of array access
Fixes: nsv-asan-002f473f726a0dcbd3bd53e422c4fc40b3cf3421

Found-by: Paul Ch <paulcher@icloud.com>
Tested-by: Paul Ch <paulcher@icloud.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/cfhd: Use the actual count instead of the expected in peak_table()
Michael Niedermayer [Sun, 12 Aug 2018 22:58:32 +0000 (00:58 +0200)]
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>
8 months agoavcodec/cfhd: Move peak_table() and difference_coding() calls after the existing...
Michael Niedermayer [Sun, 12 Aug 2018 22:44:48 +0000 (00:44 +0200)]
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>
8 months agoavcodec/lagarith: Optimize FRAME_SOLID_RGBA
Michael Niedermayer [Sun, 12 Aug 2018 22:19:55 +0000 (00:19 +0200)]
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>
8 months agoavformat/matroskaenc: handle AV1 extradata in packet side data
James Almer [Sat, 11 Aug 2018 02:25:32 +0000 (23:25 -0300)]
avformat/matroskaenc: handle AV1 extradata in packet side data

This is a temporary workaround for transcoding scenarious using libaom-av1
encoder, which currently can't propagate extradata during initialization.

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoImprove hls VOD mode hls performance problem.
Ronak Patel [Sun, 19 Aug 2018 01:57:44 +0000 (09:57 +0800)]
Improve hls VOD mode hls performance problem.

This fixes the creation of the hls manifest in hlsenc.c by writing the
entire manifest at the end for VOD playlists. Live & Event Playlists are unaffected.
This also fixes the behavior with HLS_TEMP_FILE to work correctly when
-hlsflags temp_file is specified, instead of always relying on use_rename, which caused these problems.

Files that would previously take over a week to fragment now take
1 minute on the same hardware. This was a 153 hour audio file (2.2GB of audio).

Signed-off-by: Ronak Patel <ronak2121@yahoo.com>
8 months agoavformat/dashdec: Fix strlen(rep_id_val) with it being NULL
Michael Niedermayer [Sat, 18 Aug 2018 00:19:51 +0000 (02:19 +0200)]
avformat/dashdec: Fix strlen(rep_id_val) with it being NULL

Fixes: dash-crash-da39a3ee5e6b4b0d3255bfef95601890afd80709.xml

Found-by: Paul Ch <paulcher@icloud.com>
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavformat/tls_schannel: Fix use of uninitialized variable
Paweł Wegner [Thu, 2 Aug 2018 19:08:12 +0000 (21:08 +0200)]
avformat/tls_schannel: Fix use of uninitialized variable

Fixes: runtime error: passing uninitialized value to FreeContextBuffer
causes a crash

Signed-off-by: Paweł Wegner <pawel.wegner95@gmail.com>
8 months agolavf/udp: use ff_log_net_error to replace log_net_error
Jun Zhao [Sat, 4 Aug 2018 09:49:57 +0000 (17:49 +0800)]
lavf/udp: use ff_log_net_error to replace log_net_error

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
8 months agolavf/tcp: check return value of setsockopt.
Jun Zhao [Sat, 4 Aug 2018 09:52:16 +0000 (17:52 +0800)]
lavf/tcp: check return value of setsockopt.

when setsockopt fail, use ff_log_net_error to dump the string
describing for error number.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
8 months agolavf/network: check return value of setsockopt.
Jun Zhao [Sun, 5 Aug 2018 12:19:28 +0000 (20:19 +0800)]
lavf/network: check return value of setsockopt.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
8 months agolavf/network: add a ff_log_net_error function.
Jun Zhao [Sat, 4 Aug 2018 09:48:15 +0000 (17:48 +0800)]
lavf/network: add a ff_log_net_error function.

add a ff_log_net_error function for error log.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
8 months agoavformat/rmdec: Fix EOF check in the stream loop in ivr_read_header()
Michael Niedermayer [Thu, 16 Aug 2018 13:36:29 +0000 (15:36 +0200)]
avformat/rmdec: Fix EOF check in the stream loop in ivr_read_header()

Fixes: long running loop
Fixes: ivr-timeout-42468cb797f52f025fb329394702f5d4d64322d6

Found-by: Paul Ch <paulcher@icloud.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavformat/mlvdec: read_string() received unsigned size, make the argument unsigned
Michael Niedermayer [Thu, 16 Aug 2018 13:36:28 +0000 (15:36 +0200)]
avformat/mlvdec: read_string() received unsigned size, make the argument unsigned

Fixes: infinite loop
Fixes: mlv-timeout-e3b8cab9835edecad6823baa057e029671329d04

Found-by: Paul Ch <paulcher@icloud.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavformat/av1: filter out tile list OBUs from samples
James Almer [Fri, 17 Aug 2018 18:26:05 +0000 (15:26 -0300)]
avformat/av1: filter out tile list OBUs from samples

As per the updated spec.

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavformat: bump micro version after previous changes
James Almer [Fri, 17 Aug 2018 18:22:28 +0000 (15:22 -0300)]
avformat: bump micro version after previous changes

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoRevert "avcodec/libaomdec: auto insert dump_extra bitstream filter"
James Almer [Fri, 17 Aug 2018 18:17:59 +0000 (15:17 -0300)]
Revert "avcodec/libaomdec: auto insert dump_extra bitstream filter"

This reverts commit e45ed15594a2553056a577177591fbe55694af44.

The Matroska spec was updated to not remove Sequence Header OBUs from key
frames, so this is no longer needed.

8 months agoavformat/av1: update ff_isom_write_av1c() to the latest revision of the spec
James Almer [Thu, 16 Aug 2018 21:01:44 +0000 (18:01 -0300)]
avformat/av1: update ff_isom_write_av1c() to the latest revision of the spec

This will get ISOBMFF and Matroska up to date with the revised AV1 Codec
Configuration Box spec.
For now keep propagating raw OBUs as extradata until all libavcodec modules
are adapted to handle AV1CodecConfigurationRecord formatted extradata.

Tested-by: Thomas Daede <bztdlinux@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/av1_parse: take trailing bits into account when initializing the GetBitContext
James Almer [Thu, 16 Aug 2018 02:31:04 +0000 (23:31 -0300)]
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>
8 months agoh264: Support multi-field closed captions by using AVBufferRef and not resetting...
Kieran Kunhya [Fri, 17 Aug 2018 14:12:14 +0000 (15:12 +0100)]
h264: Support multi-field closed captions by using AVBufferRef and not resetting per field

Signed-off-by: Josh de Kock <joshdk@obe.tv>
8 months agoavcodec/decode: copy the output parameters from the last bsf in the chain back to...
James Almer [Thu, 26 Jul 2018 23:43:19 +0000 (20:43 -0300)]
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>
8 months agoavcodec/decode: flush the internal bsfs instead of constantly reinitalizing them
James Almer [Thu, 26 Jul 2018 23:42:27 +0000 (20:42 -0300)]
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>
8 months agoavcodec/h264_redundant_pps_bsf: implement a AVBSFContext.flush() callback
James Almer [Fri, 27 Jul 2018 01:32:15 +0000 (22:32 -0300)]
avcodec/h264_redundant_pps_bsf: implement a AVBSFContext.flush() callback

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/mpeg4_unpack_bframes_bsf: implement a AVBSFContext.flush() callback
James Almer [Fri, 27 Jul 2018 01:26:01 +0000 (22:26 -0300)]
avcodec/mpeg4_unpack_bframes_bsf: implement a AVBSFContext.flush() callback

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/vp9_superframe_bsf: implement a AVBSFContext.flush() callback
James Almer [Fri, 27 Jul 2018 01:24:47 +0000 (22:24 -0300)]
avcodec/vp9_superframe_bsf: implement a AVBSFContext.flush() callback

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/vp9_superframe_split_bsf: implement a AVBSFContext.flush() callback
James Almer [Thu, 26 Jul 2018 23:35:16 +0000 (20:35 -0300)]
avcodec/vp9_superframe_split_bsf: implement a AVBSFContext.flush() callback

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/h264_mp4toannexb_bsf: implement a AVBSFContext.flush() callback
James Almer [Thu, 26 Jul 2018 23:34:52 +0000 (20:34 -0300)]
avcodec/h264_mp4toannexb_bsf: implement a AVBSFContext.flush() callback

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/bsf: add a flushing mechanism to AVBSFContext
James Almer [Thu, 26 Jul 2018 23:32:13 +0000 (20:32 -0300)]
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>
8 months agolavfi: fix can't dispaly "slice" sub-option in "ffmpeg -h full"
Jun Zhao [Mon, 13 Aug 2018 01:30:27 +0000 (09:30 +0800)]
lavfi: fix can't dispaly "slice" sub-option in "ffmpeg -h full"

 fix can't dispaly "slice" sub-option in "ffmpeg -h full" for
 AVFilter options.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
8 months agoavcodec/frame_thread_encoder: fix memory leak that occurs when close encoder without...
lee ju [Sat, 4 Aug 2018 10:19:45 +0000 (10:19 +0000)]
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>
8 months agoavcodec/scpr: Check for min > max in decompress_p()
Michael Niedermayer [Sat, 4 Aug 2018 21:45:52 +0000 (23:45 +0200)]
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>
8 months agoavcodec/shorten: Fix signed 32bit overflow in shift in shorten_decode_frame()
Michael Niedermayer [Sun, 12 Aug 2018 21:06:55 +0000 (23:06 +0200)]
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>
8 months agoavcodec/shorten: Fix integer overflow in residual/LPC combination
Michael Niedermayer [Sun, 12 Aug 2018 20:55:59 +0000 (22:55 +0200)]
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>
8 months agoavcodec/shorten: Check verbatim length
Michael Niedermayer [Sun, 12 Aug 2018 20:43:33 +0000 (22:43 +0200)]
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>
8 months agoavfilter/vf_hue: 10bit support
Michael Niedermayer [Wed, 1 Aug 2018 17:48:08 +0000 (19:48 +0200)]
avfilter/vf_hue: 10bit support

Tested-by: Tobias Rapp <t.rapp@noa-archive.com>
Tested-by: Reto Kromer <lists@reto.ch>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agodoc/filters: Add entry for sr filter.
Sergey Lavrushkin [Wed, 15 Aug 2018 16:35:09 +0000 (19:35 +0300)]
doc/filters: Add entry for sr filter.

Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
8 months agoavutil/encryption_info: Fix size calculation.
Jacob Trimble [Mon, 13 Aug 2018 22:17:11 +0000 (15:17 -0700)]
avutil/encryption_info: Fix size calculation.

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

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agolavfi/vf_colorconstancy: cosmetic update
Mina [Tue, 14 Aug 2018 18:56:51 +0000 (20:56 +0200)]
lavfi/vf_colorconstancy: cosmetic update

8 months agolavfi/vf_colorconstancy: change option ranges
Mina [Tue, 14 Aug 2018 18:55:08 +0000 (20:55 +0200)]
lavfi/vf_colorconstancy: change option ranges

8 months agolibavfilter: Adds proper file descriptions to dnn_srcnn.h and dnn_espcn.h.
Sergey Lavrushkin [Thu, 2 Aug 2018 16:56:23 +0000 (19:56 +0300)]
libavfilter: Adds proper file descriptions to dnn_srcnn.h and dnn_espcn.h.

Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
8 months agolibavfilter/vf_sr.c: Removes uint8 -> float and float -> uint8 conversions.
Sergey Lavrushkin [Tue, 31 Jul 2018 15:58:28 +0000 (18:58 +0300)]
libavfilter/vf_sr.c: Removes uint8 -> float and float -> uint8 conversions.

Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
8 months agolibavfilter/dnn_backend_tf.c: Fixes ff_dnn_free_model_tf.
Sergey Lavrushkin [Tue, 31 Jul 2018 15:40:24 +0000 (18:40 +0300)]
libavfilter/dnn_backend_tf.c: Fixes ff_dnn_free_model_tf.

Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
8 months agolavc/videotoolboxenc: Fix compilation on osx 10.10.5 Yosemite
Thilo Borgmann [Thu, 9 Aug 2018 10:47:35 +0000 (12:47 +0200)]
lavc/videotoolboxenc: Fix compilation on osx 10.10.5 Yosemite

Signed-off-by: Aman Gupta <aman@tmm1.net>
8 months agoavformat: correct fdebug loglevel
Gyan Doshi [Mon, 13 Aug 2018 07:02:41 +0000 (12:32 +0530)]
avformat: correct fdebug loglevel

fftools/cmdutils sets loglevel for fdebug to DEBUG but all fdebug output
except for two were emitted at TRACE.

8 months agolibswscale: Adds conversions from/to float gray format.
Sergey Lavrushkin [Fri, 3 Aug 2018 15:06:50 +0000 (18:06 +0300)]
libswscale: Adds conversions from/to float gray format.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agolibavformat/dashdec: Support negative value of the @r attrbute of S in SegmentTimelin...
sanil [Mon, 13 Aug 2018 08:53:59 +0000 (16:53 +0800)]
libavformat/dashdec: Support negative value of the @r attrbute of S in SegmentTimeline element.

The following patch supports parsing negative value of the @r attribute of S in SegmentTimeline element.

Example streams:
1. http://dash.edgesuite.net/dash264/TestCases/1c/qualcomm/1/MultiRate.mpd
2. http://dash.edgesuite.net/dash264/TestCases/1c/qualcomm/2/MultiRate.mpd

8 months agolavfi: add erosion_opencl, dilation_opencl filters
Danil Iashchenko [Sun, 12 Aug 2018 20:12:08 +0000 (23:12 +0300)]
lavfi: add erosion_opencl, dilation_opencl filters

Add erosion_opencl, dilation_opencl filters. Behave like existing erosion and dilation filters.

8 months agoavcodec/mpegaudio_parser: Initialize poutbuf*
Michael Niedermayer [Sun, 5 Aug 2018 12:51:36 +0000 (14:51 +0200)]
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>
8 months agoavcodec/ivi: Factor width dereference out of the loops in ivi_output_plane()
Michael Niedermayer [Sat, 4 Aug 2018 00:34:11 +0000 (02:34 +0200)]
avcodec/ivi: Factor width dereference out of the loops in ivi_output_plane()

396078 -> 268468 dezicycles

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/ivi: Only clip samples when needed in ivi_output_plane()
Michael Niedermayer [Sat, 4 Aug 2018 00:31:58 +0000 (02:31 +0200)]
avcodec/ivi: Only clip samples when needed in ivi_output_plane()

435740 -> 396078 dezicycles

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/indeo5: require initial valid intra/gop headers not just later
Michael Niedermayer [Sat, 4 Aug 2018 00:19:15 +0000 (02:19 +0200)]
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>
8 months agoavcodec/microdvddec: limit style characters in parsing
Michael Niedermayer [Sat, 4 Aug 2018 00:56:56 +0000 (02:56 +0200)]
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>
8 months agolibavutil: Adds gray floating-point pixel formats.
Sergey Lavrushkin [Fri, 3 Aug 2018 15:02:49 +0000 (18:02 +0300)]
libavutil: Adds gray floating-point pixel formats.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agolavf/mov.c: Set start_time for all streams (in case of edit lists).
Sasi Inguva [Mon, 6 Aug 2018 23:28:50 +0000 (16:28 -0700)]
lavf/mov.c: Set start_time for all streams (in case of edit lists).

Fixes vorbis mp4 audio files, with edit list specified. Since
st->skip_samples is not set in case of vorbis , ffmpeg computes the
start_time as negative.

Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agolavfi/vf_libvmaf: update to use libvmaf v1.3.9
Kyle Swanson [Tue, 7 Aug 2018 22:05:16 +0000 (15:05 -0700)]
lavfi/vf_libvmaf: update to use libvmaf v1.3.9

Signed-off-by: Kyle Swanson <kswanson@netflix.com>
8 months agolavc/hevcdec: add ONLY_IF_THREADS_ENABLED where it is missing.
Jun Zhao [Wed, 8 Aug 2018 06:31:27 +0000 (14:31 +0800)]
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>
8 months agolavfi/selectivecolor: fix neutral color filtering
Clément Bœsch [Thu, 9 Aug 2018 17:22:02 +0000 (19:22 +0200)]
lavfi/selectivecolor: fix neutral color filtering

Neutrals are supposed to be anything not black (0,0,0) and not white
(N,N,N).

Previous neutral filtering code was too strict by excluding colors with
any of its RGB component maxed instead of just the white color.

Reported-by: Royi Avital <royiavital@yahoo.com>
8 months agolavfi/xbr: update filter url
Mina [Wed, 8 Aug 2018 19:49:02 +0000 (21:49 +0200)]
lavfi/xbr: update filter url

Existing link is broken.
This patch updates the existing url with a working one.

Signed-off-by: Mina <minasamy_@hotmail.com>
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
8 months agolavf/mov: Force HEVC codec_id for code-point dvh1 and an hvcC atom.
Carl Eugen Hoyos [Mon, 6 Aug 2018 22:33:40 +0000 (00:33 +0200)]
lavf/mov: Force HEVC codec_id for code-point dvh1 and an hvcC atom.

The mp4 registration authority accepted a code-point for Dolby Vision
HEVC that was already used as a fourcc for DVCPRO 100.

Fixes ticket #7347.

8 months agolibavformat/dashdec: Fix for un-free memory
Colin NG [Wed, 8 Aug 2018 17:27:07 +0000 (17:27 +0000)]
libavformat/dashdec: Fix for un-free memory

Fixes ticket #7338.

8 months agoMAINTAINERS: add myself to MIPS section
Shiyou Yin [Thu, 26 Jul 2018 03:46:23 +0000 (11:46 +0800)]
MAINTAINERS: add myself to MIPS section

Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoffmpeg: simplify refcounting packets for the muxing queue
James Almer [Mon, 6 Aug 2018 00:34:14 +0000 (21:34 -0300)]
ffmpeg: simplify refcounting packets for the muxing queue

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavs2: correct avs2 description
hwren [Tue, 7 Aug 2018 10:39:34 +0000 (18:39 +0800)]
avs2: correct avs2 description

Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
8 months agolavc/libx264: Support monochrome encoding.
Carl Eugen Hoyos [Tue, 7 Aug 2018 18:41:02 +0000 (20:41 +0200)]
lavc/libx264: Support monochrome encoding.

8 months agolibavfilter: Fixes warnings for unused variables in dnn_srcnn.h, dnn_espcn.h, dnn_bac...
Sergey Lavrushkin [Sat, 28 Jul 2018 09:55:02 +0000 (12:55 +0300)]
libavfilter: Fixes warnings for unused variables in dnn_srcnn.h, dnn_espcn.h, dnn_backend_tf.c.

Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
8 months agolibavfilter: Code style fixes for pointers in DNN module and sr filter.
Sergey Lavrushkin [Fri, 27 Jul 2018 16:34:02 +0000 (19:34 +0300)]
libavfilter: Code style fixes for pointers in DNN module and sr filter.

Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
8 months agolibavfilter: Adds on the fly generation of default DNN models for tensorflow backend...
Sergey Lavrushkin [Fri, 27 Jul 2018 16:31:55 +0000 (19:31 +0300)]
libavfilter: Adds on the fly generation of default DNN models for tensorflow backend instead of storing binary model.

Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
8 months agoavformat/flvdec: add flv_full_metadata option into flvdec
Steven Liu [Tue, 7 Aug 2018 07:51:36 +0000 (15:51 +0800)]
avformat/flvdec: add flv_full_metadata option into flvdec

output all the metadata context when use this option.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agoavformat/flvdec: reindent code for previous commit
Steven Liu [Tue, 7 Aug 2018 07:50:47 +0000 (15:50 +0800)]
avformat/flvdec: reindent code for previous commit

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agoavformat/flvdec: add flv_ignore_prevtag option into flvdec
Steven Liu [Tue, 7 Aug 2018 07:48:23 +0000 (15:48 +0800)]
avformat/flvdec: add flv_ignore_prevtag option into flvdec

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agoavformat/dashdec: remove unused functions and process code
Steven Liu [Tue, 7 Aug 2018 04:37:02 +0000 (12:37 +0800)]
avformat/dashdec: remove unused functions and process code

Based on a patch for hls by Richard Shaffer

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agoavformat/dashdec: Fix memleak when resolve_content_path
Jacek Jendrzej [Tue, 7 Aug 2018 03:32:05 +0000 (11:32 +0800)]
avformat/dashdec: Fix memleak when resolve_content_path

Can be reproduced with:  valgrind  --leak-check=full  -v ffmpeg -i
http://yt-dash-mse-test.commondatastorage.googleapis.com/media/motion-20120802-manifest.mpd

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agoavformat/dashdec: fix for ticket #7336
Jacek Jendrzej [Tue, 7 Aug 2018 03:30:04 +0000 (11:30 +0800)]
avformat/dashdec: fix for ticket #7336

fix for ticket #7336

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agofftools/qsv: add extra_hw_frames support
Zhong Li [Wed, 25 Jul 2018 08:05:38 +0000 (16:05 +0800)]
fftools/qsv: add extra_hw_frames support

Currently extra_hw_frames can't be applied to qsv since it
doesn't call function avcodec_get_hw_frames_parameters().

Give an option to fix ticket #7261 though it is not a perfect soultion
(allocate the minimum pool size internally and automatically).

Signed-off-by: Zhong Li <zhong.li@intel.com>
8 months agolavc/qsvenc: expose qp of encoded frames
Zhong Li [Fri, 1 Jun 2018 10:21:28 +0000 (18:21 +0800)]
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>
8 months agovf_tonemap: Update hdr metadata with the new peak value
Vittorio Giovara [Wed, 25 Jul 2018 15:45:46 +0000 (17:45 +0200)]
vf_tonemap: Update hdr metadata with the new peak value

Less effective than the approach in vf_tonemap_opencl because there
is no peak detection, but it's still a good idea to implement this.

8 months agovf_tonemap_opencl: Move update_metadata() to a shared file
Vittorio Giovara [Wed, 25 Jul 2018 15:02:45 +0000 (17:02 +0200)]
vf_tonemap_opencl: Move update_metadata() to a shared file

8 months agovf_tonemap[_opencl]: Move determine_signal_peak() to a shared file
Vittorio Giovara [Wed, 25 Jul 2018 14:44:50 +0000 (16:44 +0200)]
vf_tonemap[_opencl]: Move determine_signal_peak() to a shared file

The two functions are identical. Use the shared LumaCoeffients type too.

8 months agovf_tonemap: Fix logic for detecting the maximum peak of untagged sources
Vittorio Giovara [Wed, 25 Jul 2018 15:21:04 +0000 (17:21 +0200)]
vf_tonemap: Fix logic for detecting the maximum peak of untagged sources

When there is no metadata attached to a frame, take into account both
the PQ and HLG transfers, and change the HLG default value to 10:
the value of 12 is the maximum range in scene referred light, but
the reference OOTF maps this from 0 to 1000 cd/m² on the ideal HLG
monitor.

This matches what vf_tonemap_opencl does.

8 months agoavcodec/libaomenc: correct range for cpu-used
Gyan Doshi [Sun, 5 Aug 2018 06:03:45 +0000 (11:33 +0530)]
avcodec/libaomenc: correct range for cpu-used

Valid range is [0,8] as stated in aom.git:aom/aomcx.h

Fixes #7343

8 months agoavcodec/mediacodecdec: fix spurious newline in trace logging
Aman Gupta [Sun, 5 Aug 2018 19:31:07 +0000 (12:31 -0700)]
avcodec/mediacodecdec: fix spurious newline in trace logging

Signed-off-by: Aman Gupta <aman@tmm1.net>
8 months agoavcodec/pnm_parser: Avoid reparsing failed data.
Michael Niedermayer [Sat, 28 Jul 2018 12:09:32 +0000 (14:09 +0200)]
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>
8 months agoavcodec/simple_idct_template: Fix several integer overflows
Michael Niedermayer [Sat, 28 Jul 2018 10:18:05 +0000 (12:18 +0200)]
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>
8 months agoavcodec/aacdec_template: Check for duplicate elements
Michael Niedermayer [Sat, 28 Jul 2018 09:42:37 +0000 (11:42 +0200)]
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>
8 months agoavcodec/aacpsdsp_template: Fix integer overflow in ps_stereo_interpolate_c()
Michael Niedermayer [Sat, 28 Jul 2018 08:59:09 +0000 (10:59 +0200)]
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>
8 months agoavformat/flvenc: Check audio packet size
Michael Niedermayer [Sat, 28 Jul 2018 13:03:50 +0000 (15:03 +0200)]
avformat/flvenc: Check audio packet size

Fixes: Assertion failure
Fixes: assert_flvenc.c:941_1.swf

Found-by: #CHEN HONGXU# <HCHEN017@e.ntu.edu.sg>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/mediacodecdec: fix SEGV on modern nvidia decoders
Aman Gupta [Tue, 31 Jul 2018 21:33:08 +0000 (14:33 -0700)]
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] https://github.com/GStreamer/gst-plugins-bad/commit/a870e6a5c30dd85240fe75c7409cc1cf1b86541d
[2] https://github.com/GStreamer/gst-plugins-bad/commit/21ff3ae0b0127bd82951d278ca24f2d54133b7cd
[3] https://bugzilla.gnome.org/show_bug.cgi?id=748867

Signed-off-by: Aman Gupta <aman@tmm1.net>
8 months agolavc/svq3: Fix regression decoding some files.
Nikolas Bowe [Tue, 31 Jul 2018 00:22:02 +0000 (17:22 -0700)]
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>
8 months agoavcodec/mlp_parser: Check if synccode is within buffer
Michael Niedermayer [Sun, 29 Jul 2018 11:16:37 +0000 (13:16 +0200)]
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>
8 months agoavcodec/qtrle: Check remaining bytestream in qtrle_decode_XYbpp()
Michael Niedermayer [Sun, 29 Jul 2018 10:40:48 +0000 (12:40 +0200)]
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>
8 months agoavformat/matroskaenc: filter and reorder AV1 OBUs
James Almer [Mon, 23 Jul 2018 15:33:55 +0000 (12:33 -0300)]
avformat/matroskaenc: filter and reorder AV1 OBUs

Make sure to not write forbidden OBUs to CodecPrivate, and do the same with
unnecessary OBUs for packets.

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavformat/av1: reorder OBUs before writting them in ff_isom_write_av1c()
James Almer [Mon, 30 Jul 2018 18:15:43 +0000 (15:15 -0300)]
avformat/av1: reorder OBUs before writting them in ff_isom_write_av1c()

Make sure Sequence Header is first, and only allow one of its kind.

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/av1_parse: return size of the parsed OBU in parse_obu_header()
James Almer [Mon, 30 Jul 2018 18:14:24 +0000 (15:14 -0300)]
avcodec/av1_parse: return size of the parsed OBU in parse_obu_header()

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavformat/av1: return an error when no data is provided to ff_isom_write_av1c()
James Almer [Mon, 23 Jul 2018 16:15:06 +0000 (13:15 -0300)]
avformat/av1: return an error when no data is provided to ff_isom_write_av1c()

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/av1_parse: check for OBU header overread
James Almer [Mon, 23 Jul 2018 16:12:43 +0000 (13:12 -0300)]
avcodec/av1_parse: check for OBU header overread

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/libaomdec: auto insert dump_extra bitstream filter
James Almer [Mon, 23 Jul 2018 15:32:47 +0000 (12:32 -0300)]
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>