1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

45690 Commits

Author SHA1 Message Date
Michael Niedermayer
5f835efbca avcodec/flicvideo: Check remaining bytes in FLI*COPY
Fixes: Timeout
Fixes: 37795/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLIC_fuzzer-4846536543043584

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 17:21:55 +02:00
Michael Niedermayer
018b611b4b avcodec/utils: ARGO writes 4x4 blocks without regard to the image dimensions
Fixes: out of array access
Fixes: 37197/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-5877046382297088

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 17:21:40 +02:00
Andreas Rheinhardt
78ec2f3bd7 avcodec/internal: Update AVCodecInternal.is_copy documentation
Forgotten in 1f4cf92cfb.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:29 +02:00
Andreas Rheinhardt
b9fd9bce73 avcodec/avcodec: Simplify check for flushing of bsf
Just check for the existence of the bsf. This is equivalent to
the old criterion of the AVCodecContext being a decoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:29 +02:00
Andreas Rheinhardt
29e23ac71d avcodec/avcodec: Remove redundant assert
It is now checked by FATE that no encoder capable of flushing
uses frame threads, so this now redundant runtime check can
be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:29 +02:00
Andreas Rheinhardt
d6176eeeec avcodec/tests/avcodec: Check codec caps for consistency
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:19 +02:00
Andreas Rheinhardt
482850992c avcodec/avcodec: Make sanity check stricter
If an AVCodec has a private class, its priv_data_size must be > 0
and at the end of a successful call to avcodec_open2()
the AVCodecContext's priv_data must exist and its first element
must be a pointer to said AVClass. This should not be conditional
on priv_data_size being > 0 (which is tested by FATE) or
on the private context having been successfully allocated
(which has to have happened at that point). So remove these
preconditions to make the test stricter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:19 +02:00
Andreas Rheinhardt
2b0f29507f avcodec/tests/avcodec: Sanity check AVCodec.priv_data_size
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:18 +02:00
Andreas Rheinhardt
5aac4b669a avcodec/j2kenc: Fix AV_OPT_TYPE_CONST offsets
They are supposed to be zero.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:18 +02:00
Andreas Rheinhardt
497c490a4e avcodec/tests/avcodec: Check consistency of function pointers
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:15 +02:00
Andreas Rheinhardt
d77798309f avcodec/tests/avcodec: Test AVCodec and AVCodecDescriptor consistency
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:01 +02:00
Andreas Rheinhardt
0d97317429 avcodec/tests/avcodec: Add basic sanity checks for AVCodec properties
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:03:56 +02:00
Andreas Rheinhardt
136865413c avcodec/tests/utils: Rename to avcodec
The current name comes from a time in which libavcodec/utils.c
contained the whole core of libavcodec.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 12:56:08 +02:00
Maryla
9f4708c22d webp: fix transforms after a palette with pixel packing.
When a color indexing transform with 16 or fewer colors is used,
WebP uses "pixel packing", i.e. storing several pixels in one byte,
which virtually reduces the width of the image (see WebPContext's
reduced_width field). This reduced_width should always be used when
reading and applying subsequent transforms.

Updated patch with added fate test.
The source image dual_transform.webp can be downloaded by cloning
https://chromium.googlesource.com/webm/libwebp-test-data/

Fixes: 9368
Signed-off-by: James Zern <jzern@google.com>
2021-09-25 15:31:36 -07:00
Andreas Rheinhardt
9348d06fc6 avcodec/qsvenc: Remove dead code for user-provided buffers
Dead since commit 93016f5d1d
which ensured that the packets received by encoders are always blank.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-25 22:58:17 +02:00
Andreas Rheinhardt
dd0a7fdfc0 avcodec/qsvenc: Fix memleaks upon allocation errors
Fixes leaks in case the allocation of the H.264-specific stuff fails.
Fixes Coverity issues #1442911 and #1442914.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-25 22:58:17 +02:00
Zhao Zhili
378ad2f8fd lavc/aarch64: fix relocation out of range error
Use a temporary label instead of global function symbol for b.gt.

