ffmpeg.git
16 months agotools/target_dec_fuzzer: Adjust threshold for MSZH
Michael Niedermayer [Wed, 25 Sep 2019 19:14:01 +0000 (21:14 +0200)]
tools/target_dec_fuzzer: Adjust threshold for MSZH

Fixes: Timeout (250sec -> 6sec)
Fixes: 17627/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSZH_fuzzer-5643017129558016

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoswscale/output: Avoid 64bit in Alpha in yuv2ya16_X_c_template()
Michael Niedermayer [Thu, 26 Sep 2019 15:17:15 +0000 (17:17 +0200)]
swscale/output: Avoid 64bit in Alpha in yuv2ya16_X_c_template()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoswscale/output: Correct Alpha in yuv2ya16_X_c_template()
Michael Niedermayer [Thu, 26 Sep 2019 15:13:16 +0000 (17:13 +0200)]
swscale/output: Correct Alpha in yuv2ya16_X_c_template()

Untested, no testcase

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoswscale/output: Implement Luma computation from yuv2ya16_X_c_template() without 64bit
Michael Niedermayer [Thu, 26 Sep 2019 15:10:49 +0000 (17:10 +0200)]
swscale/output: Implement Luma computation from yuv2ya16_X_c_template() without 64bit

This also reverts 21838cad2fc44023ad85e35d5c677e2f8d29a0ef
The revert is in this commit to avoid 2 fate updates

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agofate/source: add libavfilter/af_arnndn.c
Paul B Mahol [Wed, 16 Oct 2019 16:36:32 +0000 (18:36 +0200)]
fate/source: add libavfilter/af_arnndn.c

16 months agovafilter/af_replaygain: fix undefined behaviour
Paul B Mahol [Wed, 16 Oct 2019 16:24:31 +0000 (18:24 +0200)]
vafilter/af_replaygain: fix undefined behaviour

Fixes #8291

16 months agoavfilter/avf_abitscope: fix undefined behaviour
Paul B Mahol [Wed, 16 Oct 2019 16:18:57 +0000 (18:18 +0200)]
avfilter/avf_abitscope: fix undefined behaviour

Fixes #8289

16 months agoavfilter/vf_colorchannelmixer: do not use pointer if there is no alpha
Paul B Mahol [Wed, 16 Oct 2019 16:16:09 +0000 (18:16 +0200)]
avfilter/vf_colorchannelmixer: do not use pointer if there is no alpha

Fixes #8288

16 months agoavfilter/vf_edgedetect: fix undefined behaviour
Paul B Mahol [Wed, 16 Oct 2019 16:06:47 +0000 (18:06 +0200)]
avfilter/vf_edgedetect: fix undefined behaviour

Fixes #8287

16 months agoavcodec/apedec: Check remaining space in decode_array_0000()
Michael Niedermayer [Sat, 5 Oct 2019 16:39:05 +0000 (18:39 +0200)]
avcodec/apedec: Check remaining space in decode_array_0000()

Fixes: Timeout (? -> 2sec)
Fixes: 17886/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5728165124636672
Fixes: 18131/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5710803432374272

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoavcodec/apedec: Check error flag after entropy_decode*
Michael Niedermayer [Sat, 5 Oct 2019 16:39:05 +0000 (18:39 +0200)]
avcodec/apedec: Check error flag after entropy_decode*

Fixes: 17886/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5728165124636672
Fixes: 18131/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5710803432374272

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoavfilter/f_reverse: fix memory leaks
Paul B Mahol [Wed, 16 Oct 2019 14:27:06 +0000 (16:27 +0200)]
avfilter/f_reverse: fix memory leaks

Fixes #8283

16 months agoavfilter: add arnndn filter
Paul B Mahol [Fri, 26 Jul 2019 08:38:31 +0000 (10:38 +0200)]
avfilter: add arnndn filter

16 months agoavfilter/vf_atadenoise: compensate for small overall brightness loss
Paul B Mahol [Wed, 16 Oct 2019 11:16:41 +0000 (13:16 +0200)]
avfilter/vf_atadenoise: compensate for small overall brightness loss

This is very hard to spot.

16 months agoavfilter/vsrc_testsrc: rgbtestsrc: fix undefined behaviour
Paul B Mahol [Wed, 16 Oct 2019 10:31:40 +0000 (12:31 +0200)]
avfilter/vsrc_testsrc: rgbtestsrc: fix undefined behaviour

Fixes #8238

16 months agoavfilter/vf_gblur: fix heap-buffer overflow
Paul B Mahol [Wed, 16 Oct 2019 10:13:04 +0000 (12:13 +0200)]
avfilter/vf_gblur: fix heap-buffer overflow

Fixes #8282

16 months agoavformat/chromaprint: Fix writing raw fingerprint
Andriy Gelman [Sun, 6 Oct 2019 05:49:49 +0000 (01:49 -0400)]
avformat/chromaprint: Fix writing raw fingerprint

The pointer fp after the call to chromaprint_get_raw_fingerpoint() points to an array
of uint32_t whereas the current code assumed just a char stream. Thus when writing the
raw fingerprint, the output would be truncated by a factor of 4.

For reference the declaration of the function from chromaprint.h is:
int chromaprint_get_raw_fingerprint(ChromaprintContext *ctx, uint32_t **fingerprint, int *size);

16 months agoavfilter/af_afade: make sure that in is available
Paul B Mahol [Tue, 15 Oct 2019 22:45:26 +0000 (00:45 +0200)]
avfilter/af_afade: make sure that in is available

16 months agoavfilter/dnn: unify the layer load function in native mode
Guo, Yejun [Wed, 9 Oct 2019 14:08:18 +0000 (22:08 +0800)]
avfilter/dnn: unify the layer load function in native mode

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
16 months agoavfilter/dnn: unify the layer execution function in native mode
Guo, Yejun [Wed, 9 Oct 2019 14:08:11 +0000 (22:08 +0800)]
avfilter/dnn: unify the layer execution function in native mode

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
16 months agoavfilter/dnn: add DLT prefix for enum DNNLayerType to avoid potential conflicts
Guo, Yejun [Wed, 9 Oct 2019 14:08:04 +0000 (22:08 +0800)]
avfilter/dnn: add DLT prefix for enum DNNLayerType to avoid potential conflicts

and also change CONV to DLT_CONV2D for better description

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
16 months agoavformat/latmenc: abort if no extradata is available
James Almer [Tue, 15 Oct 2019 14:38:23 +0000 (11:38 -0300)]
avformat/latmenc: abort if no extradata is available

Fixes ticket #8273.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
16 months agoavfilter/vf_bm3d: make sure nb_jobs is at least 1
Paul B Mahol [Tue, 15 Oct 2019 15:59:43 +0000 (17:59 +0200)]
avfilter/vf_bm3d: make sure nb_jobs is at least 1

16 months agotools/target_dec_fuzzer: Also fuzz keyframe & disposal flags
Michael Niedermayer [Sat, 12 Oct 2019 20:34:03 +0000 (22:34 +0200)]
tools/target_dec_fuzzer: Also fuzz keyframe & disposal flags

This should improve coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agolavc/libxavs2: fix parameter setting result determination
hwren [Mon, 14 Oct 2019 13:22:42 +0000 (21:22 +0800)]
lavc/libxavs2: fix parameter setting result determination

Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoavfilter/af_afade: fix heap-buffer overflow
Paul B Mahol [Tue, 15 Oct 2019 14:55:13 +0000 (16:55 +0200)]
avfilter/af_afade: fix heap-buffer overflow

Fixes #8276

16 months agoavfilter/vf_edgedetect: fix heap-buffer overflow
Paul B Mahol [Tue, 15 Oct 2019 14:38:40 +0000 (16:38 +0200)]
avfilter/vf_edgedetect: fix heap-buffer overflow

Fixes #8275

16 months agoavfilter/vf_avgblur: fix heap-buffer overflow
Paul B Mahol [Tue, 15 Oct 2019 14:31:15 +0000 (16:31 +0200)]
avfilter/vf_avgblur: fix heap-buffer overflow

Fixes #8274

16 months agoavcodec/av1_parse: Use av_fast_realloc() for OBU array
James Almer [Tue, 15 Oct 2019 02:42:01 +0000 (23:42 -0300)]
avcodec/av1_parse: Use av_fast_realloc() for OBU array

Based on commits 22bec0d33f4231487547581a1f77e2e8e6eade88 and
cebb446911fdc6c42d5a480b441b025c399e4a88.

