Luca Barbato
714508bcb9
vorbisdec: ensure FASTDIV denominator is never 1
...
In both usages of FASTDIV the denominator might be 1.
Using a branch could make the function slower than using a normal
division.
Both denominator and numerator can be multiplied by 2 safely and
using shifts is faster than using a branch.
12 years ago
Mans Rullgard
4855022aa1
vorbisdec: remove some pointless comments
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago
Michael Niedermayer
8cac86e091
vorbisdec: fix heap buffer overflow.
...
Found-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
5f298c6791
vorbisdec: switch to av_assert
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Mans Rullgard
9fcda25e35
vorbisdec: replace div/mod in loop with a counter
...
2x speedup of surround decoding on Cortex-A9.
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Justin Ruggles
d5a7229ba4
Add a float DSP framework to libavutil
...
Move vector_fmul() from DSPContext to AVFloatDSPContext.
13 years ago
Alex Converse
ecf79c4d3e
vorbis: Validate that the floor 1 X values contain no duplicates.
...
Duplicate values in this vector are explicitly banned by the Vorbis I spec
and cause divide-by-zero crashes later on.
13 years ago
Reimar Döffinger
4561feb4bf
vorbisdec: use correct channels variable.
...
All code should use the local variable, the
AVCodecContext might not yet have the updated value.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
13 years ago
Martin Storsjö
00c3b67b8a
cosmetics: Align codec declarations
...
Also break some long lines, remove codec function placeholder comments
and add spaces in sample/pixel format lists.
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Aaron Colwell
12623a8026
vorbisdec: avoid invalid memory access
...
This fixes some invalid memory access caused later in the function
by res_chan[] not being set for all channels. This happens when a
channel doesn't appear a submap. This change simply returns a
decoder error when this situation is detected.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
13 years ago
Justin Ruggles
5602a464c9
avcodec: add a Vorbis parser to get packet duration
...
This also allows for removing some of the Vorbis-related hacks.
13 years ago
Justin Ruggles
737ca4482b
vorbisdec: read the previous window flag for long windows
...
When reading sequentially, we are using the actual flag from the previous
frame, but when seeking we do not know what the previous window flag was, so
we need to read it from the bitstream.
13 years ago
Justin Ruggles
19adb0bc2d
vorbisdec: add a flush() function
...
clear MDCT overlap buffer and reset previous window mode when seeking
13 years ago
Martin Storsjö
27cfdc3e4f
vorbis: Add ff_ prefix to nonstatic symbols
...
Signed-off-by: Martin Storsjö <martin@martin.st>
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
Martin Storsjö
e96b4a53df
vlc/rl: Add ff_ prefix to the nonstatic symbols
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Ronald S. Bultje
24947d4988
vorbis: fix overflows in floor1[] vector and inverse db table index.
13 years ago
Alex Converse
7181c4edee
cosmetics: Remove extra newlines at EOF
13 years ago
Michael Niedermayer
ebc9ff8e7d
vorbisdec: Check that the x values of floor1 are unique.
...
This is required by the spec and fixes video-1frag.ogg.48.ogg. (FPE)
Based on the debuging work of Oana Stratulat and ubitux.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Chris Evans
afb2aa5379
vorbis: An additional defense in the Vorbis codec.
...
Fixes Bug: #190
Chromium Bug: #100543
Related to CVE-2011-3893
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
13 years ago
Reinhard Tartler
e6d527ff72
vorbisdec: Fix decoding bug with channel handling
...
Fixes Bug: #191
Chromium Bug: #101458
CVE-2011-3895
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
13 years ago
Diego Biurrun
3dc99a18d4
cosmetics: drop some pointless parentheses
13 years ago
Michael Niedermayer
ff7f198d7f
vorbis: make sure ch is non zero before calling vorbis_residue_decode
...
This possibly makes part of the CVE-2011-3895 fix unneeded.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Chris Evans
f74ce3a60d
vorbis: An additional defense in the Vorbis codec.
...
BUG=101458
Review URL: http://codereview.chromium.org/8414025
Fixes second part of CVE-2011-3895
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Chris Evans
68226ed9ec
vorbis: Fix decoder bug.
...
BUG=101458
Review URL: http://codereview.chromium.org/8413019
This fixes part of 2011-3895
bigned-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
405e99bdfd
vorbisdec: Make sure blocksize is not set to an invalid value.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Diego Biurrun
aaf47bcde7
Drop ALT_ prefix from BITSTREAM_READER_LE name.
...
The prefix is a historic remnant that probably meant "alternative".
Now that the A32 bitstream reader has been dropped it makes no sense anymore.
13 years ago
Justin Ruggles
0eea212943
Add avcodec_decode_audio4().
...
Deprecate avcodec_decode_audio3().
Implement audio support in avcodec_default_get_buffer().
Implement the new audio decoder API in all audio decoders.
13 years ago
Justin Ruggles
41899b9acb
vorbisdec: remove AVCODEC_MAX_AUDIO_FRAME_SIZE check
...
The user could provide a larger buffer, which is already checked separately
before writing output.
13 years ago
Justin Ruggles
e551a6f49a
vorbisdec: remove unneeded buf_size==0 check
13 years ago
Justin Ruggles
f666276fa6
vorbisdec: return proper error codes instead of made-up ones
13 years ago
Justin Ruggles
b95fbba705
cosmetics: remove extra spaces before end-of-statement semi-colons
13 years ago
Justin Ruggles
60aa1a358d
vorbisdec: check output buffer size before writing output
13 years ago
Anton Khirnov
357db4c263
lavc: use avpriv_ prefix for ff_split_xiph_headers.
...
It's used in lavf.
13 years ago
Anton Khirnov
ec6402b7c5
lavc: use designated initialisers for all codecs.
...
It's more readable and less prone to breakage.
14 years ago
Diego Biurrun
6168781f70
doxygen: do not include license boilerplate in Doxygen documentation
14 years ago
Justin Ruggles
e6c52cee54
Replace usages of av_get_bits_per_sample_fmt() with av_get_bytes_per_sample().
...
av_get_bits_per_sample_fmt() is deprecated.
14 years ago
Diego Biurrun
2d9570a304
vorbisdec: Restore mistakenly removed debug output.
14 years ago
Diego Biurrun
068aa38712
vorbis: Remove non-compiling debug statement.
14 years ago
Diego Biurrun
ec6313ad86
vorbis: Remove pointless DEBUG #ifdef around debug output macros.
14 years ago
Diego Biurrun
2366462429
Replace #ifdef + av_log() combinations by av_dlog().
14 years ago
Diego Biurrun
df96f22d8f
Replace custom debug output functions by av_dlog().
14 years ago
Justin Ruggles
9aa8193a23
Add floating-point sample format support to the ac3, eac3, dca, aac, and vorbis
...
decoders.
Based on patches by clsid2 in ffdshow-tryout.
14 years ago
Diego Biurrun
0a6b1a9f21
Replace int_fast integer types with their sized standard posix counterparts.
...
The _fast integer types provide no realworld benefits, but may introduce
portability issues and are just plain ugly.
14 years ago
Diego Biurrun
cf3ac54339
vorbis: Replace sized int_fast integer types with plain int/unsigned.
...
int/unsigned is the natural memory access type for CPUs, using sized types
for temporary variables, counters and similar just increases code size and
can possibly cause a slowdown.
14 years ago
Diego Biurrun
d1be646e90
vorbisdec: Replace some sizeof(type) by sizeof(*variable).
14 years ago
Carl Eugen Hoyos
b35a846923
Change silly variable name "class" to "partition_class".
14 years ago
Diego Biurrun
b239526873
vorbisdec: Rename silly "class_" variable to plain "class".
14 years ago
Reimar Döffinger
5aff31b136
vorbisdec: allow selecting float output at runtime.
14 years ago