Commit Graph

101645 Commits

Author SHA1 Message Date
Andreas Rheinhardt 0858853241 avfilter/vf_uspp: Fix leak of qp-table on error
Fixes Coverity issue #1473500.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-12 19:05:11 +01:00
Andreas Rheinhardt 0364188fb9 avcodec/decode: Reindentation
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-12 18:29:03 +01:00
Andreas Rheinhardt cc448f8d39 avcodec/decode: Remove always-true check
Forgotten in 1fd7627770.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-12 18:28:20 +01:00
Andreas Rheinhardt d025a5bcc2 avformat/adp, svs: Remove redundant av_shrink_packet()
av_get_packet() already makes sure that the packet size is accurate
and that the packet data is zero-padded even when one could not read as
much as desired.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-12 17:13:10 +01:00
parazyd 51367267c8 avformat/gopher: Add support for Gopher over TLS
This commit adds a "gophers" handler to the gopher protocol. gophers
is a community-adopted protocol that acts the same way like normal
gopher with the added TLS encapsulation.

The gophers protocol is supported by gopher servers like geomydae(8),
and clients like curl(1), clic(1), and hurl(1).

This commit also adds compilation guards to both gopher and gophers,
since now there are two protocols in the file it makes sense to
have this addition.

Signed-off-by: parazyd <parazyd@dyne.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-03-11 23:47:19 +01:00
parazyd ed4c2e183b avformat/gopher: Add default_whitelist to ff_gopher_protocol
Signed-off-by: parazyd <parazyd@dyne.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-03-11 23:26:37 +01:00
Derek Buitenhuis e690aa6a8d avcodec/gifenc: Actually use the shrunk palette
I have no idea how nobody, including myself, noticed this.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2021-03-11 21:41:52 +00:00
James Almer 99042c2bf6 avcodec/h264_slice: don't copy frame data during error concealment
In addition to the fact that av_image_copy() cannot handle hardware pixel formats,
h->short_ref[0]->f may not be writable at this point.

Based on a patch by Hendrik Leppkes.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-11 17:57:37 -03:00
James Almer 9e2e6f935b avdevice/decklink: add missing include for buffer_size_t
Should fix compilation broken in f7abb53cb4.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-11 17:39:09 -03:00
Stephen Hutchinson 16e8ea0dde avisynth: fix audio on big endian
AviSynth+ outputs audio in the same format as the
OS, so assuming little endian formats as input
on big endian OSes results in nothing but static.

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2021-03-11 14:21:30 -05:00
emcodem 8b74458d93 avisynth: populate field order
Fixes Trac ticket #8757

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2021-03-11 14:21:30 -05:00
Stephen Hutchinson 4c40686ee2 avisynth: more intelligent RGB flipping
avs_is_color_space provides a generic way of checking whether the
video is RGB, and has been available through AVSC_API since 2.6.
This means that GetProcAddress doesn't have to run on every frame.

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2021-03-11 14:21:30 -05:00
Andreas Rheinhardt 9f1b808bde avformat/rawenc: Use init instead of write_header function
force_one_stream() does not write anything.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 20:01:28 +01:00
Michael Niedermayer b87781649e avcodec/4xm: Check pre_gb in decode_i_block()
Fixes: Timeout
Fixes: 31257/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FOURXM_fuzzer-5150866229297152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-03-11 16:06:33 +01:00
Andreas Rheinhardt 1ad628d2c2 avutil/buffer_internal: Include internal for buffer_size_t
Fixes checkheaders.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 14:07:15 +01:00
Andreas Rheinhardt 2f056def65 dnn/dnn_backend_native_layer_mathbinary: Fix leak upon error
Fixes Coverity issue #1473568.

Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 13:21:48 +01:00
Andreas Rheinhardt 723ebf029a dnn/dnn_backend_native_layer_conv2d: Don't pretend convolution can fail
It can't; these are just remnants of commit
3c7cad69f2 which let the worker threads
do the reallocation.

Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 13:20:00 +01:00
Andreas Rheinhardt 9da96d8b69 dnn/dnn_backend_native_layer_conv2d: Check thread creation for errors
Fixes Coverity issue #1473533.

Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 13:13:00 +01:00
Andreas Rheinhardt c2fef8f16c dnn/dnn_backend_native_layer_conv2d: Check allocation
Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 13:10:46 +01:00
Andreas Rheinhardt d14ae74064 dnn/dnn_backend_native_layer_conv2d: Avoid separate, unchecked allocations
Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 13:09:48 +01:00
Andreas Rheinhardt 508d7005a0 dnn/dnn_backend_native_layer_conv2d: Fix memleak on error
If an error happens when preparing the output data buffer, an already
allocated array would leak. Fix this by postponing its allocation.

Fixes Coverity issue #1473531.

Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 13:06:32 +01:00
Andreas Rheinhardt 16e36d5c0c dnn/dnn_backend_native_layer_conv2d: Avoid allocation when single-threaded
Also fixes a memleak in single-threaded mode when an error happens
in preparing the output data buffer; and also removes an unchecked
allocation.

Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 12:47:11 +01:00
Andreas Rheinhardt 639b3bbbc7 dnn/dnn_backend_native_layer_conv2d: Join two arrays, avoid allocation
Fixes Coverity issue #1473507.

Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 12:45:45 +01:00
Andreas Rheinhardt d915c1dd7a dnn/dnn_backend_native_layer_conv2d: Fix memleak on realloc failure
Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 12:44:09 +01:00
Andreas Rheinhardt f51f13902b dnn/dnn_backend_native: Fix typo in log message
Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 12:43:08 +01:00
Andreas Rheinhardt 1e47ef600d dnn/dnn_backend_native: Don't use asserts for checks
asserts should not be used instead of ordinary input checks.
Yet the native DNN backend did it: get_input_native() asserted that
the first dimension was one, despite this value coming directly from
the input file without having been sanitized.

Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 12:39:01 +01:00
Andreas Rheinhardt 0e078c6cfa dnn/dnn_backend_native: Fix leak in case parsing options fails
Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 12:34:17 +01:00
Andreas Rheinhardt 2e2ed39dac dnn/dnn_backend_native: Avoid allocation for checking file magic
Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 12:32:25 +01:00
Jean-Baptiste Kempf b7bf631f91 Doc: Tech Resolution Process 2021-03-11 10:03:38 +01:00
Andreas Rheinhardt f4f5da0d91 avcodec/libilbc: Support newer libiLBC versions
Beginning with version 3.0, libiLBC switched the types of some parts
of their public API to size_t and renamed some types; the old names
continue to work as typedefs, but are deprecated. It furthermore
added version macros.

This commit uses said version macro to use the new types when using
newer libiLBC versions.

Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-11 02:02:26 +01:00
James Almer e36eb94048 avutil: use the buffer_size_t typedef where required
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-10 20:26:37 -03:00
James Almer 5d9af1670e avfilter: use the buffer_size_t typedef where required
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-10 20:26:36 -03:00
James Almer f7abb53cb4 avdevice: use the buffer_size_t typedef where required
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-10 20:26:36 -03:00
James Almer e07126f54a avformat: use the buffer_size_t typedef where required
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-10 20:26:36 -03:00
James Almer d8a18c8fc2 avcodec: use the buffer_size_t typedef where required
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-10 20:26:36 -03:00
James Almer 42e68fe015 avformat/utils: change AVStream side data related public function and struct size types to size_t
av_stream_add_side_data() already defines size as a size_t, so this makes it
consistent across all side data functions.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-10 20:26:36 -03:00
James Almer d79e0fe65c avcodec/packet: change side data related public function and struct size types to size_t
av_packet_add_side_data() already defines size as a size_t, so this makes it
consistent across all side data functions

Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-10 20:26:36 -03:00
James Almer dbd47b7990 avutil/frame: change av_frame_new_side_data() size parameter type to size_t
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-10 20:26:36 -03:00
James Almer 14040a1d91 avutil/buffer: change public function and struct size parameter types to size_t
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-10 20:26:36 -03:00
Paul B Mahol 3e3c408e3f avfilter/af_dynaudnorm: make better check for available samples
Also report more correct EOF timestamp.
2021-03-10 23:52:07 +01:00
Andreas Rheinhardt 2ae73b74bb avfilter/vf_nnedi: Fix use of uninitialized value
Fixes Coverity issue #1473546.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-10 21:00:21 +01:00
Marton Balint 573f05a753 fftools/ffplay: do not write out of rdft visualization texture
If the window is resized it was possible that xpos pointed outside the
visualization texture. By rearranging the overflow check we make sure this (and
a crash) does not happen.

We also don't have to use xleft for start position, as that is 0 anyways, and
if we ever want to take into account xleft then the texture should be
positioned accordingly when rendering.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-03-10 20:01:03 +01:00
sfan5 a7425f712a avcodec/mediacodec_wrapper: use MediaCodecInfo.isSoftwareOnly() when available
Added in Android 10 it provides a reliable way of filtering out
software decoders, unlike existing string-based checks.
2021-03-10 14:09:14 +01:00
sfan5 1a033008e8 avcodec/mediacodec_wrapper: check if codec is software earlier 2021-03-10 14:09:04 +01:00
Michael Niedermayer c35e456f54 avformat/mvdec: Allocate extradata only once
Fixes: memleak
Fixes: 28686/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5822961932173312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-03-09 21:16:56 +01:00
Ovchinnikov Dmitrii 1a549efefb libavcodec/amfenc_hevc: Recommend values for min and max video quantizer scale.
Current settings makes bitrate larger than expected, more information:
https://github.com/HandBrake/HandBrake/issues/3447#issue-820490736

Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-09 16:14:05 -03:00
Andreas Rheinhardt 295f32ec98 avcodec/decode: Reindent after previous commits
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-09 14:22:18 +01:00
Andreas Rheinhardt b5a2481122 avcodec/decode: Don't needlessly copy side-data for subtitles
AVCodecInternal.last_pkt_props is not used when decoding subtitles;
ergo it makes no sense to set it at all.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-09 14:16:35 +01:00
Andreas Rheinhardt e12923f683 avcodec/decode: Avoid stack packets when decoding subtitles
Use AVCodecInternal.buffer_pkt (previously only used in
avcodec_send_packet) instead of stack packets when decoding subtitles.
Also stop sharing side-data between packets and use the user-supplied
packet directly for decoding when possible (no subtitle decoder ever
modifies the packet it is given).
Reusing AVCodecInternal.buffer_pkt is based upon an idea from James
Almer.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-09 14:06:59 +01:00
Andreas Rheinhardt f0dc8faeb1 avcodec/qsvdec: Make functions used only here static, remove header
Forgotten after d78ecf10bd.

(Also mark some AVPackets as const.)

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-09 14:00:13 +01:00