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
Michael Niedermayer
c265763318
avcodec/alsdec: Check for overread
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Andreas Cadhalpun
60f1cc4a1f
alsdec: only adapt order for positive max_order
...
For max_order = 0 the clipping range is invalid. (amin = 2, amax = 1)
CC: libav-stable@libav.org
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
10 years ago
Andreas Cadhalpun
94bb1ce882
alsdec: check sample pointer range in revert_channel_correlation
...
Also change the type of begin, end and smp to ptrdiff_t to make the
comparison well-defined.
CC: libav-stable@libav.org
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
10 years ago
Andreas Cadhalpun
e191aaca44
alsdec: limit avctx->bits_per_raw_sample to 32
...
avctx->bits_per_raw_sample is used in get_sbits_long, which only
supports up to 32 bits.
CC: libav-stable@libav.org
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
10 years ago
Andreas Cadhalpun
58d605ee9b
alsdec: only adapt order for positive max_order
...
For max_order = 0 the clipping range is invalid. (amin = 2, amax = 1)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Andreas Cadhalpun
afc7748d1f
alsdec: check sample pointer range in revert_channel_correlation
...
Also change the type of begin, end and smp to ptrdiff_t to make the
comparison well-defined.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
6a85dfc830
lavc: Replace av_dlog and tprintf with internal macros
10 years ago
Andreas Cadhalpun
faf9fe2c22
alsdec: validate time diff index
...
If begin is smaller than t, the subtraction 'begin -= t' wraps around,
because begin is unsigned. The same applies for end < t.
This causes segmentation faults.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Andreas Cadhalpun
4c2b88678b
alsdec: limit avctx->bits_per_raw_sample to 32
...
avctx->bits_per_raw_sample is used in get_sbits_long, which only
supports up to 32 bits.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
7e104647a3
avcodec/alsdec: Use av_mallocz_array() for chan_data to ensure the arrays never contain random data
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Andreas Cadhalpun
ef16501aeb
alsdec: ensure channel reordering is reversible
...
If the same idx is used for more than one i, at least one entry in
sconf->chan_pos remains uninitialized.
This can cause segmentation faults.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Paul B Mahol
c2fc466351
avcodec/alsdec: use av_malloc(z)_array()
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
10 years ago
Diego Biurrun
7f9f771eac
avcodec: Don't anonymously typedef structs
10 years ago
Paul B Mahol
dccd648f9f
avcodec/alsdec: use init_get_bits8()
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
10 years ago
Diego Biurrun
c67b449beb
dsputil: Split bswap*_buf() off into a separate context
11 years ago
Michael Niedermayer
6e6bd5481c
avcodec/alsdec: Clear MPEG4AudioConfig so that no use of uninitialized memory is possible
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
cc8163e1a3
avcodec: more correct printf specifiers
11 years ago
Michael Niedermayer
18f94df8af
avcodec/alsdec: check predictor order against block length
...
Fixes out of array access
Fixes: abd3c041acbcb816be113455d138166b-asan_heap-oob_b11634_3707_cov_1707137151_als_05_2ch48k16b.mp4
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
5c74fa6ce0
avcodec/alsdec: skip cases where the master channel equals the current channel
...
Fixes: msan_uninit-mem_7f6c73c97cf9_3571_als_04_2ch48k16b.mp4
Fixes use of uninitialized memory
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Reinhard Tartler
2a0fb7286d
alsdec: check block length
...
Fix writing over the end
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Addresses: CVE-2013-0845
11 years ago
Anton Khirnov
23a211cbba
lavc: change all decoders to behave consistently with AV_EF_CRCCHECK.
...
Just crccheck prints a warning, crccheck+explode returns an error.
Also document this behavior.
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Thilo Borgmann
6a64b23d93
Update my email address.
11 years ago
Michael Niedermayer
800637709c
alsdec: minor simplification in read_block()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Luca Barbato
ca488ad480
alsdec: Clean up error paths
...
Fix at least a memory leak.
CC: libav-stable@libav.org
11 years ago
Luca Barbato
70ecc175c7
alsdec: Fix the clipping range
...
mcc_weightings is only 32 elements.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years ago
Diego Biurrun
2832ea26f3
Remove commented-out debug #define cruft
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
Justin Ruggles
9b0b355e97
als: decode directly to the user-provided AVFrame
12 years ago
Michael Niedermayer
4484c722f6
alsdec/read_specific_config: check for init_get_bits failure
...
This also fixes a potential integer overflow
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Thilo Borgmann <thilo.borgmann@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Thilo Borgmann
bfde6e5c02
alsdec: Introduce failsafe switch to keep ALSSpecificConfig consistent to the input.
...
Reveiwed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Thilo Borgmann
95f81159de
alsdec: Consistently use a period at the end of error messages.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Paul B Mahol
d4211c4722
alsdec: change channel sorting so it match reference implementation
...
Read channel source instead of channel target for channel sorting.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
d885cc41e5
Fix "knwon" typo and add a check in tools/patcheck
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
98fed176cf
alsdec: improve warning message when invalid channel position is found
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
fb3f28ee28
alsdec: cosmetics after previous commit
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
ae27b70b9d
alsdec: channel sorting
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Michael Niedermayer
1818a1130d
alsdec: propagate error codes in read_block()
...
Reviewed-by: Thilo Borgmann <thilo.borgmann@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
0213d5ad86
alsdec: make return checking for read_*_block_data() consistent
...
Reviewed-by: Thilo Borgmann <thilo.borgmann@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
79bfba14b7
alsdec: Use AVERROR_INVALIDDATA in read_const_block_data
...
Reviewed-by: Thilo Borgmann <thilo.borgmann@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
0ceca269b6
alsdec: check block length
...
Fix writing over the end
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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
Thilo Borgmann
feaff427c0
alsdec: fix clipping of weightings for MCC decoding
...
Fixes CID717905
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
717addecad
Use proper return values in case of missing features
12 years ago
Clément Bœsch
ee0f53e966
alsdec: fix misplaced parentheses.
...
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
12 years ago
Thilo Borgmann
ac3f5a6879
alsdec: check return values.
...
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
12 years ago
Thilo Borgmann
66197988b1
alsdec: fix number of decoded samples in first sub-block in BGMC mode.
...
Fixes CVE-2012-2790
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
12 years ago