Signed-off-by: Martin Storsjö <martin@martin.st>
2021-09-25 21:55:29 +03:00
Limin Wang
0463f5d6d5 avcodec/libsvtav1: Fix value range for rc mode
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-25 21:37:01 +08:00
Limin Wang
64e2fb3f9d avcodec/libsvtav1: make coded GOP type configurable
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-25 21:35:54 +08:00
Limin Wang
04b89e8ae3 avcodec/libsvtav1: Fix duplicate definition of caps_internal
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-25 21:35:40 +08:00
James Almer
970264a74f avcodec/av1_parser: constify some variables
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-24 00:04:37 -03:00
Andreas Rheinhardt
bb98212930 avcodec/elbg: Mark ELBGContext as being unaliased by using av_restrict
This improves performance: For msvideo1, the performance improved by
4.8% when encoding the sample from the fate-vsynth1-msvideo1 test;
when encoding the sample from fate-vsynth1-cinepak, performance
improved by 2%. The compiler user was GCC 10 and the calls to encode2
have been timed.

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-24 00:01:49 +02:00
Andreas Rheinhardt
6b2c1d1018 avcodec/elbg: Add flags to avpriv_elbg_do()
This is currently unused and it is only added to enable changes
while maintaining ABI compatibility. The type is uintptr_t in order
to potentially accept a pointer argument.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-24 00:01:27 +02:00
Andreas Rheinhardt
73f47846bd avcodec/msvideo1enc: Check all calls to avpriv_elbg_do()
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-24 00:00:39 +02:00
Andreas Rheinhardt
ad27326e2b avcodec/cinepakenc: Check all calls to avpriv_elbg_do()
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-24 00:00:13 +02:00
Andreas Rheinhardt
477a398c3e avcodec/elbg: Also allocate buffers for recursion only once
This is possible because the number of elements needed in each
recursion step decreases geometrically, so the geometric series
provides an upper bound for the sum of number of elements of
the needed buffers.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-23 23:53:38 +02:00
Paul B Mahol
cd7e25b14a avcodec/mlpenc: fix encoding stereo single stream in TrueHD 2021-09-23 23:43:48 +02:00
Paul B Mahol
57f0b36367 avcodec/mlpdec: fix decoding single stereo stream in TrueHD 2021-09-23 23:43:48 +02:00
Nicolas Gaullier
fad459b5a6 avcodec/h264_parser: Set AVCodecContext.framerate
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-23 10:35:08 -03:00
James Almer
6edcdd2520 avcodec/cbs_h265: support general_profile_idc 11
And fix support for general_profile_idc 9 and 10.
Defined in ITU-T H.265 (V6).

Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-22 16:31:35 -03:00
Limin Wang
a487635b85 avcodec/dynamic_hdr10_plus: check size before using it
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-22 09:25:25 +08:00
Limin Wang
4c079636ab avcodec/dynamic_hdr10_plus: use AVERROR_INVALIDDATA instead of AVERROR(EINVAL)
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-22 09:25:25 +08:00
Limin Wang
45b850f9f5 avcodec/hevc_sei: check size before using it
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-22 09:25:25 +08:00
James Almer
9a7fe439d9 avcodec/libdav1d: let libdav1d choose optimal max frame delay
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-21 15:11:20 -03:00
Michael Niedermayer
85413a5ae6 avcodec/cbs_h265_syntax_template: Limit sps_num_palette_predictor_initializer_minus1 to 127
Fixes: index 128 out of bounds for type 'uint16_t [128]'
Fixes: 38651/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-6296416058736640

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-21 19:20:56 +02:00
James Almer
d873b5fffc avcodec/libdav1d: pass auto threads value to libdav1d
libdav1d 1.0.0 will be the first version supporting Dav1dSettings.n_threads == 0.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-20 22:30:35 -03:00
Andreas Rheinhardt
60ada0f5fa avcodec/elbg: Keep buffers to avoid allocations and frees
Up until now, each call to avpriv_elbg_do() would result
in at least six allocations. And this function is called a lot:
A typical FATE run results in 52213653 calls to av_malloc; of these,
34974671 originate from av_malloc_array and from these 34783679
originate from avpriv_elbg_do; the msvideo1 encoder tests are behind
most of these.

