Tim Walker
7840c40445
(e)ac3dec: set AV_FRAME_DATA_MATRIXENCODING side data.
11 years ago
Tim Walker
13345fc1f8
(e)ac3: parse and store the Dolby Surround, Surround EX and Headphone mode flags.
11 years ago
John Stebbins
c9ca220ef2
ac3dec: make drc_scale exponentially
...
The a52 spec suggests that "partial compression" should scale the
drc value in this manner.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Michael Niedermayer
4782c4284f
avcodec/ac3dec: check bap before use.
...
Fixes out of array read
Fixes assertion failure
Fixes asan_static-oob_16431c0_8036_rio_bravo_mono_64_spx.ac3
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Tim Walker
48b24bd2d2
ac3dec: Fix out-of-array read
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
11 years ago
Michael Niedermayer
2cbf27b08a
libavcodec/ac3dec: fix channel_layout
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Tim Walker
d4df02131b
ac3dec: Remove write-only channel_layout field from AC3DecodeContext
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
11 years ago
Tim Walker
b532854622
ac3: implement request_channel_layout.
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
11 years ago
Tim Walker
ffb0af7f17
ac3dec: simplify an expression
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
11 years ago
Michael Niedermayer
6c82c87dbb
ac3dec: fix outptr increment.
...
Fixes corrupt data errors when downmixing in the AC-3 decoder.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
CC:libav-stable@libav.org
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
Luca Barbato
b1f9cdc37f
ac3: Return proper error codes
11 years ago
Luca Barbato
818d1f1a3e
ac3: Clean up the error paths
11 years ago
Christophe Gisquet
b6293e2798
fmtconvert: Explicitly use int32_t instead of int
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Martin Storsjö
8f24c12be7
ac3dec: Don't consume more data than the actual input packet size
...
This was handled properly in the normal return case at the end
of the function, but not in this special case.
Returning a value larger than the input packet size can cause
problems for certain library users.
Returning the actual input buffer size unconditionally, since
it is not guaranteed that frame_size is set to a sensible
value at this point.
Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Martin Storsjö
031be5b41b
ac3dec: Consistently use AC3_BLOCK_SIZE and sizeof
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Martin Storsjö
68e57cde68
ac3dec: Increment channel pointers only once per channel
...
If the channel mapping map multiple output channels to one
input channel, we should only increment the actual pointer once.
Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Christophe Gisquet
f49564c607
fmtconvert: int32_t input to int32_to_float_fmul_scalar
...
It was previously declared as int.
Does not change fate results for x86.
Conflicts:
libavcodec/ppc/fmtconvert_altivec.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
12e25ed284
avcodec: av_log_missing_feature(1) ---> avpriv_request_sample()
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
Michael Niedermayer
e0f716a9d9
ac3dec: use AVFrame accessor functions
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Justin Ruggles
d7c450436f
ac3dec: validate channel output mode against channel count
...
Damaged frames can lead to a mismatch, which can cause a segfault
due to using an incorrect channel mapping.
CC:libav-stable@libav.org
12 years ago
Justin Ruggles
55d2e12aef
ac3: decode directly to the user-provided AVFrame
12 years ago
Michael Niedermayer
fbdb0313f5
ac3dec: fix non-optimal dithering of zero bit mantissas
...
Use a noise range of -0.707 to 0.707 instead of -0.5 to 0.5
Based on patch by: Mathias Rauen <madshi@gmail.com> and commit by Justin Ruggles (04ea5491
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Mathias Rauen
04ea5491a8
ac3dec: fix non-optimal dithering of zero bit mantissas
...
Use a noise range of -0.707 to 0.707 instead of -0.5 to 0.5
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
12 years ago
Justin Ruggles
e034cc6c60
lavc: Move vector_fmul_window to AVFloatDSPContext
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Michael Niedermayer
b888cea9cb
ac3dec: split out pointer update loop for saftey
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
511cf612ac
miscellaneous typo fixes
12 years ago
Michael Niedermayer
d28dfa2d42
ac3dec: fix outptr increment.
...
Fixes decoding regression
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
2fb240ddb6
ac3dec: fix out of array read
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
7aabeea9ba
ac3dec: fix bugs in direct buffer use.
...
This fixes potentially exploitable out of array writes.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Mans Rullgard
30b3916425
ac3dec: make downmix() take array of pointers to channel data
12 years ago
Mans Rullgard
b8f3ab8e6a
ac3dec: output planar float only
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Mans Rullgard
ec5da7aee2
ac3dec: decode directly into output buffers
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
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
Diego Biurrun
717addecad
Use proper return values in case of missing features
12 years ago
Justin Ruggles
56b6a43056
ac3dec: ensure get_buffer() gets a buffer for the correct number of channels
...
If there is an error during frame parsing, but AVCodecContext.channels was
changed and AC3DecodeContext.out_channels was set previously, the two may not
match.
Fixes CVE-2012-2802
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
12 years ago
Mans Rullgard
97cb9236cf
ac3: move ac3_downmix() from dsputil to ac3dsp
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Martin Storsjö
c7b610aa0b
avopt: Explicitly store float/double option defaults in .dbl
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago
Marton Balint
b99e9ee938
ac3dec: set decode_error_flags field in ac3 codec
...
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
2c22701c37
ac3dec: Check number of output channels.
...
Fixes out of array write.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Diego Biurrun
a92be9b856
Replace memset(0) by zero initializations.
...
Also remove one pointless zero initialization in rangecoder.c.
13 years ago
Justin Ruggles
3798205a77
mov: set channel layout for AC-3 streams based on the 'dac3' atom info
...
fixes Bug 225
13 years ago
Martin Storsjö
9cf0841ef3
dsputil: Add ff_ prefix to the dsputil*_init* functions
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Michael Niedermayer
e6d9fa66f1
ac3dec: Move center and surround mix level tables to the parser.
...
That way all mix levels as exported by avpriv_ac3_parse_header()
will have the same meaning.
Previously the 3-bit center mix level for E-AC-3 was used to index in a
4-entry table, leading to out-of-array reads.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: Alex Converse <alex.converse@gmail.com>
13 years ago
Anton Khirnov
f326501a65
lavc: remove disabled FF_API_DRC_SCALE cruft.
13 years ago
Michael Niedermayer
99a42f3fa9
ac3dec: Move center&surround mix level tables to parser.
...
That way all mix levels as exported by the parser
will have the same meaning.
Previously the 3bit center mix level for eac3 was
used to index in a 4 entry table leading to out of array reads.
this change removes the table and offsets the ac3 variable by 4
so it matches the meanings for eac3 except the reserved case.
The reserved case is then explicitly handled.
Idea-by: Justin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago