Commit Graph

18120 Commits

Author SHA1 Message Date
Christian Schmidt
d9cdb7d8d6 pcm-dvd: Support channel configuration changes
The sample buffering logic does not take into account that the blocksize
could change. Reset the buffer if the channel configuration changes,
since if there are leftover samples, it is most likely a broken or
misconcatenated stream. This could lead to negative numbers for
missing_samples during decoding.

Thanks to Michael Niedermeyer for pointing these out.
2013-09-13 12:14:05 +02:00
Martin Storsjö
b1e4698853 g2meet: Allocate cursor buffers large enough to fit the aligned width
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-12 10:55:20 +03:00
Martin Storsjö
0f678c0214 aic: Validate values read from the bitstream
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-12 10:54:54 +03:00
Michael Niedermayer
0d61f26001 zmbvdec: Check the buffer size for uncompressed data
Also don't pointlessly set the buffer size to 1 after copying
one packet.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-12 10:53:39 +03:00
Martin Storsjö
b26742cc30 shorten: Break out of loop looking for fmt chunk if none is found
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-12 10:53:04 +03:00
Martin Storsjö
49568851bf shorten: Use a checked bytestream reader for the wave header
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-12 10:52:42 +03:00
Martin Storsjö
f3d57dc691 smacker: Free memory properly if the init function fails
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-11 20:20:50 +03:00
Martin Storsjö
0679cec6e8 smacker: Make sure we don't fill in huffman codes out of range
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-11 20:20:45 +03:00
Martin Storsjö
d002fce24a smacker: Check malloc return values
Also try to free local allocations on errors.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-11 20:20:28 +03:00
Diego Biurrun
a0b901a348 Drop pointless directory name prefixes from #includes in the current dir 2013-09-10 12:38:41 +02:00
Luca Barbato
85ac12587b nuv: check ff_rtjpeg_decode_frame_yuv420 return value
CC: libav-stable@libav.org
2013-09-07 11:11:52 +02:00
Diego Biurrun
befe044bb9 avcodec: Stop exporting the removed audio_resample* symbols 2013-09-05 22:11:36 +02:00
Vittorio Giovara
7f93a861aa mpeg12enc: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-09-05 21:50:24 +02:00
Vittorio Giovara
66f091053f mpeg12enc: drop forward declarations
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-09-05 12:38:43 +02:00
Martin Storsjö
a711a2cb47 mpegvideo: Avoid 32-bit wrapping of linesize multiplications
This makes sure that linesize * start_y doesn't overflow, so that
emulated_edge_mc can get back the original value if needed.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-04 14:33:29 +03:00
Michael Niedermayer
af11fa5409 mjpegb: Detect changing number of planes in interlaced video
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-03 22:58:24 +03:00
Martin Storsjö
35cbc98b72 alac: Check that the channels fit at the given offset
The code tries to decode a number of channels at the
offset given by the ff_alac_channel_layout_offsets table.
Even if the number of channels decoded so far doesn't
exceed the total number of channels, we need to check that
we actually can decode that number of channels at this offset
as well.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-03 22:57:52 +03:00
Martin Storsjö
f7c5883126 alac: Limit max_samples_per_frame
Otherwise buffer size calculations in allocate_buffers could
overflow later, making the code think a large enough buffer
actually was allocated.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-03 22:56:36 +03:00
Diego Biurrun
7df9e693a3 cosmetics: Fix ATRAC codec name spelling 2013-09-02 21:38:57 +02:00
Anton Khirnov
fe9bb61f9a pictordec: pass correct context to avpriv_request_sample
Fixes invalid reads.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-09-02 19:27:56 +02:00
Anton Khirnov
5f7aecde02 pictordec: break out of both decoding loops when y drops below 0
Otherwise picmemset can get called with negative y, resulting in an
invalid write.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-09-02 19:27:45 +02:00
Anton Khirnov
8aba7968dd vcr1: add sanity checks
Fixes invalid reads with corrupted files.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-09-02 19:27:33 +02:00
Martin Storsjö
21ffd41011 pcm-dvd: Fix build on big endian
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-31 18:06:26 +02:00
Christian Schmidt
a42e3a6700 pcm_dvd: consolidate pieces from pcm.c and mpeg.c
Remove the header decoding for PCM audio from mpeg.c and the
20/24bit parts from pcm.c and merge them into a new decoder in
pcm-dvd.c.

