Andreas Rheinhardt
8b395a5123
avcodec/mss1: Mark decoder as init-threadsafe
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years ago
Andreas Rheinhardt
a247ac640d
avcodec: Constify AVCodecs
...
Given that the AVCodec.next pointer has now been removed, most of the
AVCodecs are not modified at all any more and can therefore be made
const (as this patch does); the only exceptions are the very few codecs
for external libraries that have a init_static_data callback.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@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
43015afd7c
avcodec/mss1: check for overread and forward errors
...
Fixes: Timeout (106sec -> 14ms)
Fixes: 15576/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSS1_fuzzer-5688080461201408
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>
5 years ago
Diego Biurrun
1c5f264787
mss1: Add missing macro parameters to ARITH_GET_* macros
...
It is wrong to pass no arguments to a macro that expects one argument
and some compilers complain.
7 years ago
Vittorio Giovara
def97856de
lavc: AV-prefix all codec capabilities
...
Express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
Lukasz Marek
331fae80a1
lavc/mss1: fix mem leak in case of init failure
...
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
10 years ago
Reimar Döffinger
cbeaf67888
Avoid using empty macro arguments.
...
These are not supported by all compilers (gcc 2.95 but also older SPARC
compilers, see gcc bug #33304 for example), and there is no real need for them.
One use of this feature remains in libavdevice/v4l2.c which can't be
replaced quite as easily.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
11 years ago
Anton Khirnov
acaffdca21
mss1: use the AVFrame API properly.
11 years ago
Paul B Mahol
b79f543c58
avcodec/mss1: use init_get_bits8()
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 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
Michael Niedermayer
64d11cb615
mss1: set frame defaults
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
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
Michael Niedermayer
b12d92efd6
avoid "0xFF << 24" as it is considered a integer overflow in C99
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
716d413c13
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
12 years ago
Alberto Delmás
626c1a33ed
mss12: reduce SliceContext size from 1067 to 164 KB
...
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
13 years ago
Alberto Delmás
a97ee41bee
mss12: move SliceContexts out of the common context into the codec contexts
...
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
13 years ago
Alberto Delmás
ede3d6400d
MSS1 and MSS2: set final pixel format after common stuff has been initialised
...
This way it won't interfere with WMV9 initialisation inside MSS2 decoder and
avplay will play it fine.
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
13 years ago
Alberto Delmás
ee769c6a7c
MSS2 decoder
...
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
13 years ago
Kostya Shishkov
0de4a563e4
mss1: move code that will be reused by MSS2 decoder into separate file
13 years ago
Kostya Shishkov
49df339f4b
mss1: merge decode_intra() and decode_inter()
...
They have most of their code in common.
13 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
13 years ago
Paul B Mahol
6ad4560031
mss1: improve check if decoded pivot is invalid
...
The pivot has to lie between 0 and base.
Check of ==base is insufficient.
Thus replace it by a proper check.
Fixes out of array write.
Fixes bug #1531 .
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Kostya Shishkov
ed219ed366
mss1: fix decoding masked regions in interframes
...
Spotted by Alberto Delmás
13 years ago
Kostya Shishkov
15358ade15
mss1: validate number of changeable palette entries
13 years ago
Kostya Shishkov
8f5d573a83
mss1: report palette changed when some additional colours were decoded
13 years ago
Carl Eugen Hoyos
c77bcbbb32
Signal MSS1 palette change.
...
Reviewed-by: Paul B Mahol
13 years ago
Paul B Mahol
e3c2670539
mss1: check number of free colours
...
Prevents out of array write.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Carl Eugen Hoyos
bec21ce7f4
Make MSS1 palette opaque.
13 years ago
Kostya Shishkov
005c80b645
MS Screen 1 decoder
13 years ago