Signed-off-by: James Almer <jamrial@gmail.com>
16 months agoavcodec/av1_parse: simplify memset call
James Almer [Tue, 15 Oct 2019 02:43:08 +0000 (23:43 -0300)]
avcodec/av1_parse: simplify memset call

Removed (new_size - pkt->nals_allocated) because this value is always 1
during the call.
Based on commit 78b86c30d3860135042505dd4a9cbd95c4e6257d.

Signed-off-by: James Almer <jamrial@gmail.com>
16 months agoavcodec/h2645_parse: Reset nal_buffer_size on uninit
Andriy Gelman [Tue, 15 Oct 2019 01:45:18 +0000 (21:45 -0400)]
avcodec/h2645_parse: Reset nal_buffer_size on uninit

Without reseting nal_buffer_size, av_fast_realloc will fail if
ff_h2645_packet_split is called with the unitialized pkt as argument.

Signed-off-by: James Almer <jamrial@gmail.com>
16 months agoffprobe: fix output of packets_and_frames section in JSON format
James Almer [Fri, 11 Oct 2019 16:36:38 +0000 (13:36 -0300)]
ffprobe: fix output of packets_and_frames section in JSON format

The "type" entry was hardcoded with an trailing comma, even if it was
the only entry in the section.

Fixes ticket #8228.

Signed-off-by: James Almer <jamrial@gmail.com>
16 months agoavfilter: fix typo in comments
Zhao Zhili [Wed, 9 Oct 2019 12:06:10 +0000 (20:06 +0800)]
avfilter: fix typo in comments

Signed-off-by: mypopy@gmail.com
16 months agotools/target_dec_fuzzer: Also fuzz codec_tag
Michael Niedermayer [Sat, 12 Oct 2019 20:34:02 +0000 (22:34 +0200)]
tools/target_dec_fuzzer: Also fuzz codec_tag

This should improve coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agotools/target_dec_fuzzer: Also fuzz FF_COMPLIANCE_EXPERIMENTAL
Michael Niedermayer [Sat, 12 Oct 2019 20:34:01 +0000 (22:34 +0200)]
tools/target_dec_fuzzer: Also fuzz FF_COMPLIANCE_EXPERIMENTAL

This should improve coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agotools/target_dec_fuzzer: Also fuzz block_align
Michael Niedermayer [Sat, 12 Oct 2019 20:34:00 +0000 (22:34 +0200)]
tools/target_dec_fuzzer: Also fuzz block_align

This should improve coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoavfilter/vf_lenscorrection: make width/height int
Paul B Mahol [Mon, 14 Oct 2019 18:14:03 +0000 (20:14 +0200)]
avfilter/vf_lenscorrection: make width/height int

Somehow previous correct fix broke usage.

16 months agodoc/APIchanges: add missing entry for the new runtime param AVOption flag
James Almer [Mon, 14 Oct 2019 15:05:01 +0000 (12:05 -0300)]
doc/APIchanges: add missing entry for the new runtime param AVOption flag

Signed-off-by: James Almer <jamrial@gmail.com>
16 months agoavfilter/vf_atadenoise: rewrite using macro
Paul B Mahol [Mon, 14 Oct 2019 14:39:56 +0000 (16:39 +0200)]
avfilter/vf_atadenoise: rewrite using macro

16 months agodoc/filters: document colorchannelmixer commands
Paul B Mahol [Mon, 14 Oct 2019 11:14:18 +0000 (13:14 +0200)]
doc/filters: document colorchannelmixer commands

16 months agodoc/filters: document amplify commands
Paul B Mahol [Mon, 14 Oct 2019 11:11:21 +0000 (13:11 +0200)]
doc/filters: document amplify commands

16 months agodoc/filters: document scroll commands
Paul B Mahol [Mon, 14 Oct 2019 11:08:13 +0000 (13:08 +0200)]
doc/filters: document scroll commands

16 months agoavfilter/vf_bwdif: fix heap-buffer overflow
Paul B Mahol [Sun, 13 Oct 2019 21:21:35 +0000 (23:21 +0200)]
avfilter/vf_bwdif: fix heap-buffer overflow

Fixes #8261

16 months agoavfilter/af_atempo: use ff_filter_process_command()
Paul B Mahol [Wed, 9 Oct 2019 10:13:22 +0000 (12:13 +0200)]
avfilter/af_atempo: use ff_filter_process_command()