This commit changes this by keeping the buffers and only reallocating
them when needed. E.g. for the encoding part of fate-vsynth1-msvideo1
total heap usage went down from 11,407,939 allocs and frees with
468,106,207 bytes allocated to 3,149 allocs and frees with 13,181,847
bytes allocated. The time for one encode2-call went down by 69%.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 05:40:51 +02:00
Andreas Rheinhardt
5e01527330 avcodec/elbg: Move arguments to the context early if possible
This affects all the arguments that don't change during a call
to avpriv_elbg_do(); doing so makes it easily recognizable which
arguments change upon recursive calls.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 05:09:59 +02:00
Andreas Rheinhardt
896c11687e avcodec/elbg: Add persistent ELBGContext
It will be used in future commits to avoid having to allocate and free
all the buffers used.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 04:38:45 +02:00
Andreas Rheinhardt
9e11debb5d avcodec/elbg: Rename elbg_data to ELBGContext
It is in line with our naming conventions for types.
Also change numCB to num_cb for the same reason.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 04:38:25 +02:00
Andreas Rheinhardt
05ccfcb7b0 avcodec/elbg: Merge avpriv_init_elbg() into avpriv_do_elbg()
These functions are always called directly after another with
the exact same arguments. This avoids exporting a symbol;
it also avoids having to perform two calls for every caller.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 04:09:22 +02:00
Andreas Rheinhardt
d046e76515 avcodec/elbg: Move avpriv_init_elbg() down
It will avoid a forward declaration later.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 04:08:54 +02:00
Andreas Rheinhardt
1ea3650823 Replace all occurences of av_mallocz_array() by av_calloc()
They do the same.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 01:03:52 +02:00
Andreas Rheinhardt
4b15474316 avcodec/opus_silk: Remove wrong size information in function declaration
silk_lsp2poly()'s declaration contained arrays with array sizes;
yet these array sizes exceeded the number of actually accessed array
elements (which is related to another parameter) and this leads to
-Wstringop-overflow= warnings from GCC 11, because the arrays provided
by callers are only large enough for the actually used elements.

So replace the incorrect array sizes with comments containing
the correct array sizes. Given that these sizes are not compile-time
constants, they can only be communicated via a comment.

Reported by Paul B Mahol.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 01:03:51 +02:00
Andreas Rheinhardt
176b8d785b avcodec/avcodec, options_table: Deprecate sub_text_format
Unused since 1f63665ca5.

Found-by: Soft Works <softworkz@hotmail.com>
Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 01:03:48 +02:00
Andreas Rheinhardt
8edf6c3bf1 avcodec/(h263|mpeg4?video)_parser: Make *_find_frame_end() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 00:20:15 +02:00
Anton Khirnov
dd846bc4a9 lavc: deprecate AV_CODEC_(FLAG|CAP)_TRUNCATED
It is supported only by a few decoders (h263, h263p, mpeg(1|2|)video
and mpeg4) and is entirely redundant with parsers. Furthermore, using
it leads to missing frames, as flushing the decoder at the end does not
work properly.

Co-authored-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 00:20:13 +02:00
Andreas Rheinhardt
9c489a0f3a avcodec/mpegvideo: Move startcodes to mpeg12.h
And remove the MPEG-4-specific SLICE_START_CODE, which duplicates
SLICE_STARTCODE.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 00:10:35 +02:00
Michael Niedermayer
0faf04e807 avcodec/snowdec: Maintain avmv buffer
This avoids reallocating per frame

