Andreas Rheinhardt
d2308b9237
avcodec/bink: Only keep what is used from HpelDSPContext
...
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years ago
Andreas Rheinhardt
ceeba2ac2b
avcodec/bink: Combine allocations of arrays into one
...
Saves allocations, checks for the allocations as well as frees.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years ago
Andreas Rheinhardt
4f67288948
avcodec/bink: Fix memleak upon init failure
...
The init function first allocates an AVFrame and then some buffers; if
one of the buffers couldn't be allocated, the AVFrame leaks. Solve this
by setting the FF_CODEC_CAP_INIT_CLEANUP flag.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years ago
James Almer
9ea6d2149e
avcodec/decode: add a flags parameter to ff_reget_buffer()
...
Some decoders may not need a writable buffer in some specific cases, but only
a reference to the existing buffer with updated frame properties instead, for
the purpose of returning duplicate frames. For this, the
FF_REGET_BUFFER_FLAG_READONLY flag is added, which will prevent potential
allocations and buffer copies when they are not needed.
Signed-off-by: James Almer <jamrial@gmail.com>
5 years ago
Michael Niedermayer
005de57d84
avcodec/bink: Add many end of input checks
...
Fixes: Timeout (83sec -> 15sec)
Fixes: 15595/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINK_fuzzer-5689153263501312
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Michael Niedermayer
62ad08cef9
avcodec/bink: Fix integer overflow in unquantize_dct_coeffs()
...
Fixes: signed integer overflow: -3447 * 2883584 cannot be represented in type 'int'
Fixes: 15265/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINK_fuzzer-5088311799971840
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>
5 years ago
Michael Niedermayer
2603f25d32
avcodec/bink: Reorder operations in init to avoid memleak on error
...
Fixes: Direct leak of 536 byte(s) in 1 object(s)
Fixes: 15266/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINK_fuzzer-5629530426834944
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>
6 years ago
Jun Zhao
3af73f2c85
lavc/bink: Remove the dead code block
...
Remove the dead code block
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
6 years ago
Michael Niedermayer
b89fc3d01b
avcodec/bink: Provide non NULL context to av_log()
...
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years ago
Paul B Mahol
3237f018fd
avcodec/bink: set color range
6 years ago
Paul B Mahol
1b0922584e
avcodec/bink: add 'k' version support
6 years ago
Martin Vignali
cbbec68847
libavcodec/blockdsp : add AVX version
...
Also modify the required alignment, to 32 instead of 16
for several codecs
Signed-off-by: James Almer <jamrial@gmail.com>
7 years ago
Diego Biurrun
fd92dafaff
bink: Split read_dct_coeffs()
...
This works around type aliasing violations and related warnings.
Also add some missing error checking.
7 years ago
Luca Barbato
73fc82f343
vlc: Add header #include when the types are used
...
Do not rely on indirectly including it from bitstream.h.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
8 years ago
Diego Biurrun
dcc39ee10e
lavc: Remove deprecated XvMC support hacks
...
Deprecated in 11/2013.
8 years ago
Alexandra Hájková
9a23b59943
bink: Convert to the new bitstream reader
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years ago
Diego Biurrun
b668662939
get_bits: Move BITSTREAM_READER_LE definition before all relevant #includes
...
This avoids the danger that get_bits.h might get indirectly #included before
BITSTREAM_READER_LE is defined.
Also sort headers into canonical order where appropriate.
9 years ago
Vittorio Giovara
41ed7ab45f
cosmetics: Fix spelling mistakes
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
9 years ago
Vittorio Giovara
def97856de
lavc: AV-prefix all codec capabilities
...
Express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Luca Barbato
7f596368a4
bink: Factorize bink put_pixel
...
And make sure to check INTER_BLOCK as had been fixed by Michael
Niedermayer.
Reported-By: Andreas Cadhalpun
CC: libav-stable@libav.org
10 years ago
Diego Biurrun
e74433a8e6
dsputil: Split clear_block*/fill_block* off into a separate context
11 years ago
Diego Biurrun
b88cc5cca1
bink: Rename BinkDSPContext member so as not to clash with BlockDSPContext
11 years ago
Diego Biurrun
cb52a17cb6
dsputil: Move Bink-specific add_pixels8 to binkdsp
11 years ago
Michael Niedermayer
e838c9852e
avcodec/bink: use av_mallocz for data
...
Fixes use of uninitialized memory
Fixes msan_uninit-mem_7fe8a5fd759d_2838_SPECTRE.BIK
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
cb52d6da0a
avcodec/bink: fix seeking to frame 0
...
Fixes Ticket3088
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Michael Niedermayer
c77c5f6c9f
libavcodec/bink.c: Fix duplicate words
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Luca Barbato
9991298f2c
bink: Bound check the quantization matrix.
...
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years ago
Diego Biurrun
6fee1b90ce
avcodec: Add av_cold attributes to init functions missing them
12 years ago
Ronald S. Bultje
0f0a11d576
bink: Use hpeldsp instead of dsputil for half-pel functions
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Clément Bœsch
1ec94b0f06
lavc: factorize ff_{thread_,re,}get_buffer error messages.
...
Coccinelle profile used:
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_get_buffer(ctx, f, flags)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str;
@@
-if ((r = ff_reget_buffer(ctx, f)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_reget_buffer(ctx, f)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0)
+ return r;
...along with some manual patches for the remaining ones.
12 years ago
Ronald S. Bultje
af1e3dfb9e
bink: use hpeldsp instead of dsputil for half-pel functions.
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
12 years ago
Diego Biurrun
218aefce44
dsputil: Move LOCAL_ALIGNED macros to libavutil
12 years ago
James Almer
8ab2173ed1
lavc/bink: Chech for malloc failure
...
Signed-off-by: James Almer <jamrial@gmail.com>
12 years ago
Anton Khirnov
f2960097e4
bink: fix a check for the first frame.
...
Packet pts is a very unreliable indicator, use
AVCodecContext.frame_number instead.
12 years ago
Diego Biurrun
88bd7fdc82
Drop DCTELEM typedef
...
It does not help as an abstraction and adds dsputil dependencies.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
12 years ago
Ronald S. Bultje
93af2734ee
lavc: put FF_IDCT_{VP3,H264,CAVS,BINK,EA,WMV2} under FF_API_IDCT.
...
This allows us to get rid of them on the next major bump. All of the
above are functionally irrelevant, and most of them are unused, except
the vp3 one, which is used wrongly in the bfin arch optimizations.
12 years ago
Anton Khirnov
6a97ea65b6
bink: operate with pointers to AVFrames instead of whole structs.
...
This is more correct and avoids breaking extended_data.
12 years ago
Anton Khirnov
86d4e75422
bink: return meaningful error codes.
12 years ago
Anton Khirnov
df9b956751
lavc: fix decode_frame() third parameter semantics for video decoders
...
It's got_frame, not data size
12 years ago
Anton Khirnov
594d4d5df3
lavc: add a wrapper for AVCodecContext.get_buffer().
...
It will be useful in the upcoming transition to refcounted AVFrames.
12 years ago
Michael Niedermayer
0efcf16a3e
replace av_log(0, by av_log(NULL,
...
The first parameter is a pointer and NULL is more correct
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
e70144cba1
bink: check quant_index, fix out of array read
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
f174fbac3c
lavc: add CODEC_CAP_DR1 to all video decoders missing them
12 years ago
Anton Khirnov
716d413c13
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
12 years ago
Michael Niedermayer
acfe69669c
bink: reindent
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
897d336984
bink: remove unneeded special case in the init code.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
574e87943e
bink: get rid of double precision float use
...
Add a small table of integers instead as this is simpler and
avoid rounding issues (though such rounding issues are unlikely in this case)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago