]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agoavformat/mvdec: Check stream numbers
Michael Niedermayer [Sun, 23 Feb 2020 08:27:27 +0000 (09:27 +0100)]
avformat/mvdec: Check stream numbers

Fixes: null pointer dereference
Fixes: 20768/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5638648978735104.fuzz
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mux: Cosmetics
Andreas Rheinhardt [Tue, 13 Aug 2019 02:47:17 +0000 (04:47 +0200)]
avformat/mux: Cosmetics

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/segafilmenc: Add deinit function
Andreas Rheinhardt [Tue, 14 Jan 2020 03:13:36 +0000 (04:13 +0100)]
avformat/segafilmenc: Add deinit function

Prevents memleaks when the trailer is never written or when shifting the
data fails when writing the trailer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/segafilmenc: Combine several checks
Andreas Rheinhardt [Tue, 14 Jan 2020 03:13:35 +0000 (04:13 +0100)]
avformat/segafilmenc: Combine several checks

by moving them around.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_zscale: fix crash on unaligned input
Jacob Ruiz [Fri, 14 Feb 2020 06:50:38 +0000 (22:50 -0800)]
avfilter/vf_zscale: fix crash on unaligned input

4 years agoavfilter/vf_convolve: reset fft/ifft pointers after free
Paul B Mahol [Tue, 25 Feb 2020 16:35:09 +0000 (17:35 +0100)]
avfilter/vf_convolve: reset fft/ifft pointers after free

4 years agodoc/filters: split tblend from blend
Paul B Mahol [Tue, 25 Feb 2020 12:23:14 +0000 (13:23 +0100)]
doc/filters: split tblend from blend

4 years agodoc/filters: mention commands for v360 filter
Paul B Mahol [Tue, 25 Feb 2020 12:17:32 +0000 (13:17 +0100)]
doc/filters: mention commands for v360 filter

4 years agoavcodec/utvideodec: add support for UQY0
Paul B Mahol [Tue, 25 Feb 2020 12:09:20 +0000 (13:09 +0100)]
avcodec/utvideodec: add support for UQY0

4 years agoavfilter/vf_v360: add basic commands support
Paul B Mahol [Tue, 25 Feb 2020 10:33:06 +0000 (11:33 +0100)]
avfilter/vf_v360: add basic commands support

4 years agoavfilter/vf_v360: handle gracefully invalid values for rorder option
Paul B Mahol [Tue, 25 Feb 2020 10:12:02 +0000 (11:12 +0100)]
avfilter/vf_v360: handle gracefully invalid values for rorder option

4 years agoavcodec/Makefile: remove bogus/duplicate PNG parser entry
Anamitra Ghorui [Mon, 24 Feb 2020 15:02:52 +0000 (20:32 +0530)]
avcodec/Makefile: remove bogus/duplicate PNG parser entry

4 years agoavfilter: add Contrast Adaptive Sharpen video filter
Paul B Mahol [Mon, 10 Feb 2020 17:10:55 +0000 (18:10 +0100)]
avfilter: add Contrast Adaptive Sharpen video filter

4 years agodoc: add adpcm_ima_{ssi,apm}
Zane van Iperen [Sun, 23 Feb 2020 04:28:00 +0000 (04:28 +0000)]
doc: add adpcm_ima_{ssi,apm}

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
4 years agochangelog: add adpcm_ima_ssi decoder and kvag demuxer
Zane van Iperen [Sun, 23 Feb 2020 04:27:55 +0000 (04:27 +0000)]
changelog: add adpcm_ima_ssi decoder and kvag demuxer

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
4 years agohwcontext_vaapi: Only accept a render node when deriving from DRM device
Mark Thompson [Sun, 16 Feb 2020 20:59:54 +0000 (20:59 +0000)]
hwcontext_vaapi: Only accept a render node when deriving from DRM device

If we are given a non-render node, try to find the matching render node and
fail if that isn't possible.

libva will not accept a non-render device which is not DRM master, because
it requires legacy DRM authentication to succeed in that case:
<https://github.com/intel/libva/blob/master/va/drm/va_drm.c#L68-L75>.  This
is annoying for kmsgrab because in most recording situations DRM master is
already held by something else (such as a windowing system), leading to
device derivation not working and forcing the user to create the target
VAAPI device separately.

4 years agolavc/vaapi_decode: add decode support for HEVC_MAIN_STILL_PICTURE
Linjie Fu [Wed, 15 Jan 2020 07:02:40 +0000 (15:02 +0800)]
lavc/vaapi_decode: add decode support for HEVC_MAIN_STILL_PICTURE

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agolavc/hevcdec: add 4:2:2 8-bit/10-bit VAAPI decode support
Linjie Fu [Wed, 15 Jan 2020 07:02:21 +0000 (15:02 +0800)]
lavc/hevcdec: add 4:2:2 8-bit/10-bit VAAPI decode support

Add decode support for 4:2:2 8-bt and 10-bit HEVC Range Extension clips.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agolavc/vaapi_decode: add profile_parser and format map support for HEVC REXT
Linjie Fu [Wed, 15 Jan 2020 07:02:02 +0000 (15:02 +0800)]
lavc/vaapi_decode: add profile_parser and format map support for HEVC REXT

Add function pointer field in vaapi_profile_map[], set profile_parser
for HEVC_REXT to find the exact va_profile.

Also add format map support.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agolavc/vaapi_hevc: add function to find exact va_profile for REXT
Linjie Fu [Wed, 15 Jan 2020 07:01:42 +0000 (15:01 +0800)]
lavc/vaapi_hevc: add function to find exact va_profile for REXT

Add vaapi_parse_rext_profile and use profile constraint flags to
determine the exact va_profile for HEVC_REXT.

If profile mismatch is allowed, select Main profile by default.

Add build object in Makefile for h265_profile_level dependency.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agolavc/hevc_ps: parse constraint flags for HEVC REXT
Linjie Fu [Wed, 15 Jan 2020 07:01:28 +0000 (15:01 +0800)]
lavc/hevc_ps: parse constraint flags for HEVC REXT

Parse all the constraint flags according to ITU-T Rec. H.265 (02/2018).

They have to be passed to hw decoders to determine the exact profile for Range
Extension HEVC.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agolavc/vaapi_hevc: extend parameter buffer to ParameterBufferHEVCExtension
Linjie Fu [Wed, 15 Jan 2020 07:01:05 +0000 (15:01 +0800)]
lavc/vaapi_hevc: extend parameter buffer to ParameterBufferHEVCExtension

Extend ParameterBufferHEVC to ParameterBufferHEVCExtension for both
VAPicture and VASlice.

Pass Range Extension flags to support the decode for HEVC REXT.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agolavu/hwcontext_vaapi: add vaapi_format_map support for Y210
Linjie Fu [Wed, 15 Jan 2020 07:00:12 +0000 (15:00 +0800)]
lavu/hwcontext_vaapi: add vaapi_format_map support for Y210

VA_RT_FORMAT describes the desired sampling format for surface.

When creating surface, VA_RT_FORMAT will be used firstly to choose
the expected fourcc/media_format for the surface. And the fourcc
will be revised by the value of VASurfaceAttribPixelFormat.

Add vaapi_format_map support for new pixel_format Y210.
This is fundamental for both VA-API and QSV.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agoswscale: Add swscale input support for Y210LE
Linjie Fu [Wed, 15 Jan 2020 06:59:34 +0000 (14:59 +0800)]
swscale: Add swscale input support for Y210LE

Add swscale input support for Y210LE, output support and fate
test could be added later if there is requirement for software
CSC to this packed format.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agolavu/pix_fmt: add new pixel format y210
Linjie Fu [Wed, 15 Jan 2020 06:58:38 +0000 (14:58 +0800)]
lavu/pix_fmt: add new pixel format y210

Add some packed 4:2:2 10-bit pixel formats for hardware decode support
in VAAPI and QSV.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agoavcodec/libzvbi-teletextdec: add option to set default G0 character set
Kirill Savkov [Wed, 19 Feb 2020 06:44:00 +0000 (09:44 +0300)]
avcodec/libzvbi-teletextdec: add option to set default G0 character set