Fixes: Assertion failure
Fixes: 36359/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6733238591684608
Fixes: 38623/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6098656512573440

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-19 22:36:23 +02:00
Michael Niedermayer
db18f29b33 avcodec/siren: Check index for catergory5
Fixes: out of array access
Fixes: 38603/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSNSIREN_fuzzer-5741847809490944.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-19 20:12:32 +02:00
Michael Niedermayer
5a95abcce4 avcodec/mpeg12dec: Do not put mpeg_f_code into an invalid state on error return
Fixes: invalid shift
Fixes: 37018/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-5290280902328320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-17 19:56:05 +02:00
Michael Niedermayer
245017ec8a avcodec/mpegvideo_enc: Limit bitrate tolerance to the representable
Fixes: error: 1.66789e+11 is outside the range of representable values of type 'int'
Fixes: Ticket8201

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-17 19:23:03 +02:00
Michael Niedermayer
48bbeac259 avcodec/wmaprodec: Check that the EOF frame was allocated before decoding into it
Fixes: NULL pointer dereference
Fixes: 38125/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA1_fuzzer-5151909422432256

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>
2021-09-17 19:23:03 +02:00
Andreas Rheinhardt
a6760bb92b avcodec/elbg: Remove avoidable buffer
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-17 15:13:04 +02:00
Michael Niedermayer
90da43557f avcodec/apedec: Fix integer overflow in intermediate
Fixes: signed integer overflow: 559334865 * 4 cannot be represented in type 'int'
Fixes: 37929/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6751932295806976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-16 18:41:10 +02:00
James Almer
e93c998602 avcodec/mjpegdec: export display matrix frame side data when available
Finishes fixing ticket #6945.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-16 12:57:10 -03:00
Michael Niedermayer
c1a49a1264 avcodec/elbg: Increase some fields to 64bit
Fixes: Ticket8312
Fixes: Ticket8321

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-15 19:55:17 +02:00
Tong Wu
f31033c6ca avcodec/dxva2_av1: fix superres_denom parameter
Defined in spec 5.9.8. When superres is enabled, SuperresDenom equals
"coded_denom + SUPERRES_DENOM_MIN" instead of coded_denom.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
2021-09-14 23:44:42 +02:00
James Almer
5d5ab3b4e6 avcodec/h264_picture: wait for the second slice to apply film grain on interlaced content
Fixes: Assertion failure
Fixes: clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-6581961297100800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-14 13:55:49 -03:00
Michael Niedermayer
e67deaf86c avcodec/exr: Fix undefined integer multiplication
Fixes: signed integer overflow: 7020950083487072256 * 2 cannot be represented in type 'long long'
Fixes: 37523/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5133634955771904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-14 17:34:33 +02:00
Michael Niedermayer
7dfa8040d6 avcodec/jpeg2000_parser: Check state!=0
Fixes: out of array read
Fixes: 37664/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5893420460146688

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>
2021-09-14 17:34:33 +02:00
Andreas Rheinhardt
bbc24363f1 avcodec/bsf: Unref the packet when flushing
The documentation does not require the packet to be blank in this case
(i.e. it can now contain opaque_ref), but it does contain that the
contents will be reset upon success.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-14 13:41:34 +02:00
Andreas Rheinhardt
b99fb4df42 avcodec/bsf: Use null-bsf for passthrough when available
When an empty list bsf is used for passthrough, there is a check
for every packet in bsf_list_filter() before ff_bsf_get_packet_ref()
is called. Directly using the null bsf avoids that.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-14 13:41:26 +02:00
bnnm
19802d170a avcodec/wmadec: fix WMA gapless playback
Fixes trac issue #7473.

Removes encoder delay (skip samples) and writes remaining frame samples after EOF to get correct sample count.

Output is now accurate vs players that use Microsoft's codecs (Windows Media Format Runtime).

Tested vs encode>decode WMAv2 with MS's codecs and most sample rate/bit rate/channel/mode combinations in ASF/XWMA.
WMAv1 appears to use the same delay, from FFmpeg samples.

Signed-off-by: bnnm <bananaman255@gmail.com>
2021-09-12 22:23:35 +02:00
Niklas Haas
a543d075cd avcodec/h274: trim unnecessarily large array
We only ever read to idx+3, so 256 values are overkill.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-12 11:07:40 -03:00
Niklas Haas
52c35d648c avcodec/h274: don't read from uninitialized array members
This bug flew under the radar because, in practice, these values are
0-initialized for the first invocation. But for subsequent invocations
(with different h/v values), reading from the uninitialized parts of
`out` is undefined behavior.

Avoid this by simply adjusting the iteration range of the following
loops. Has the added benefit of being a minor speedup.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-12 11:07:40 -03:00
Xu Guangxin
3bbe0c210b avcodec/qsv_enc: do not reuse enc_ctrl from previous frames
fixes #8857

If we do not clear the enc_ctrl, we will reuse previous frames' data like FrameType.

Reviewed-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-09 12:53:25 -03:00
Andreas Rheinhardt
bb9141cc13 avcodec/mlpenc: Fix mixed declarations and code warning
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-09 12:07:06 +02:00
Peter Ross
20f9cfb3e3 avcodec/siren: decode_vector: remove unused parameter
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2021-09-09 18:38:16 +10:00
Peter Ross
e8aec714d3 avcodec/siren: replace magic numbers with macro value
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2021-09-09 18:38:16 +10:00
Adam Chelminski
715f63232f avcodec/libvpxenc: Apply codec options to alpha codec context
When encoding yuva420 (alpha) frames, the vpx encoder uses a second
vpx_codec_ctx to encode the alpha stream. However, codec options were
only being applied to the primary encoder. This patch updates
codecctl_int and codecctl_intp to also apply codec options to the alpha
codec context when encoding frames with alpha.