16 months agoavfilter/af_biquads: use ff_filter_process_command()
Paul B Mahol [Wed, 9 Oct 2019 09:15:56 +0000 (11:15 +0200)]
avfilter/af_biquads: use ff_filter_process_command()

16 months agoavfilter/af_rubberband: use ff_filter_process_command()
Paul B Mahol [Tue, 8 Oct 2019 20:15:09 +0000 (22:15 +0200)]
avfilter/af_rubberband: use ff_filter_process_command()

16 months agoavfilter/vf_drawbox: use ff_filter_process_command()
Paul B Mahol [Tue, 8 Oct 2019 20:04:02 +0000 (22:04 +0200)]
avfilter/vf_drawbox: use ff_filter_process_command()

16 months agoavfilter/vf_colorchannelmixer: add support for commands
Paul B Mahol [Tue, 8 Oct 2019 19:54:30 +0000 (21:54 +0200)]
avfilter/vf_colorchannelmixer: add support for commands

16 months agoavfilter/vf_amplify: add support for commands
Paul B Mahol [Tue, 8 Oct 2019 11:44:58 +0000 (13:44 +0200)]
avfilter/vf_amplify: add support for commands

16 months agoavfilter/vf_scroll: add support for commands
Paul B Mahol [Tue, 8 Oct 2019 11:18:12 +0000 (13:18 +0200)]
avfilter/vf_scroll: add support for commands

16 months agoavfilter/af_anlmdn: switch to ff_filter_process_command()
Paul B Mahol [Tue, 8 Oct 2019 11:12:52 +0000 (13:12 +0200)]
avfilter/af_anlmdn: switch to ff_filter_process_command()

16 months agoavfilter/vf_avgblur: switch to ff_filter_process_command()
Paul B Mahol [Tue, 8 Oct 2019 11:05:36 +0000 (13:05 +0200)]
avfilter/vf_avgblur: switch to ff_filter_process_command()

16 months agoavfilter/vf_gblur: switch to ff_filter_process_command()
Paul B Mahol [Tue, 8 Oct 2019 11:03:52 +0000 (13:03 +0200)]
avfilter/vf_gblur: switch to ff_filter_process_command()

16 months agoavfilter/af_anlms: switch to ff_filter_process_command()
Paul B Mahol [Tue, 8 Oct 2019 10:49:28 +0000 (12:49 +0200)]
avfilter/af_anlms: switch to ff_filter_process_command()

16 months agodoc/filters: document new feature
Paul B Mahol [Mon, 14 Oct 2019 09:24:38 +0000 (11:24 +0200)]
doc/filters: document new feature

16 months agoavutil/opt: print runtime flag too
Paul B Mahol [Tue, 8 Oct 2019 10:56:55 +0000 (12:56 +0200)]
avutil/opt: print runtime flag too

16 months agoavfilter/avfilter: add ff_filter_process_command()
Paul B Mahol [Tue, 8 Oct 2019 10:42:40 +0000 (12:42 +0200)]
avfilter/avfilter: add ff_filter_process_command()

16 months agoavutil/opt: add AV_OPT_FLAG_RUNTIME_PARAM flag
Paul B Mahol [Tue, 8 Oct 2019 10:03:19 +0000 (12:03 +0200)]
avutil/opt: add AV_OPT_FLAG_RUNTIME_PARAM flag

16 months agoavfilter/vf_geq: reindent
Paul B Mahol [Fri, 11 Oct 2019 16:29:03 +0000 (18:29 +0200)]
avfilter/vf_geq: reindent

16 months agoavfilter/vf_geq: allow user to set interpolation method
Paul B Mahol [Fri, 11 Oct 2019 16:26:22 +0000 (18:26 +0200)]
avfilter/vf_geq: allow user to set interpolation method

16 months agoavfilter/vf_edgedetect: fix coverity issue
Paul B Mahol [Mon, 14 Oct 2019 08:52:27 +0000 (10:52 +0200)]
avfilter/vf_edgedetect: fix coverity issue

16 months agoavformat/chromaprint: improve logging message
Andriy Gelman [Sun, 6 Oct 2019 05:49:48 +0000 (01:49 -0400)]
avformat/chromaprint: improve logging message

Setting silence_threshold requires that -algorithm is set to 3.

