Michael Niedermayer
0a65dae9d0
avcodec/flacdec: reduce limit for golomb so that the max value does not overflow
...
Fixes: runtime error: left shift of 32 by 26 places cannot be represented in type 'int'
Fixes: 628/clusterfuzz-testcase-6187747641393152
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
3e1028c625
avcodec/flac: Fix several integer overflows
...
Fixes: 686513-media
Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
fd00203554
avcodec/flacdec: Check for invalid vlcs
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
1f5630af51
avcodec/flacdec: Fix undefined shift in decode_subframe()
...
Fixes undefined behavior
Fixes: 639961-media
Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
6567c59c49
avcodec/flac: forward errors from ff_flac_parse_streaminfo()
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
83a75bf6c3
avcodec/flacdec: Fix signed integer overflow in decode_subframe_fixed()
...
Fixes undefined behavior
Fixes: 640912-media
Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Clément Bœsch
fb99ef0bd3
avcodec: use AV_OPT_TYPE_BOOL in a bunch of places
9 years ago
Ganesh Ajjanagadde
2cbaa078d1
avcodec: use HAVE_THREADS header guards to silence -Wunused-function
...
When compiled with --disable-pthreads, e.g
http://fate.ffmpeg.org/report.cgi?time=20150917015044&slot=alpha-debian-qemu-gcc-4.7 ,
a bunch of -Wunused-functions are reported due to missing header guards
around threading related functions.
This patch should silence such warnings.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
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>
10 years ago
Michael Niedermayer
b6fcb2bb6d
avcodec/flacdec: Attempt to auto-detect old buggy flac
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Carl Eugen Hoyos
e609cfd697
lavc/flac: Fix encoding and decoding with high lpc.
...
Based on an analysis by trac user lvqcl.
Fixes ticket #4421 , reported by Chase Walker.
10 years ago
Carl Eugen Hoyos
38f5a266ee
lavc/flacdec: Sanitize FLACSTREAMINFO usage.
10 years ago
Michael Niedermayer
5f30522894
avcodec/flacdec: fix off by 1 error
...
Fixes assertion failure
Fixes: signal_sigsegv_324b284_1980_dilvie___the_dragonfly.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
e5c01ccdf5
avcodec/flacdec: Call ff_flacdsp_init() unconditionally
...
Fixes out of array access
Fixes: signal_sigsegv_324b135_3398_cov_246853371_short.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
James Almer
3cec54b7d7
x86/flacdsp: add SSE2 and AVX decorrelate functions
...
Two to four times faster depending on instruction set, block size and channel count.
10 years ago
Anton Khirnov
acc897e6b1
lavc: make avpriv_flac_is_extradata_valid() private on the next bump
10 years ago
Anton Khirnov
c070a87515
lavc: make avpriv_flac_parse_streaminfo() private on the next bump
10 years ago
Tristan Matthews
7703995a2e
flac: Remove unused headers
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
10 years ago
Michael Niedermayer
6fac482624
avcodec/flacdec: fix handling of av_samples_fill_arrays() return value
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
5fdaf312c5
flac: make avpriv_flac_parse_block_header() inline
...
This avoids all the ABI troubles associated with avpriv_.
Since this function is very small and does not depend on any tables,
making it inline should have no adverse effects.
11 years ago
Michael Niedermayer
e9ad121ba5
Fix skiping typos
...
Found-by: Alessandro Ghedini <alessandro@ghedini.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
8ca9a68f19
avcodec/flacdec: check rice_order against blocksize
...
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f6e13c220d0_8489_short.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
4b12930f79
avcodec/flacdec: use get_unary() simplify code
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
9f5b75f241
avcodec/flacdec: make while get_bits loop more robust by checking bits left
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
3b56f665b1
avcodec/flacdec: also do crc check when er compliant is set
...
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
Luca Barbato
0e78ef0f94
flac: use meaningful return values
12 years ago
Paul B Mahol
ff0bdf9375
lavc: copy AVCodecContext for threads
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Michael Niedermayer
c112e36d41
flacdec: Fix used AVCodecContext
...
Fixes out of array writes with multiple threads
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Paul B Mahol
61d900fd0d
lavc: add ONLY_IF_THREADS_ENABLED where it is missing
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
a28f4fd1ea
flacdec: don't call allocate_buffers() in init_thread_copy() when s->max_blocksize is 0
...
This is normal, and happens when no extradata was available at decoder
initialization.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
9300de0409
flacdec: frame multi-threading support
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
b4d4ef5529
flacdec: use init_get_bits8()
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Luca Barbato
39cc4c61de
flacdec: drop unnecessary assert
...
The condition cannot happen anymore.
12 years ago
James Almer
45013b365e
lavc/flacdec: Propagate and return meaningful error codes
...
Signed-off-by: James Almer <jamrial@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
63d744e2be
av_log_missing_feature() ---> avpriv_report_missing_feature()
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
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
12 years ago
James Almer
1d5b35cc07
lavc/flacdec: Add frame CRC calculation
...
Fixes ticket #2266
Signed-off-by: James Almer <jamrial@gmail.com>
12 years ago
Justin Ruggles
b8e9c99ef1
flac: decode directly to the user-provided AVFrame
12 years ago
Tim Walker
08797c599d
flac: don't check the number of channels before setting the channel layout
...
This is unnecessary, as ff_flac_set_channel_layout can handle any number of channels.
12 years ago
Tim Walker
41244e13d5
flac: don't check the number of channels before setting the channel layout.
...
This is unnecessary, as ff_flac_set_channel_layout can handle any number of channels.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
12 years ago
Michael Niedermayer
fc0d069feb
flacdec: silence several "warning: X may be used uninitialized in this function"
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
0e9b9a6748
flacdec: skip in stream header packets
...
This prevents warning messages on chained oggs with some demuxers
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Justin Ruggles
aef5150719
flac: only set channel layout if not previously set or on channel count change
...
Fixes Bug 402
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
Justin Ruggles
a903f8f087
Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
...
Also reorder some other #include when applicable.
12 years ago
Justin Ruggles
99d8686357
flacdec: do not warn on sample rate change
12 years ago
Justin Ruggles
90fcac0e95
flacdec: allow mid-stream channel layout change
...
Although the libFLAC decoder cannot handle such a change, it is allowed by the
spec and could potentially occur with live streams.
12 years ago
Justin Ruggles
268f8ba112
flacdec: use av_samples_* functions for sample buffer allocation
...
Also, return an error on allocation failure.
12 years ago