This is necessary to take advantage of libvpx speed optimizations
such as 'row-mt' and 'cpu-used' when encoding videos with alpha.
Without this patch, the speed optimizations are only applied to the
primary stream encoding, and the overall encoding is just as slow
as it would be without the options specified.

Signed-off-by: Adam Chelminski <chelminski.adam@gmail.com>
Signed-off-by: James Zern <jzern@google.com>
2021-09-08 18:48:00 -07:00
Andreas Rheinhardt
41751e4aef avcodec/iirfilter: Make ff_iir_filter_flt() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
854f7bab5a avcodec/snow_dwt: Make ff_snow_(horizont|vertic)al_compose97i static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
faa62773cb avcodec/jpeg2000: Make ff_tag_tree_size() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
fc9cb7d51a avcodec/mqcenc: Make ff_mqc_flush() static
Only used as an auxiliary function for ff_mqc_flush_to() since
4624656797.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
25394eb72e avcodec/qsv: Make ff_qsv_map_error() static
It is only an auxiliary function to ff_qsv_print_(error|warning)().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
029bfc3501 avcodec/h263dec: Make ff_h263_hw_config_list static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
fd43b868e1 avcodec/cbs: Make ff_cbs_alloc_unit_data() static
Forgotten in 7c92eaace2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
97bc4695fb avcodec/bsf: ff_list_bsf static
It is a special BSF that is only available via the av_bsf_list-API;
it is not part of the list generated from the declarations in
bitstream_filters.c and therefore needn't have external linkage.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Artem Galin
776d5a7472 libavcodec/qsv: enabling d3d11va support, added mfxhdlpair
Adding DX11 relevant device type checks and adjusting callbacks with
proper MediaSDK pair type support.

Extending structure for proper MediaSDK pair type support.