16 months agoavformat/chromaprint: Fix fp_format option
Andriy Gelman [Sun, 6 Oct 2019 05:49:46 +0000 (01:49 -0400)]
avformat/chromaprint: Fix fp_format option

The fp_format option was incorrectly declared,
so it could not be set via string constants.

16 months agoavfilter/vf_geq: Use av_clipd() instead of av_clipf()
Michael Niedermayer [Sat, 12 Oct 2019 11:46:04 +0000 (13:46 +0200)]
avfilter/vf_geq: Use av_clipd() instead of av_clipf()

With floats we cannot represent all 32bit integer dimensions

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoavformat/Makefile: Fix aiffdec replaygain dependency
Andreas Rheinhardt [Sat, 12 Oct 2019 04:22:29 +0000 (06:22 +0200)]
avformat/Makefile: Fix aiffdec replaygain dependency

Forgotten in 6390f52a.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoavcodec/mips: Fixed four warnings in vc1dsp
gxw [Sat, 12 Oct 2019 02:48:19 +0000 (10:48 +0800)]
avcodec/mips: Fixed four warnings in vc1dsp

Change the stride argument to ptrdiff_t in the following functions:
ff_put_no_rnd_vc1_chroma_mc8_mmi, ff_put_no_rnd_vc1_chroma_mc4_mmi,
ff_avg_no_rnd_vc1_chroma_mc8_mmi, ff_avg_no_rnd_vc1_chroma_mc4_mmi.

Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoavcodec/wmaprodec: Check that the streams channels do not exceed the overall channels
Michael Niedermayer [Sat, 12 Oct 2019 16:32:08 +0000 (18:32 +0200)]
avcodec/wmaprodec: Check that the streams channels do not exceed the overall channels

Fixes: NULL pointer dereference
Fixes: 18075/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA1_fuzzer-5708262036471808
Fixes: 18087/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA1_fuzzer-5740627634946048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoavfilter/vf_libvmaf: fix filtering of >8 bit data
Paul B Mahol [Sat, 12 Oct 2019 19:41:50 +0000 (21:41 +0200)]
avfilter/vf_libvmaf: fix filtering of >8 bit data

This is what reference does.

16 months agoavfilter/vf_lenscorrection: fix division by zero
Paul B Mahol [Sun, 13 Oct 2019 21:28:16 +0000 (23:28 +0200)]
avfilter/vf_lenscorrection: fix division by zero

Fixes #8265

16 months agoavfilter/vf_fieldorder: fix heap-buffer overflow
Paul B Mahol [Sun, 13 Oct 2019 21:10:16 +0000 (23:10 +0200)]
avfilter/vf_fieldorder: fix heap-buffer overflow

Fixes #8264

16 months agoavfilter/vf_convolution: fix undefined behaviour
Paul B Mahol [Sun, 13 Oct 2019 16:37:16 +0000 (18:37 +0200)]
avfilter/vf_convolution: fix undefined behaviour

Fixes #8263

16 months agoavfilter/vf_bm3d: fix possible infinite loop
Paul B Mahol [Sun, 13 Oct 2019 16:16:19 +0000 (18:16 +0200)]
avfilter/vf_bm3d: fix possible infinite loop

16 months agoavfilter/vf_bm3d: fix heap-buffer overflows
Paul B Mahol [Sun, 13 Oct 2019 16:10:38 +0000 (18:10 +0200)]
avfilter/vf_bm3d: fix heap-buffer overflows

Fixes #8262

16 months agoavfilter/vf_edgedetect: check if height is big enough
Paul B Mahol [Sun, 13 Oct 2019 15:23:10 +0000 (17:23 +0200)]
avfilter/vf_edgedetect: check if height is big enough

Fixes #8260

16 months agoavfilter/vf_waveform: fix typos which caused crash
Paul B Mahol [Sun, 13 Oct 2019 09:51:11 +0000 (11:51 +0200)]
avfilter/vf_waveform: fix typos which caused crash

16 months agoavfilter/vf_colorconstancy: fix overreads in gauss array
Paul B Mahol [Sat, 12 Oct 2019 09:07:54 +0000 (11:07 +0200)]
avfilter/vf_colorconstancy: fix overreads in gauss array

Fixes #8250

16 months agoavfilter/vf_waveform: add yflat filter
Paul B Mahol [Sat, 12 Oct 2019 16:46:13 +0000 (18:46 +0200)]
avfilter/vf_waveform: add yflat filter