Signed-off-by: Kirill Savkov <k.savkov@inventos.ru>
Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agodoc/protocols: clarify SRT timeout options docs
Marton Balint [Sat, 15 Feb 2020 10:29:28 +0000 (11:29 +0100)]
doc/protocols: clarify SRT timeout options docs

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/libsrt: make avformat connect timeout 0 by default
Marton Balint [Sat, 15 Feb 2020 10:30:16 +0000 (11:30 +0100)]
avformat/libsrt: make avformat connect timeout 0 by default

Otherwise the user is not able to override the SRT API connect timeout above 5
sec without also setting the timeout option.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/libsrt: use listen_timeout for listening
Marton Balint [Fri, 14 Feb 2020 23:30:29 +0000 (00:30 +0100)]
avformat/libsrt: use listen_timeout for listening

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/libsrt: send non-blocking mode on both the listen and the connect socket
Marton Balint [Fri, 14 Feb 2020 22:50:34 +0000 (23:50 +0100)]
avformat/libsrt: send non-blocking mode on both the listen and the connect socket

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/libsrt: small fixes in libsrt_neterrno()
Marton Balint [Fri, 14 Feb 2020 22:32:14 +0000 (23:32 +0100)]
avformat/libsrt: small fixes in libsrt_neterrno()

Return os error code if available, check for both SRT_EASYNCRCV and
SRT_EASYNCSND when transforming them to EAGAIN and only display error if it is
not EAGAIN.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/libsrt: poll for error conditions as well
Marton Balint [Fri, 14 Feb 2020 22:24:29 +0000 (23:24 +0100)]
avformat/libsrt: poll for error conditions as well

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/libsrt: fix checking connection result in non-blocking mode
Marton Balint [Thu, 13 Feb 2020 22:58:45 +0000 (23:58 +0100)]
avformat/libsrt: fix checking connection result in non-blocking mode

After f8990c5f414d4575415e2a3981c3b142222ca3d4 we properly set non-blocking
mode which makes the connect() call return always 0 even if no connection can
be established.

Fix this by always doing a poll after calling connect(). Also there was some
leftover copy paste code which checks for various errors which are simply not
possible with SRT.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/libsrt: fix name of timeout option
Marton Balint [Thu, 13 Feb 2020 22:50:32 +0000 (23:50 +0100)]
avformat/libsrt: fix name of timeout option

rw_timeout is the generic URLcontext option, not the protocol specific timeout
option, also ?rw_timeout never worked because ?timeout was parsed instead.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/libsrt: fix timeout unit confusion between milisec and microsec
Marton Balint [Thu, 13 Feb 2020 22:24:57 +0000 (23:24 +0100)]
avformat/libsrt: fix timeout unit confusion between milisec and microsec

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavfilter/vf_v360: improve dfisheye_to_xyz() output
Paul B Mahol [Sun, 23 Feb 2020 21:00:32 +0000 (22:00 +0100)]
avfilter/vf_v360: improve dfisheye_to_xyz() output

4 years agoavfilter/vf_v360: improve fisheye_to_xyz() output
Paul B Mahol [Sun, 23 Feb 2020 20:55:35 +0000 (21:55 +0100)]
avfilter/vf_v360: improve fisheye_to_xyz() output

4 years agoavcodec/ac3_parser: recognize LE bitstream variant
Paul B Mahol [Fri, 21 Feb 2020 21:31:07 +0000 (22:31 +0100)]
avcodec/ac3_parser: recognize LE bitstream variant

4 years agoavfilter/vf_v360: improve equirect_to_xyz() quality
Paul B Mahol [Sun, 23 Feb 2020 17:15:06 +0000 (18:15 +0100)]
avfilter/vf_v360: improve equirect_to_xyz() quality