Signed-off-by: Artem Galin <artem.galin@intel.com>
2021-09-08 17:42:52 -03:00
Michael Niedermayer
2d36d2fbd7 avcodec/h264_parser: Fix nalsize check
Fixes: Assertion failure
Fixes: 37463/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-4914693494931456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-08 20:14:00 +02:00
Paul B Mahol
9e33572b3d avcodec/mlpenc: simplify some complicated expressions more 2021-09-07 18:16:13 +02:00
Paul B Mahol
1cbd4b00b1 avcodec/mlpenc: simplify strange pointer initializations 2021-09-07 18:16:13 +02:00
Paul B Mahol
5d92b73c64 avcodec/mlpdec: fix integer sanitizer warning under clang
Fixes:
libavcodec/mlpdec.c:1108:37: runtime error: negation of 1 cannot be represented in type 'unsigned int'
2021-09-07 18:16:13 +02:00
Peter Ross
c655a734b1 avcodec/siren: MSN Siren decoder
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2021-09-07 18:07:11 +10:00
Paul B Mahol
b9426f371a avcodec/mlpenc: remove convoluted incomplete multiple substreams support code
It is very hard to follow data structures indirections in current code,
so just remove it for now.
2021-09-07 00:18:33 +02:00
Paul B Mahol
e811b0080e avcodec/mlpenc: use variables local to for loops 2021-09-07 00:18:33 +02:00
Limin Wang
75001ae844 avcodec/nvenc: add constrainedFrame encoding support
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-09-06 14:25:26 +02:00
Limin Wang
3756525a59 avcodec/nvenc: add single slice intra refresh support
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-09-06 14:13:00 +02:00
Limin Wang
e6bd5171ac avcodec/nvenc: add intra refresh support
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-09-06 14:12:57 +02:00
Limin Wang
85489e0308 avcodec/nvenc: make number of slices per frame configurable
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-09-06 13:33:53 +02:00
Michael Niedermayer
3c659f8618 avcodec/jpeg2000dec: Check that atom header is within bytsetream
Fixes: Infinite loop
Fixes: 36666/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5912760671141888

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>
2021-09-05 22:22:27 +02:00
Michael Niedermayer
33feb527ff avcodec/apedec: Fix 2 integer overflows in filter_3800()
Fixes: signed integer overflow: 1683879955 - -466265224 cannot be represented in type 'int'
Fixes: 37419/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6074294407921664

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>
2021-09-05 22:22:27 +02:00
Michael Niedermayer
e58692837c avcodec/xpmdec: Move allocations down after more error checks
Fixes: Timeout
Fixes: 37035/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XPM_fuzzer-5142718576721920

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>
2021-09-05 22:22:05 +02:00
Michael Niedermayer
26659fe53e avcodec/argo: Move U, fix shift
Fixes: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 37249/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-5754862984888320

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>
2021-09-05 22:22:05 +02:00
Paul B Mahol
0c87b43c6c avcodec/mlp: move sync defines to common header 2021-09-05 18:12:56 +02:00
Paul B Mahol
3ea0171ea3 avcodec/mlpenc: remove frame_size array from private context
It is supposed to be used with different bit depth and/or sample rates
per each substream, but such currently not implemented feature is not
important and current state causes problems when implementing variable
restart interval to fix decoding with sample rates not multiple of 40.
2021-09-05 16:08:19 +02:00
Paul B Mahol
5852bb6b4b avcodec/mlpenc: stop using hardcoded value 2021-09-05 15:02:39 +02:00
Paul B Mahol
ac29cec312 avcodec/mlpenc: use av_shrink_packet() 2021-09-05 14:09:50 +02:00
Paul B Mahol
cfc491bf44 avcodec/mlpenc: remove no more needed goto 2021-09-05 14:09:50 +02:00
Paul B Mahol
4ca9877b91 avcodec/mlpenc: fix removal of packet timestamp/size from queue 2021-09-05 12:15:34 +02:00
Paul B Mahol
d8863013a8 avcodec/mlpenc: remove not needed buf_size checks 2021-09-05 11:44:50 +02:00
Paul B Mahol
85b9b96957 avcodec/mlpenc: fix indentation 2021-09-05 11:44:50 +02:00
Paul B Mahol
036d94da43 avcodec/mlpenc: stop returning packets with no data 2021-09-05 11:44:50 +02:00
Paul B Mahol
589cd58c85 avcodec/mlpenc: simplify compare_best_offset() 2021-09-05 00:28:40 +02:00
Paul B Mahol
5b28a5db03 avcodec/mlpenc: use ff_ctz() 2021-09-05 00:11:40 +02:00
Paul B Mahol
d18b445689 avcodec/mlpenc: remove unused item 2021-09-05 00:09:55 +02:00
Paul B Mahol
19b52a7cc4 avcodec/mlpenc: remove log messages when allocation fails at init 2021-09-04 14:46:40 +02:00
Paul B Mahol
30c213fa6c avcodec/mlpenc: allocate filter buffers once at init 2021-09-04 14:46:40 +02:00
Paul B Mahol
57988fc496 avcodec/mlpenc: simplify allocations in mlp_encode_init() 2021-09-04 14:46:40 +02:00
Andreas Rheinhardt
bc75fb5423 avcodec/omx: Reindentation
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-04 08:04:22 +02:00
Andreas Rheinhardt
5c0e2f839a avcodec/omx: Check initializing mutexes/conditions
The earlier code did not properly check these initializations:
It only recorded whether the part of init where these initializations
are has been reached, but it did not check whether the initializations
were successful, although destroying them would be undefined behaviour
if they had not been initialized successfully.
Furthermore cleanup() always locked a mutex regardless of whether there
was any attempt to initialize these mutexes at all.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-04 08:04:04 +02:00
Andreas Rheinhardt
16fc8cef74 avcodec/frame_thread_encoder: Mark init and free functions as av_cold
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-04 08:03:33 +02:00
Andreas Rheinhardt
5f6fcb0395 avcodec/frame_thread_encoder: Return proper error codes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-04 08:03:33 +02:00
Andreas Rheinhardt
f1847dbc1f avcodec/frame_thread_encoder: Don't shadow variables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-04 08:03:33 +02:00
Andreas Rheinhardt
2e574235b0 avcodec/frame_thread_encoder: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-04 08:03:33 +02:00
Andreas Rheinhardt
754b8454b7 avcodec/frame_thread_encoder: Check initializing mutexes/conditions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-04 08:03:33 +02:00
Andreas Rheinhardt
95b681eafd avcodec/vp9: Remove vp9_free_entries()
Now that the mutexes and conditions are only initialized and destroyed
once, said function only had one purpose: free the entries array.
Given that vp9_alloc_entries() already does this if the array is already
allocated it is unnecessary to call vp9_free_entries() anywhere except
when closing. And then one can just inline the one free into
vp9_decode_free().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-04 08:03:33 +02:00
Andreas Rheinhardt
b0ee627ef9 avcodec/vp9: Use av_freep() instead of av_free()
Otherwise the context would be in an inconsistent state
if vp9_alloc_entries() failed (and if this would be checked).

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-04 08:03:19 +02:00
Andreas Rheinhardt
84f716ccff avcodec/vp9: Don't free buffer known to be NULL
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-04 08:03:19 +02:00
Andreas Rheinhardt
0e09067261 avcodec/vp9: Check initializing conditions/mutexes
Also don't destroy uninitialized conditions/mutexes.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-04 08:03:19 +02:00
Andreas Rheinhardt
a4f7fabc26 avcodec/pthread_frame: Move (init|free)_pthread() to pthread.c
We have more mutexes/condition variables whose initialization is
unchecked.
Also use a proper namespace for these functions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-04 08:03:19 +02:00
Andreas Rheinhardt
bd95f2f599 avcodec/vp9: Do not destroy uninitialized mutexes/conditions
Also do not destroy and reinitialize mutexes and conditions when
certain input parameters change. Given that the decoder did not
create these variables at all during init, uninitialized mutexes
and conditions are destroyed before the very first initialization.
This is undefined behaviour and certain threading implementations
like pthreadGC2 crash when it is attempted.

