| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
Don't rely on invalid codes leading to get_vlc2() returning
-1, which then gets converted to an uint8_t, i.e. to 255
and runs afoul of a length check later. After all, get_vlc2()
could be changed to return something else which may
be valid when cast to uint8_t.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
It is better when BUF_BITS == 64 (i.e. on x64), because
the underlying put_bits can then handle 0..63 bits naturally.
It does not worsen the code when BUF_BITS != 64, because
the compiler can optimize this to the same code as now
(due to the assert).
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
| |
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Given that these trees have only nine elements and are complete,
their depth is <= eight.
Also remove the now unused FF_HUFFMAN_BITS constant.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
The VLC trees used here have very few different codes
and are therefore guaranteed to not be very deep: The AC/DC
VLCs have 12 elements and therefore a depth <= 11 whereas
the run VLCs have only nine elements and therefore a depth <= 8.
This allows to reduce the worst-case number of reloads for
reading a VLC code.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
| |
There are only 2*3*4 VLC trees for decoding Huffman encoded
AC coefficients; see section 13.3.2 of the spec.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
| |
Avoids having to create the codes ourselves.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
| |
This will bring these bugs to our attention.
Reviewed-by: Kacper Michajlow <[email protected]>
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Return AVERROR_DECODER_NOT_FOUND.
(This can be triggered because this decoder tries to be
generic and work with multiple underlying AAC decoders,
so that there is no configure dependency for any decoder.)
Reviewed-by: Kacper Michajlow <[email protected]>
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is simpler and allows to fuzz them -- up until now,
the linker did not see the dependency and fuzzing them
returned AVERROR_BUG during init.
It took just a few seconds here to run into an assert
due to a return value of AVERROR(EAGAIN) in the decode
callback...
Reviewed-by: Kacper Michajlow <[email protected]>
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ff_mjpeg_decoder is now referenced directly by the relevant
decoders, so that the linker sees the dependency and
just does the desired thing. So remove the hack.
(Btw: The preprocessor does not do string comparisons, instead
undefined tokens in #if checks evaluate to 0, making the check
true regardless of the actual codec fuzzed (and leading to
linker errors if the mjpeg decoder is disabled).)
Reviewed-by: Kacper Michajlow <[email protected]>
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is simpler than calling avcodec_find_decoder().
Notice that av_codec_init_static() has already been called
by the time we reach these decoders' init functions,
so it is not necessary to call avcodec_find_decoder()
for it (which doesn't do anything for the mjpeg decoder
anyway).
Reviewed-by: Kacper Michajlow <[email protected]>
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
| |
Otherwise it will not be taken into account or applied at all.
Signed-off-by: James Almer <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
According to RFC 6416 the audio stream sender can pass the data rate
for the audio bitstream as "bitrate=" media format parameter.
Signed-off-by: Marvin Scholz <[email protected]>
|
| |
|
| |
|
|
|
|
|
| |
There is no need to explicitly specify the buffer, as it
is only ever passed to fprintf, so av_err2str can be used.
|
|
|
|
|
| |
There is no need to explicitly specify the buffer, as it
is only ever passed to fprintf, so av_err2str can be used.
|
|
|
|
|
| |
There is no need to explicitly specify the buffer, as it
is only ever passed to fprintf, so av_err2str can be used.
|
|
|
|
|
| |
There is no need to explicitly specify the buffer, as it
is only ever passed to printf, so av_err2str can be used.
|
|
|
|
|
| |
There is no need to explicitly specify the buffer, as it
is only ever passed to av_log, so av_err2str can be used.
|
|
|
|
|
| |
There is no need to explicitly specify the buffer, as it
is only ever passed to av_log, so av_err2str can be used.
|
|
|
|
|
| |
There is no need to explicitly specify the buffer, as it
is only ever passed to av_log, so av_err2str can be used.
|
|
|
|
|
|
|
| |
We already use this feature for setting the subgroup size,
but this feature was not enabled.
Fixes a validation warning.
|
|
|
|
|
|
| |
This allows for it to be shared.
Technically, implementations should not give drivers structs
that the drivers are not familiar with.
|
|
|
|
|
|
| |
Just correctness. We don't exceed this on any known hardware, but
its better to check.
If we do, we simply fall back to regular descriptors.
|
|
|
|
|
| |
Allows for it to be reused. In particular, for a future patch to make
vulkan hwaccels output DMABUF-backed VkImages.
|
|
|
|
|
| |
Suggested-by: Nicolas George <[email protected]>
Signed-off-by: James Almer <[email protected]>
|
|
|
|
|
|
| |
Make sure we are reading 16 bytes for the MD5
Signed-off-by: James Almer <[email protected]>
|
|
|
|
| |
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Right now it is possible for the pointer for the current frame to
be set in the context even when it could not be properly set up;
this does not influence the ordinary ref frames, but only
VP8Context.prev_frame. And since this code has been ported to the
ProgressFrame API in d48d7bc434f30dfbdf346f16715e4f2044b3e000,
this leads to segfaults, because the ProgressFrame API is less
forgiving than the ThreadFrame API (waiting on an uninitialized
ProgressFrame segfaults, waiting on an uninitialized ThreadFrame
is a no-op (the code behaves as if frame-threading is not in use)).
Fix this by maintaining the consistency of the frame pointers
in the context (by setting them later).
Fixes: NULL pointer dereference
Fixes: 68192/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP8_fuzzer-6180311026171904
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
| |
Signed-off-by: softworkz <[email protected]>
|
|
|
|
| |
Signed-off-by: softworkz <[email protected]>
|
|
|
|
|
|
|
| |
Avoids a potential overflow when multiplying nb_colors by 6.
Also make the nb_colors check a bit more strict.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
|
| |
It is written as region_id which is a single byte.
Also fixes a potential (defined) overflow in the num_rects * 6
multiplication later; this has been found by 김승호 <[email protected]>.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
| |
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
| |
AVERROR(ENOMEM) is enough.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
| |
We have already calculated the size of the packet
and therefore don't need to rely on these implicit checks.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
|
|
| |
This can be easily done because we have a count of the number of
values and the length of the associated codes. This allows
to switch to ff_get_encode_buffer() and thereby avoids an implicit
intermediate buffer.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
| |
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
| |
Do it before writing the actual slice to be able to use
a single AV_WN32().
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
|
| |
Given that we can calculate the size of each slice in advance,
we can determine the position in the output packet where it
needs to be put and can therefore avoid the intermediate buffer.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
| |
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
| |
Avoids rederiving it every time.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
| |
Namely the number of counts.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
|
| |
The earlier code only used the counts from the last slice.
The two FATE tests using slices show compression improvements
due to this.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
|
| |
Every frame contains an array of uint8_t with values
0..(s->planes * s->nb_slices - 1), so this needs to fit
into an uint8_t.
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
| |
Signed-off-by: Andreas Rheinhardt <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Do not derive it via av_cpu_count() in case AVCodecContext.slices
is unset. Instead default to AVCodecContext.thread_num instead
(which is one in case frame-threading is used and gives the actual
number of slice threads for slice threading).
Signed-off-by: Andreas Rheinhardt <[email protected]>
|