16 months agoavfilter/vf_waveform: allow different cb for new modes
Paul B Mahol [Sat, 12 Oct 2019 15:57:23 +0000 (17:57 +0200)]
avfilter/vf_waveform: allow different cb for new modes

16 months agoavfilter/vf_waveform: add invert graticule
Paul B Mahol [Sat, 12 Oct 2019 15:42:21 +0000 (17:42 +0200)]
avfilter/vf_waveform: add invert graticule

16 months agoavfilter/vf_waveform: add graticule enum
Paul B Mahol [Sat, 12 Oct 2019 14:02:34 +0000 (16:02 +0200)]
avfilter/vf_waveform: add graticule enum

16 months agoavformat/mov: parse sdtp atom and set the pkt disposable flag accordingly
Matthieu Bouron [Fri, 27 Sep 2019 12:57:09 +0000 (14:57 +0200)]
avformat/mov: parse sdtp atom and set the pkt disposable flag accordingly

Allows the creation of the sdtp atom while remuxing MP4 to MP4. This
atom is required by Apple devices (iPhone, Apple TV) in order to accept
2160p medias.

16 months agoavcodec/zmbvenc: Correct offset in buffer
Andreas Rheinhardt [Thu, 10 Oct 2019 09:47:41 +0000 (11:47 +0200)]
avcodec/zmbvenc: Correct offset in buffer

zmbvenc allocates a buffer for a picture with padding on all four sides:
The stride is choosen so large that it already contains padding on the
right; the height also includes padding rows. The padding on the right
of each row is also reused as padding for the left of the next row. So
one still needs to add padding on the left for the first row. This is done
by offsetting the actual pointer used to access the picture from the
pointer returned by av_mallocz and the formula for this offset was
wrong, because it ignored that a pixel can take more than one byte when
calculating the offset resulting from the left padding of the first row.

This fixes accesses outside of the allocated buffer that were reported
in tickets #7980 and #7994. No writes were ever attempted outside of
the buffer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agofftools/ffmpeg: Improve streamcopy
Andreas Rheinhardt [Fri, 11 Oct 2019 04:06:58 +0000 (06:06 +0200)]
fftools/ffmpeg: Improve streamcopy

do_streamcopy() has a packet that gets zero-initialized first, then gets
initialized via av_init_packet() after which some of its fields are
oerwritten again with the actually desired values (unless it's EOF): The
side data is copied into the packet with av_copy_packet_side_data() and
if the source packet is refcounted, the packet will get a new reference
to the source packet's data. Furthermore, the flags are copied and the
timestamp related fields are overwritten with new values.

This commit replaces this by using av_packet_ref() to both initialize
the packet as well as populate its fields with the right values (unless
it's EOF again in which case the packet will still be initialized). The
differences to the current approach are as follows:
a) There is no call to a deprecated function (av_copy_packet_side_data())
any more.
b) Several fields that weren't copied before are now copied from the source
packet to the new packet (e.g. pos). Some of them (the timestamp related
fields) may be immediately overwritten again and some don't seem to be
used at all (e.g. pos), but in return using av_packet_ref() allows to forgo
the initializations.
c) There was no check for whether copying side data fails or not. This
has been changed: Now the program is exited in this case.

Using av_packet_ref() does not lead to unnecessary copying of data,
because the source packets are already always refcounted (they originate
from av_read_frame()).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoavcodec/qdmc: Check input space in qdmc_get_vlc()
Michael Niedermayer [Thu, 10 Oct 2019 16:26:44 +0000 (18:26 +0200)]
avcodec/qdmc: Check input space in qdmc_get_vlc()

Fixes: Timeout (125sec -> 0.4sec)
Fixes: 18059/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDMC_fuzzer-5656195825664000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoavformat/mpjpegdec: ensure seekback for latest chunk
Moritz Barsnick [Sun, 6 Oct 2019 22:19:30 +0000 (00:19 +0200)]
avformat/mpjpegdec: ensure seekback for latest chunk

Not only the first, but each latest chunk must be cached to allow
seekback after finding the mime boundary.

Fixes trac #5023 and #5921.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoavformat/mpjpegdec: fix strict boundary search string
Moritz Barsnick [Sun, 6 Oct 2019 22:19:29 +0000 (00:19 +0200)]
avformat/mpjpegdec: fix strict boundary search string