Fix this by initializing these objects once during init and freeing
them in close.

Reported-by: Steve Lhomme <robux4@ycbcr.xyz>
Reviewed-by: Steve Lhomme <robux4@ycbcr.xyz>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-04 08:02:56 +02:00
Andreas Rheinhardt
0172deccc4 avcodec/h264_levels, h265_profile_level: Avoid relocations
H.264 and H.265 levels' names are usually of the form "x" or "x.y"
with x and y being single digits; the one exception are the H.264 1b
levels. All of those levels' names fit into a char[4] and it is likely
that this future levels will do so, too.

Therefore this commit changes the H26(4|5)LevelDescriptor structures
to use such a char [4] instead of a pointer to a const char. This makes
the structures smaller (when sizeof(char*) == 8) and avoids relocations,
thereby moving the corresponding arrays from .data.rel.ro into .rodata.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-04 07:56:40 +02:00
Paul B Mahol
a590dfc242 avcodec/interplayacm: fix draining and last frame number of samples 2021-09-04 00:01:10 +02:00
Paul B Mahol
584cd16ad0 avcodec/wmaprodec: unbreak old xma2 decoding 2021-09-03 20:09:28 +02:00
James Almer
e204846ec1 avcodec/libdav1d: fix compilation after recent libdav1d API changes
They were done in preparation for an upcoming 1.0 release.
Keep supporting previous releases for the time being.