The decoder has added support for samples that span multiple
packets and modified 20/24bit group decoding. Both is needed to
decode samples that have been generated with DVD-Lab Pro 2. The
decoding of 16bit PCM and two channel 24bit is identical to
before. No other samples are known to verify the correctness of
the encoding this software does.
The complete list of tested formats is
48kHz/16bit/2-8 channels
48kHz/24bit/2-5 channels
96kHz/16bit/2-4 channels
96kHz/24bit/2 channels

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-31 11:26:29 +02:00
Christian Schmidt
21fd2f84ce pcm_bluray: cosmetics 2013-08-31 11:00:46 +02:00
Christian Schmidt
0d6549d8b5 pcm_bluray: rename pcm-mpeg.c to pcm-bluray.c
The original idea was to collect PCM codecs that could appear in various
MPEG streams in this file. Discussion in IRC lead to the conclusion that
one codec per file would be better and stop the need for #ifdefs.
2013-08-31 11:00:46 +02:00
Diego Biurrun
e998b56362 x86: avcodec: Consistently structure CPU extension initialization 2013-08-29 13:07:37 +02:00
Diego Biurrun
6369ba3c9c x86: avcodec: Use convenience macros to check for CPU flags 2013-08-29 13:07:37 +02:00
Diego Biurrun
a6b6501185 ppc: cosmetics: Consistently format CPU flag detection invocations 2013-08-29 11:31:32 +02:00
Diego Biurrun
67e6a9f558 cosmetics: Place arch initialization calls in alphabetical order 2013-08-29 11:24:14 +02:00
Diego Biurrun
f0389eb777 arm: fmtconvert: Split armv6 fmtconvert code off from vfp code 2013-08-29 11:24:14 +02:00
Diego Biurrun
bd549cbaac arm: dcadsp: Move synth filter initialization to dcadsp file 2013-08-29 11:24:14 +02:00
Diego Biurrun
6af2c351b3 ppc: Add missing AltiVec cpuflag detection invocations 2013-08-29 00:24:46 +02:00
Diego Biurrun
de81b6ae4f ppc: fdct: Remove vim editor settings comment 2013-08-28 23:59:24 +02:00
Diego Biurrun
70dd8892bf mpegvideo: Replace arch initialization ifdeffery by standard conditionals 2013-08-28 23:59:24 +02:00
Diego Biurrun
cd52917237 x86: rv40dsp: Move inline assembly optimizations out of YASM init section 2013-08-28 23:59:24 +02:00
Diego Biurrun
a64f6a04ac dsputil: x86: Hide arch-specific initialization details
Also give consistent names to init functions.
2013-08-28 23:59:24 +02:00
Diego Biurrun
f61bece684 ppc: Add and use convenience macro to check for AltiVec availability 2013-08-28 23:54:15 +02:00
Rafaël Carré
91d4cfb812 apedec: do not buffer decoded samples over AVPackets
Only consume an AVPacket when all the samples have been read.

When the rate of samples output is limited (by the default value
of max_samples), consuming the first packet immediately will cause
timing problems:

- The first packet with PTS 0 will output 4608 samples and be
consumed entirely
- The second packet with PTS 64 will output the remaining samples
(typically, a lot, that's why max_samples exist) until the decoded
samples of the first packet have been exhausted, at which point the
samples of the second packet will be decoded and output when
av_decode_frame is called with the next packet).

That means there's a PTS jump since the first packet is 'decoded'
immediately, which can be seen with avplay or mplayer: the timing
jumps immediately to 6.2s (which is the size of a packet).

Sample: http://streams.videolan.org/issues/6348/Goldwave-MAClib.ape
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2013-08-28 15:00:34 -04:00
Luca Barbato
b1f9cdc37f ac3: Return proper error codes 2013-08-27 16:19:12 +02:00
Luca Barbato
818d1f1a3e ac3: Clean up the error paths 2013-08-27 16:19:12 +02:00
Luca Barbato
6258d362b8 ac3: Do not clash with normal AVERROR
The parsing function return AVERROR and AAC_AC3_PARSE_ERROR values,
make sure they are not misunderstood.
2013-08-27 16:19:12 +02:00
Kostya Shishkov
4eb4bb3a02 imc: support mode 1 2013-08-26 09:23:45 +02:00
Kostya Shishkov
9e7b62f0fb twinvq: set block align for codecs and use it in size checks
This both allows factoring out size check for both MetaSound and TwinVQ-VQF
decoders and fixes the situation when there are several MetaSound frames
stuffed together (that happens in 8kHz @ 8kbps MetaSound in ASF for example).
2013-08-26 09:23:39 +02:00
Diego Biurrun
ff9d57e7df h264_cabac: Mark functions calling decode_cabac_residual_internal as noinline
This ensures that decode_cabac_residual_internal actually does get inlined,
which it otherwise does not, even though it is marked as always_inline.
2013-08-24 16:14:15 +02:00
Diego Biurrun
f407856968 arm: h264chroma: Do not compile h264_chroma_mc* dependent on h264 decoder
The functions are used by all codecs that enable the h264chroma component
and the file is already compiled conditional on h264chroma being enabled.
2013-08-23 17:21:14 +02:00
Diego Biurrun
84784c297f libfdk-aacdec: formatting cosmetics 2013-08-23 17:11:47 +02:00
Diego Biurrun
8506ff97c9 vp56: Mark VP6-only optimizations as such.
Most of our VP56 optimizations are VP6-only and will stay that way.
So avoid compiling them for VP5-only builds.
2013-08-23 14:42:19 +02:00
Diego Biurrun
e7b31844f6 x86: Split DCT and FFT initialization into separate files 2013-08-21 20:15:27 +02:00
Diego Biurrun
0b45269c2d x86: h264_idct: Remove incorrect comment 2013-08-21 15:09:58 +02:00