According to RFC1341, the multipart boundary indicated by the
Content-Type header must be prepended by CRLF + "--", and followed
by CRLF. In the case of strict MIME header boundary handling, the
"--" was forgotten to add.

Fixes trac #7921.

A side effect is that this coincidentally breaks enforcement of
strict MIME headers against servers running motion < 3.4.1, where
the boundary announcement in the HTTP headers incorrectly used the
prefix "--", which exactly matched this bug's behavior.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoavformat/mpjpegdec: fix finding multipart boundary parameter
Moritz Barsnick [Sun, 6 Oct 2019 22:19:28 +0000 (00:19 +0200)]
avformat/mpjpegdec: fix finding multipart boundary parameter

The string matching function's return value was evaluated incorrectly.

Fixes trac #7920.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoavutil/eval: add sgn()
Paul B Mahol [Fri, 11 Oct 2019 19:44:09 +0000 (21:44 +0200)]
avutil/eval: add sgn()

16 months agoavformat/dv: free all allocated structs on dv_read_header failure
James Almer [Fri, 11 Oct 2019 17:34:17 +0000 (14:34 -0300)]
avformat/dv: free all allocated structs on dv_read_header failure

Also propagate proper AVERROR codes while at it.

Fixes ticket #8230.

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
16 months agolibavcodec/amfenc_h264.c: Changed loop filter flag default value.
OvchinnikovDmitrii [Fri, 11 Oct 2019 15:37:13 +0000 (18:37 +0300)]
libavcodec/amfenc_h264.c: Changed loop filter flag default value.

The value has been changed to match the recommended(by AMF Encoder team)

16 months agoavfilter/vf_signalstats: fix stack buffer overflow
Paul B Mahol [Fri, 11 Oct 2019 11:32:24 +0000 (13:32 +0200)]
avfilter/vf_signalstats: fix stack buffer overflow

Fixes #8249

16 months agoavfilter/vf_w3fdif: deny processing small videos
Paul B Mahol [Fri, 11 Oct 2019 10:55:13 +0000 (12:55 +0200)]
avfilter/vf_w3fdif: deny processing small videos

Fixes #8243

16 months agoavfilter/vf_bitplanenoise: fix overreads
Paul B Mahol [Fri, 11 Oct 2019 10:42:13 +0000 (12:42 +0200)]
avfilter/vf_bitplanenoise: fix overreads

Fixes #8244

16 months agoavfilter/vf_deflicker: fix invalid access
Paul B Mahol [Fri, 11 Oct 2019 10:23:26 +0000 (12:23 +0200)]
avfilter/vf_deflicker: fix invalid access

Fixes #8253

16 months agoavfilter/vf_waveform: better guard against picking wrong pixel format
Paul B Mahol [Fri, 11 Oct 2019 10:07:10 +0000 (12:07 +0200)]
avfilter/vf_waveform: better guard against picking wrong pixel format

Fixes #8252

16 months agoavfilter/vf_neighbor: check if width is 1
Paul B Mahol [Fri, 11 Oct 2019 09:18:10 +0000 (11:18 +0200)]
avfilter/vf_neighbor: check if width is 1

Fixes #8242

16 months agoavfilter/vf_floodfill: finish early if source and destination fill matches
Paul B Mahol [Thu, 10 Oct 2019 19:50:03 +0000 (21:50 +0200)]
avfilter/vf_floodfill: finish early if source and destination fill matches

Fixes #8236

16 months agoavfilter/vf_random: fix crash
Paul B Mahol [Thu, 10 Oct 2019 19:04:56 +0000 (21:04 +0200)]
avfilter/vf_random: fix crash

Fixes #8235.

16 months agoavcodec/dstdec: Check for input exhaustion
Michael Niedermayer [Wed, 2 Oct 2019 18:48:40 +0000 (20:48 +0200)]
avcodec/dstdec: Check for input exhaustion

Fixes: Timeout (239sec -> 16sec)
Fixes: 17811/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5715508149616640

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
16 months agoavcodec/wmaprodec: Fix cleanup on error
Michael Niedermayer [Wed, 9 Oct 2019 08:19:42 +0000 (10:19 +0200)]
avcodec/wmaprodec: Fix cleanup on error

Fixes: memleaks
Fixes: 18023/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA2_fuzzer-5642535011090432

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>