Reviewed-by: BBB
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-03 15:01:35 -03:00
Paul B Mahol
c0be596fc1 avcodec/wmaprodec: improve flushing for >2 channels in XMA 2021-09-03 19:10:20 +02:00
Paul B Mahol
094397ce06 avcodec/wmaprodec: improve xma2 extradata parsing 2021-09-03 19:10:20 +02:00
Paul B Mahol
a3fd78db12 avcodec/pnm_parser: add support for PFM parsing 2021-09-03 19:10:20 +02:00
Paul B Mahol
646afae00f avcodec/wmaprodec: unbreak xma >2 channel decoding after last change 2021-09-03 00:51:10 +02:00
Michael Niedermayer
31f03120e8 avcodec/pictordec: Optimize more odd cases for picmemset()
Fixes: Timeout
Fixes: 36875/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PICTOR_fuzzer-4842960888922112

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Tested-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-02 19:28:53 +02:00
Andreas Rheinhardt
cbf111059d avcodec/avcodec: Allow up to seven codec ids per parser
ff_pnm_parser and ff_vp3_parser already hit the current limit;
an addition to the former (to handle pfm) is planned.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-02 19:02:35 +02:00
Paul B Mahol
2bb9d2be5e avcodec/mlpenc: add support for 24bit encoding 2021-09-02 18:02:22 +02:00
Paul B Mahol
61c2c9ef8e avcodec/wmaprodec: add gapless support 2021-09-02 18:00:43 +02:00
Jan Ekström
9b2281a4a3 avcodec/libx265: add support for setting chroma sample location
Unlike libx264, libx265 does not handle the chroma format check
on its own side, so in order to not write out values which are
supposed to be ignored according to the specification, we limit
the writing out of chroma sample location to 4:2:0 only.
2021-09-01 23:27:19 +03:00
Paul B Mahol
034133a0df avcodec/mlpdec: reset lossless crc checking when stream ends
Fixes invalid reports of bad lossless crc.
While here make end of stream message into debug level as it is
not really important to user.
Also wait for new major sync frame as invalid concating of files
may produce invalid files, which cause various errors.
2021-08-31 21:22:17 +02:00
Paul B Mahol
9f420163c6 avcodec/mlpenc: fix encoding last samples when not within full interval
Also implement shorten_by in bitstream.
2021-08-31 21:22:02 +02:00
Andreas Rheinhardt
9634e6b0b0 avcodec/tiff_common: Fix AVBPrint error checks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-30 15:48:11 +02:00
Jan Ekström
06ce821bc7 avcodec/libx265: only call av_pix_fmt_desc_get once in init
Now both current usages utilize an already found descriptor.
2021-08-29 21:09:21 +03:00
Jan Ekström
2f0113be3f avcodec/libx264: add support for setting chroma sample location 2021-08-29 15:05:37 +03:00
Paul B Mahol
5673a48425 avcodec/mlpdec: add flush support
Fixes spurious lossless check failures when seeking.
2021-08-29 00:09:29 +02:00
Michael Niedermayer
104a8399ae avcodec/mjpegbdec: Skip SOS on AVDISCARD_ALL as does mjpeg
Fixes: NULL pointer dereference
Fixes: 36342/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-4579188072906752
Fixes: 36344/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-5049579300061184
Fixes: 36345/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-5301149845553152
Fixes: 36374/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-6056312352931840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-08-28 20:03:54 +02:00
Michael Niedermayer
909faca929 avcodec/mjpegdec: Check for bits left in mjpeg_decode_scan_progressive_ac()
Fixes: Timeout
Fixes: 36262/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEGLS_fuzzer-4969052454912000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-08-28 20:03:21 +02:00
maryam ebrahimzadeh
2c0d522963 avcodec/wmaprodec: return value check for init_get_bits
Also replace init_get_bits with init_get_bits8().
2021-08-28 19:18:45 +02:00
Lynne
033105a739
h274: remove optimization pragma
This results in warnings on compilers which don't support it,
objections were raised during the review process about it but went unnoticed,
and the speed benefit is highly compiler and version specific, and
also not very critical.

We generally hand-write assembly to optimize loops like that, rather
than use compiler magic, and for 40% best case scenario, it's simply
not worth it.

Plus, tree vectorization is still problematic with GCC and disabled by default
for a good reason, so enabling it locally is sketchy.
2021-08-28 15:13:55 +02:00
maryam ebrahimzadeh
3e24e8108d avcodec/vc1dec: return value check for init_get_bits
As the second argument for init_get_bits(avctx and buf) can be crafted,
a return value check for this function call is necessary,
so replace init_get_bits with init_get_bits8 and add return value check.
2021-08-26 09:23:15 +02:00
Stéphane Cerveau
f9fbe2f9a9 avcodec/wmadec: handle run_level_decode error
Consider data as invalid if ff_wma_run_level_decode
gets out with an error.

It avoids an unpleasant sound distorsion.

See http://trac.ffmpeg.org/ticket/9358
2021-08-26 09:20:56 +02:00
Olivier Crête
521388edb7 avcodec/wma: Return specific error code
This way, the calling function can just forward it instead of
making it up.

Signed-off-by: Olivier Crête <olivier.crete@collabora.com>
2021-08-26 09:20:56 +02:00
maryam ebrahimzadeh
ad88cce3f8 avcodec/vp6: return value check for init_get_bits
As the second argument for init_get_bits(buf) can be crafted,
a return value check for this function call is necessary.
Also replace init_get_bits with init_get_bits8.

Signed-off-by: Peter Ross <pross@xvid.org>
2021-08-26 17:06:57 +10:00