4 years agoavcodec: add some documentation to the AVProducerReferenceTime struct
James Almer [Fri, 21 Feb 2020 14:06:06 +0000 (11:06 -0300)]
avcodec: add some documentation to the AVProducerReferenceTime struct

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/libx264: add a check for the prft AVCodecContext export_side_data flag
James Almer [Wed, 29 Jan 2020 14:12:18 +0000 (11:12 -0300)]
avcodec/libx264: add a check for the prft AVCodecContext export_side_data flag

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec: add an AVCodecContext flag to export PRFT side data on demand
James Almer [Sun, 2 Feb 2020 22:12:08 +0000 (19:12 -0300)]
avcodec: add an AVCodecContext flag to export PRFT side data on demand

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec: add an AVCodecContext field to signal types of packet, frame, and coded...
James Almer [Sun, 2 Feb 2020 21:44:41 +0000 (18:44 -0300)]
avcodec: add an AVCodecContext field to signal types of packet, frame, and coded stream side data to export

Add an initial mvs flag to is, analog to the export_mvs flags2 one.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/dashenc: always attempt to enable prft in ldash mode
James Almer [Tue, 18 Feb 2020 15:54:53 +0000 (12:54 -0300)]
avformat/dashenc: always attempt to enable prft in ldash mode

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/dashenc: write a capture time Producer Reference Time element when none...
James Almer [Tue, 18 Feb 2020 15:49:15 +0000 (12:49 -0300)]
avformat/dashenc: write a capture time Producer Reference Time element when none is provided by the encoder

This way, the element will be present in any scenario when the write_prft option is used.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/dashenc: write the styp box when the first frame of a segment is ready
James Almer [Tue, 18 Feb 2020 04:14:15 +0000 (01:14 -0300)]
avformat/dashenc: write the styp box when the first frame of a segment is ready

This ensures it's written at the beginning of a segment in non streaming mode
when segment duration differs from fragment duration.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/utils: Don't trigger errors for multiple id3 tags.
Dale Curtis [Fri, 21 Feb 2020 20:53:30 +0000 (12:53 -0800)]
avformat/utils: Don't trigger errors for multiple id3 tags.

Such errors may make sense for specific formats, but general parsing
logic shouldn't be treating these as errors regardless of the error
recognition mode.

Fixes loading of the following wave when using -err_detect explode:
https://cs.chromium.org/chromium/src/third_party/blink/web_tests/external/wpt/webaudio/resources/4ch-440.wav

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agofate/adpcm: add adpcm_ima_apm tests
Zane van Iperen [Sat, 22 Feb 2020 13:21:02 +0000 (13:21 +0000)]
fate/adpcm: add adpcm_ima_apm tests

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/segafilmenc: Remove redundant checks
Andreas Rheinhardt [Tue, 14 Jan 2020 03:13:34 +0000 (04:13 +0100)]
avformat/segafilmenc: Remove redundant checks

If an audio stream is present, the Sega FILM muxer checks for its
compability with the container during init, so that the very same check
needn't be repeated during writing the trailer.

Essentially the same is true for the presence of a video stream: It has
already been checked during init. Furthermore, after the check for the
presence of a video stream succeeded, a pointer is set to point to the
video stream. Yet said pointer (which was NULL before) will be
derefenced anyway regardless of the result of the check. Coverity thus
complained about this in CID 1434155 and removing this pointless check
will also fix this issue.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/apedec: fix decoding 3800 version with 2000 compression level
Paul B Mahol [Sat, 22 Feb 2020 14:20:27 +0000 (15:20 +0100)]
avcodec/apedec: fix decoding 3800 version with 2000 compression level

4 years agoavcodec/dxv: make prev variable unsigned
Paul B Mahol [Fri, 21 Feb 2020 23:15:43 +0000 (00:15 +0100)]
avcodec/dxv: make prev variable unsigned

4 years agoavcodec/pcm: Fix invalid shift in AV_CODEC_ID_PCM_LXF
Michael Niedermayer [Thu, 20 Feb 2020 21:26:18 +0000 (22:26 +0100)]
avcodec/pcm: Fix invalid shift in AV_CODEC_ID_PCM_LXF

Fixes: left shift of 233 by 24 places cannot be represented in type 'int'
Fixes: 20736/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PCM_LXF_fuzzer-4829212685107200
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>
4 years agoavcodec/cdtoons: Fix off by 4 check on diff_size
Michael Niedermayer [Thu, 20 Feb 2020 17:51:36 +0000 (18:51 +0100)]
avcodec/cdtoons: Fix off by 4 check on diff_size

Fixes: out of array read
Fixes: 20742/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CDTOONS_fuzzer-5738148607033344
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>
4 years agoavcodec/cdtoons: Correct several end of data checks in cdtoons_render_sprite()
Michael Niedermayer [Thu, 20 Feb 2020 17:49:56 +0000 (18:49 +0100)]
avcodec/cdtoons: Correct several end of data checks in cdtoons_render_sprite()

No testcases, found by code review when debuging issue found by oss-fuzz

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/adpcm: cosmetics; reindent
Paul B Mahol [Fri, 21 Feb 2020 13:44:44 +0000 (14:44 +0100)]
avcodec/adpcm: cosmetics; reindent

4 years agoavformat: add demuxer for Rayman 2's APM format
Zane van Iperen [Thu, 20 Feb 2020 11:31:51 +0000 (11:31 +0000)]
avformat: add demuxer for Rayman 2's APM format

Adds support for the APM file format used by Ubisoft's Rayman 2.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
4 years agoavcodec: add decoder for Rayman 2's ADPCM variant
Zane van Iperen [Thu, 20 Feb 2020 11:31:46 +0000 (11:31 +0000)]
avcodec: add decoder for Rayman 2's ADPCM variant

Adds support for the ADPCM variant used in Rayman 2's files.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
4 years agoavformat/spdifenc: fix TrueHD streams over 48kHz
Anssi Hannula [Thu, 20 Feb 2020 21:04:50 +0000 (23:04 +0200)]
avformat/spdifenc: fix TrueHD streams over 48kHz

Commit 36e156bef02 ("avformat/spdifenc: fix handling of large TrueHD
frame") added an obviously incorrect bitshift that caused incorrect
samples-per-frame calculation for TrueHD streams over 48kHz.

Fix that.

4 years agoavformat/spdifenc: fix handling of large TrueHD frames
Anssi Hannula [Wed, 19 Feb 2020 20:46:35 +0000 (22:46 +0200)]
avformat/spdifenc: fix handling of large TrueHD frames

The TrueHD IEC 61937 encapsulation code uses a very naive method of
always inserting 24 TrueHD frames evenly in a MAT frame. This does not
work for larger frames as they may exceed the size of 1/24th of a MAT
frame.

To fix that, use the input_timing field in the TrueHD frame to determine
the proper position of the TrueHD frame in the MAT frame. That field is
basically a dts field, telling the time to feed this frame to the
decoder in sample count units.

This can cause a TrueHD frame to be split between two MAT frames, so a
second concatenation hd_buf is added, alternating with the first buffer.

Large frames are preceded by smaller frames that have input_timing
values that cause the frames to be sent out faster than the nominal rate
(i.e. increasing decoder latency, long decoder buffer), allowing the
larger frames to then be sent out slower than the nominal rate as the
decoder has enough data buffered to keep it busy.

4 years agoavformat/spdifenc: make hd_buf an array
Anssi Hannula [Thu, 20 Feb 2020 19:49:50 +0000 (21:49 +0200)]
avformat/spdifenc: make hd_buf an array

This is preparation for adding a second hd_buf in a followup commit.

Also, slightly improve the comments for hd_buf_x members to clarify
which ones are actually used and kept up-to-date depending on which
codec is being muxed.

4 years agoavformat/vivo: set packet duration
Paul B Mahol [Wed, 4 Apr 2018 18:23:23 +0000 (20:23 +0200)]
avformat/vivo: set packet duration

Signed-off-by: Paul B Mahol <onemda@gmail.com>
4 years agoavformat/vivo: improve probing of some files
Paul B Mahol [Wed, 4 Apr 2018 09:47:42 +0000 (11:47 +0200)]
avformat/vivo: improve probing of some files

Signed-off-by: Paul B Mahol <onemda@gmail.com>
4 years agoavcodec: add siren audio decoder
Paul B Mahol [Tue, 3 Apr 2018 19:49:48 +0000 (21:49 +0200)]
avcodec: add siren audio decoder

4 years agolavd/opengl_enc: check strings before parsing them.
Nicolas George [Mon, 17 Feb 2020 11:59:27 +0000 (12:59 +0100)]
lavd/opengl_enc: check strings before parsing them.

Fix a segfault if OpenGL was not initialized before calling
write_header().

4 years agolavd/opengl_enc: use proper context for logging.
Nicolas George [Mon, 17 Feb 2020 11:58:35 +0000 (12:58 +0100)]
lavd/opengl_enc: use proper context for logging.

Log as [opengl @ 0xaddress] instead of [opengl outdev @ 0xaddress].

4 years agoavformat/wtvdec: Forward errors when reading packet
Andreas Rheinhardt [Mon, 10 Feb 2020 17:21:37 +0000 (18:21 +0100)]
avformat/wtvdec: Forward errors when reading packet

wtvfile_read_packet did not abide by the requirements of an
AVIOContext's read_packet-function: If it did not read anything,
it returned zero, which currently leads to a warning in read_packet_wrapper
in aviobuf.c. Said warning will be an av_assert2 as soon as
FF_API_OLD_AVIO_EOF_0 is zero (probably the next major version bump).
So instead forward the error code from the underlying protocol.

This error/assert is triggered in the wtv-demux FATE test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolibavcodec/svq: Remove ff_svq1_packet_checksum()
Michael Niedermayer [Tue, 18 Feb 2020 23:42:33 +0000 (00:42 +0100)]
libavcodec/svq: Remove ff_svq1_packet_checksum()

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/qdm2: Check fft_coefs_index
Michael Niedermayer [Tue, 18 Feb 2020 21:58:12 +0000 (22:58 +0100)]
avcodec/qdm2: Check fft_coefs_index

Fixes: out of array access
Fixes: 20660/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDM2_fuzzer-5658290216501248
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>
4 years agoansi: process ESC[3m italics attribute
Peter Ross [Tue, 18 Feb 2020 01:03:53 +0000 (12:03 +1100)]
ansi: process ESC[3m italics attribute

squelch unknown escape code warnings

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Peter Ross <pross@xvid.org>
4 years agolavc/qsvenc: add support for external bitrate control for HEVC
Linjie Fu [Thu, 13 Feb 2020 12:47:24 +0000 (20:47 +0800)]
lavc/qsvenc: add support for external bitrate control for HEVC

Enables option for hevc_qsv encoder:
    -extbrc

Improvements in BD-Rate could be observed with extbrc on.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agolavfi/vf_scale_qsv: fix the class_name in help for scale_qsv
Linjie Fu [Tue, 21 Jan 2020 08:50:14 +0000 (16:50 +0800)]
lavfi/vf_scale_qsv: fix the class_name in help for scale_qsv

Class name is used in show_help_children(avfilter_get_class(),...)
to prompt the available filters.

$ ffmpeg -h full

Before:
qsvscale AVOptions:

After:
scale_qsv AVOptions:

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agolibavcodec/qsvenc.c: Set mjpeg height and width alignment
JonCookCubic [Tue, 21 Jan 2020 13:06:43 +0000 (13:06 +0000)]
libavcodec/qsvenc.c: Set mjpeg height and width alignment

Currently width_align and height_align are zero when encoding with mjpeg_qsv,
which causes "Error submitting the frame for encoding". This patch sets the alignments.

There is a little bit more about the problem here http://ffmpeg.org/pipermail/ffmpeg-user/2019-November/046143.html

Signed-off-by: JonCookCubic <jon.cook@cubicmotion.com>
Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agoavformat/dashenc: warn if Producer Reference Time element option is missing when...
James Almer [Mon, 17 Feb 2020 15:44:18 +0000 (12:44 -0300)]
avformat/dashenc: warn if Producer Reference Time element option is missing when ldash mode is used

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/dashenc: disable Resync elements when using DVB-DASH profile
James Almer [Mon, 17 Feb 2020 15:16:07 +0000 (12:16 -0300)]
avformat/dashenc: disable Resync elements when using DVB-DASH profile

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/v4l2_m2m: Fix typo in log message and cosmetics
Andriy Gelman [Sun, 16 Feb 2020 19:31:44 +0000 (14:31 -0500)]
avcodec/v4l2_m2m: Fix typo in log message and cosmetics

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years agoavformat/dashenc: always set coding_dependency to 1 if a parser isn't used
James Almer [Sun, 16 Feb 2020 17:42:00 +0000 (14:42 -0300)]
avformat/dashenc: always set coding_dependency to 1 if a parser isn't used

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/dashenc: include an availabilityTimeComplete element in all streaming modes
James Almer [Sun, 19 Jan 2020 21:11:08 +0000 (18:11 -0300)]
avformat/dashenc: include an availabilityTimeComplete element in all streaming modes

It's not exclusive for Low Latency streaming. The muxer will serve partial
segments regardless of streaming mode.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/dashenc: add Trick Mode support for AdaptationSets
James Almer [Fri, 10 Jan 2020 18:51:27 +0000 (15:51 -0300)]
avformat/dashenc: add Trick Mode support for AdaptationSets

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/dashenc: make AdaptationSet id an integer value
James Almer [Wed, 8 Jan 2020 16:47:08 +0000 (13:47 -0300)]
avformat/dashenc: make AdaptationSet id an integer value

Unlike Representation id, it's defined as an integer in the spec, and not as a
string.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/utils: Fix integer overflow with complex time bases in avformat_find_stream_...
Michael Niedermayer [Sat, 15 Feb 2020 22:23:55 +0000 (23:23 +0100)]
avformat/utils: Fix integer overflow with complex time bases in avformat_find_stream_info()

Fixes: signed integer overflow: 2045163756 * 2 cannot be represented in type 'int'
Fixes: Ticket5132
Found-by: tsmith
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/avidec: Avoid integer overflow in NI switch check
Michael Niedermayer [Sat, 15 Feb 2020 22:18:25 +0000 (23:18 +0100)]
avformat/avidec: Avoid integer overflow in NI switch check

Fixes: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long'
Fixes: Ticket8149
Found-by: Suhwan
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agofftools/ffmpeg: Fix integer overflow in duration computation in seek_to_start()
Michael Niedermayer [Sat, 15 Feb 2020 21:56:18 +0000 (22:56 +0100)]
fftools/ffmpeg: Fix integer overflow in duration computation in seek_to_start()

Fixes: signed integer overflow: -9223372036854775808 - 9223372036854775807 cannot be represented in type 'long'
Fixes: Ticket8142
Found-by: Suhwan
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_aspect: Fix integer overflow in compute_dar()
Michael Niedermayer [Sat, 15 Feb 2020 21:35:37 +0000 (22:35 +0100)]
avfilter/vf_aspect: Fix integer overflow in compute_dar()

Fixes: signed integer overflow: 1562273630 * 17 cannot be represented in type 'int'
Fixes: Ticket8323
Found-by: Suhwan
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/utils: avoid unsigned integer overflows
Paul B Mahol [Sat, 15 Feb 2020 13:52:47 +0000 (14:52 +0100)]
avformat/utils: avoid unsigned integer overflows

4 years agoavcodec: fix pcm zork decoder
Paul B Mahol [Fri, 14 Feb 2020 19:37:42 +0000 (20:37 +0100)]
avcodec: fix pcm zork decoder

Fixes #1939

4 years agoavformat/segafilmenc: Remove AVClass
Andreas Rheinhardt [Tue, 14 Jan 2020 03:13:33 +0000 (04:13 +0100)]
avformat/segafilmenc: Remove AVClass

This muxer does not have any private options and so does not need a
private class.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/ftp: slightly rework file retrieval with seeking
Marton Balint [Thu, 6 Feb 2020 22:32:10 +0000 (23:32 +0100)]
avformat/ftp: slightly rework file retrieval with seeking

- do not require a known file size for seek to work
- read the files till the actual end, do not limit data at the queried file
  size
- fix a bug which causes reading 0 byte files for non-existing files
- properly check the return status of the FTP server at the end of the file
  retrieval

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/ftp: do not break protocol on username or password with newlines
Marton Balint [Wed, 5 Feb 2020 23:48:17 +0000 (00:48 +0100)]
avformat/ftp: do not break protocol on username or password with newlines

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/ftp: add support for escaped credentials
Marton Balint [Wed, 5 Feb 2020 23:11:05 +0000 (00:11 +0100)]
avformat/ftp: add support for escaped credentials

Properly fixes ticket #7816.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/httpauth: do not decode plus sign to space in credentials
Marton Balint [Tue, 4 Feb 2020 22:46:23 +0000 (23:46 +0100)]
avformat/httpauth: do not decode plus sign to space in credentials

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/urldecode: add the ability to not decode plus sign to space
Marton Balint [Tue, 4 Feb 2020 22:44:28 +0000 (23:44 +0100)]
avformat/urldecode: add the ability to not decode plus sign to space

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/http: escape unsafe URL path in HTTP request
Marton Balint [Sat, 8 Feb 2020 00:44:30 +0000 (01:44 +0100)]
avformat/http: escape unsafe URL path in HTTP request

This avoids generating invalid HTTP requests if the path contains space or
other special characters.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/http: use AVBPrint to construct HTTP request
Marton Balint [Fri, 7 Feb 2020 23:08:54 +0000 (00:08 +0100)]
avformat/http: use AVBPrint to construct HTTP request

v2: Use s->buffer for creating request (as the old code did) instead of
the AVBPrint internal buffer. Some minor cosmetics.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/http: make sure URL path contains a slash
Marton Balint [Mon, 3 Feb 2020 22:29:08 +0000 (23:29 +0100)]
avformat/http: make sure URL path contains a slash

It is explicitly required by the HTTP RFC. Without this patch URLs like
http://example.com?query will not work.

Fixes ticket #8466.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/http: split the fragment part from the HTTP URL before the request
Marton Balint [Mon, 3 Feb 2020 22:06:09 +0000 (23:06 +0100)]
avformat/http: split the fragment part from the HTTP URL before the request

RFC 3986 states that the fragment identifier is separated from the rest of the
URI prior to a dereference, and thus the identifying information within the
fragment itself is dereferenced solely by the user agent.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/utils: make av_url_split search for hashmark as well to separate hostname
Marton Balint [Mon, 3 Feb 2020 00:32:00 +0000 (01:32 +0100)]
avformat/utils: make av_url_split search for hashmark as well to separate hostname

RFC 3986 states that the generic syntax uses the slash ("/"), question mark
("?"), and number sign ("#") characters to delimit components that are
significant to the generic parser's hierarchical interpretation of an
identifier.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/tests/url: add av_url_split tests
Marton Balint [Mon, 3 Feb 2020 00:13:28 +0000 (01:13 +0100)]
avformat/tests/url: add av_url_split tests

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/tests/url: make format more readable
Marton Balint [Sun, 2 Feb 2020 22:26:16 +0000 (23:26 +0100)]
avformat/tests/url: make format more readable

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/utils: Fix memleaks in avformat_open_input()
Andreas Rheinhardt [Tue, 7 Jan 2020 13:55:47 +0000 (14:55 +0100)]
avformat/utils: Fix memleaks in avformat_open_input()

A demuxer might have allocated memory while reading the header. If
reading the header was successfull and an error happens before returning
(e.g. when queueing the attached pictures), the read_close function
would have never been called, so that all those allocations would leak.
This commit changes this.

Furthermore, there would be even more memleaks if the error level was
set to AV_EF_EXPLODE in case there is both metadata and id3v2 metadata.
This has been fixed, too.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agocompat/os2threads: define INCL_DOSERRORS
Dave Yeo [Thu, 13 Feb 2020 04:13:00 +0000 (20:13 -0800)]
compat/os2threads: define INCL_DOSERRORS

This is needed to pull in the define for ERROR_TIMEOUT

Signed-off-by: Dave Yeo <daveryeo@telus.net>
Signed-off-by: Marton Balint <cus@passwd.hu>