Commit Graph

18316 Commits

Author SHA1 Message Date
Derek Buitenhuis
bc31a7a3b6 tablegen: Don't use cbrtf in host tools
You cannot count on them being present on all systems, and you
cannot include libm.h in a host tool, so just hard code baseline
implementations.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-10-15 17:00:28 +01:00
Derek Buitenhuis
884fd4d259 tableprint: Fix use of a size_t print with MSVC
%zu was introduced in C99, so MSVC has its own way to handle it,
namely %Iu.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-10-15 17:00:28 +01:00
Luca Barbato
39185ec4fa cavs: Check for negative cbp
Sample-Id: 00000647-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-10-13 17:52:53 +02:00
Luca Barbato
1b20d0f581 cavs: Return meaningful error values 2013-10-13 17:52:53 +02:00
Luca Barbato
14ddbb477f cavs: K&R formatting cosmetics 2013-10-13 17:52:53 +02:00
Derek Buitenhuis
eb90a2091f pthread: Fix deadlock during thread initialization
Sometimes, if pthread_create() failed, then pthread_cond_wait() could
accidentally be called in the worker threads after the uninit function
had already called pthread_cond_broadcast(), leading to a deadlock.

Don't call pthread_cond_wait() if c->done is set.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-10-13 05:50:00 -04:00
Luca Barbato
c9ef6b0932 indeo4: Check the inherited quant_mat
Invalidate it if not supported.

Sample-Id: 00000262-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-10-13 01:38:21 +02:00
Luca Barbato
0cb83c5638 indeo4: Check the block size if reusing the band configuration
Sample-Id: 00000287-google

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-10-13 01:38:20 +02:00
Anton Khirnov
16ea20c827 lavc doxy: extend/clarify avcodec_decode_audio4() doxy
Elaborate on flushing the decoder.
2013-10-12 15:10:21 +02:00
Anton Khirnov
66d3f5fd5c lavc doxy: remove false statements about alignment requirements.
The packet data does not need to be aligned.
2013-10-12 15:09:38 +02:00
Luca Barbato
c0de9a23c7 prores: Reject negative run and level values
Sample-Id: 00000611-google

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-10-10 21:02:10 +02:00
Tim Walker
5f5ada3dbf shorten: Fix out-of-array read
pred_order == FF_ARRAY_ELEMS(fixed_coeffs) is invalid too.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-10 17:52:14 +02:00
Maxim Poliakovski
ed796fba76 atrac3: Better name for IMDCT window initialization
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-10-10 14:29:54 +02:00
Maxim Poliakovski
be76415047 atrac3: Remove unused gain compensation tables
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-10-10 14:26:13 +02:00
Luca Barbato
2df7f7714a prores: Error out only on surely incomplete ac_coeffs 2013-10-10 10:26:31 +02:00
Luca Barbato
44690dfa68 prores: Add a codepath for decoding errors 2013-10-10 09:47:03 +02:00
Martin Storsjö
41a10f3ba1 vp6: Support cropping to AVCodecContext.width/height
In these cases, there is no extradata but only the properly set
width/height values by the demuxer.

This makes sure VP6 in F4V files is cropped properly.

This is similar to what is done for H264 for letting the container
width/height override what's in the bitstream, since 30f515091.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-10 10:41:21 +03:00
Luca Barbato
1018a92219 jpeg2000: Check block length
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-10-09 22:25:19 +02:00
Luca Barbato
071e29af4d vmnc: Use meaningful return values 2013-10-09 22:25:01 +02:00
Luca Barbato
5e992a4682 vmnc: Check the cursor dimensions
And manage the reallocation failure path.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-10-09 22:25:01 +02:00
Luca Barbato
61cd19b8bc vmnc: Port to bytestream2
Fix some buffer overreads.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-10-09 22:25:01 +02:00
Luca Barbato
a66aa0daf2 vmnc: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-10-09 22:25:01 +02:00
Luca Barbato
b2148faca9 shorten: Extend fixed_coeffs to properly support pred_order 0
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-10-09 03:34:10 +02:00
Diego Biurrun
6405ca7d4a x86: h264_idct: Update comments to match 8/10-bit depth optimization split 2013-10-07 21:46:46 +02:00
Henrik Gramner
bbe4a6db44 x86inc: Utilize the shadow space on 64-bit Windows
Store XMM6 and XMM7 in the shadow space in functions that
clobbers them. This way we don't have to adjust the stack
pointer as often, reducing the number of instructions as
well as code size.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-10-07 06:25:35 -04:00
Diego Biurrun
ce1e8045e0 x86: fdct: Employ more specific ifdefs
This avoids building mmxext and sse2 code when disabled by configure.
2013-10-06 22:02:25 +02:00
Diego Biurrun
2ddb35b911 x86: dsputil: Separate ff_add_hfyu_median_prediction_cmov from dsputil_mmx
The function does not depend on MMX and compilation without MMX enabled
fails if the function is compiled conditional on MMX availability.
2013-10-05 19:21:15 +02:00
Diego Biurrun
258414d077 x86: fdct: Initialize optimized fdct implementations in the standard way 2013-10-05 18:20:52 +02:00
Diego Biurrun
0b8b2ae5e9 x86: xviddct: Employ more specific ifdefs
This avoids building mmxext and sse2 code when disabled by configure.
2013-10-05 18:14:58 +02:00
Diego Biurrun
6cc133ec58 x86: fdct: Only build fdct code if encoders have been enabled
fdct is only initialized if encoders are enabled.
2013-10-04 10:50:44 +02:00
Diego Biurrun
b2bed9325d cosmetics: Group .name and .long_name together in codec/format declarations 2013-10-03 23:32:01 +02:00
Maxim Poliakovski
6a5bfd4d49 atrac: Add missing av_cold
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-10-03 23:00:09 +02:00
Maxim Poliakovski
79cbac8cd4 atrac3: Generalize gain compensation code
Move it to the ATRAC common code, to reuse in the upcoming ATRAC3+ decoder.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-10-03 18:20:01 +02:00
Diego Biurrun
5ce04c14dd Use correct Doxygen syntax 2013-10-03 17:53:51 +02:00
Maxim Poliakovski
4be292dac7 atrac: Move doxygen comments to the header
Also update copyright info and file description.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-10-03 17:53:51 +02:00
Diego Biurrun
be0b4c70ec atrac3: Replace a silly counter variable name with plain 'j' 2013-10-03 17:53:51 +02:00
Anton Khirnov
451606f7ce lavc: mark deprecated AVCodec.max_lowres for removal on next bump 2013-10-02 16:41:08 +02:00
Martin Storsjö
ff07ec143e pcx: Return an error on broken palette if err_detect is set to 'explode'
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 21:05:16 +03:00
Martin Storsjö
d1d99e3bef pcx: Check the packet size before assuming it fits a palette
This fixes reads out of bounds.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 20:03:12 +03:00
Martin Storsjö
7ba0cedbfe rpza: Fix a buffer size check
We read 2 bytes for 15 out of 16 pixels, therefore we need to
have at least 30 bytes, not 16.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 20:02:42 +03:00
Martin Storsjö
aa0dd52434 xxan: Disallow odd width
Decoded data is always written in pairs within this decoder.
This fixes writes out of bounds.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 20:02:32 +03:00
Martin Storsjö
fc739b3eef xan: Only read within the data that actually was initialized
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 20:02:19 +03:00
Martin Storsjö
30db94dc39 xan: Use bytestream2 to limit reading to within the buffer
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 20:01:50 +03:00
Martin Storsjö
9fb0de86b4 pcx: Consume the whole packet if giving up due to missing palette
Previously, we returned 0, meaning successful decoding but 0
bytes consumed, leading to an infinite loop.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 20:01:29 +03:00
Martin Storsjö
a81cad8f86 pngdec: Stop trying to decode once inflate returns Z_STREAM_END
If the input buffer contains more data after the deflate stream,
the loop previously left running infinitely, with inflate returning
Z_STREAM_END.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 20:01:03 +03:00
Martin Storsjö
59480abce7 alac: Do bounds checking of lpc_order read from the bitstream
In lpc_prediction(), we write up to array element 'lpc_order' in
an array allocated to hold 'max_samples_per_frame' elements.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 19:57:10 +03:00
Paul B Mahol
7e52080cb1 pcm: support 24-bit/32-bit little-endian planar
Used by LXF.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-27 01:33:45 +02:00
Kostya Shishkov
4370f65be8 g2meet: Respect cursor_stride properly everywhere
This fixes a regression with rgb cursors since b1e46988.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-25 17:42:01 +03:00
Anton Khirnov
5f4b1b1cbd lavc doxy: document that avcodec_flush_buffers() invalidates decoded frames 2013-09-24 17:34:00 +02:00
Anton Khirnov
cab8c5f8e1 h264: do not reinitialize the global cabac tables at each slice header 2013-09-24 17:13:52 +02:00
Anton Khirnov
e880418660 cabac: remove write-only h264_mps_state[] 2013-09-24 17:13:17 +02:00
Kieran Kunhya
58894ab3f9 lavc: add support for interleaved chroma formats to libx264.
Interleaved chroma is x264's native format

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-24 14:15:04 +02:00
Michael Niedermayer
84df6d6a85 h264_sei: check SEI size
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-24 13:24:29 +02:00
Rainer Hochecker
71cabb521a h264: do not discard NAL_SEI when skipping frames
Setting AVDISCARD_NONREF (e.g. after flushing) resulted in 100% dropped frames.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-24 13:24:29 +02:00
Vittorio Giovara
edaba18021 h264: log extradata skip only for non-ignored NALs
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-24 13:24:28 +02:00
Vittorio Giovara
26179964ff h264_sei: log unknown sei messages
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-24 13:24:28 +02:00
Martin Storsjö
5f24fe82e5 mpegvideo: Initialize chroma_*_shift and codec_tag even if the size is 0
This fixes breakage in a few fate tests on certain setups
(that for some reason didn't break on OS X) after the previous
commit (8812a8057). Currently, some video streams are initialized
in ff_MPV_common_init with width/height set at 0 and only changed
to a proper video size with ff_MPV_common_frame_size_change later.

The breakage was diagnosed by Anton Khirnov.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-24 14:02:23 +03:00
Martin Storsjö
8812a8057f h263dec: Remove a hack that can cause infinite loops
The actual usefulness of the hack is not known, and it does cause
infinite loops with some broken input files.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-23 23:14:49 +03:00
Martin Storsjö
23d6ba2c44 vc1dec: Check the error handling flags on slice/field header decode errors
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 21:02:52 +03:00
Michael Niedermayer
bb7bf17595 vc1dec: Don't decode slices when the latest slice header failed to decode
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 21:02:52 +03:00
Martin Storsjö
5e25fdbfe0 vc1dec: Make sure last_picture is initialized in vc1_decode_skip_blocks
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 21:02:52 +03:00
Martin Storsjö
b772b0e28e vc1dec: Undo mpegvideo initialization if unable to allocate tables
Previously, s->context_initialized was left set to 1
if ff_vc1_decode_init_alloc_tables failed, skipping the
initialization completely on the next decode call.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 21:02:47 +03:00
Martin Storsjö
ede508443e vc1dec: Fix leaks in ff_vc1_decode_init_alloc_tables on errors
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 16:10:22 +03:00
Martin Storsjö
91be1103fd wnv1: Make sure the input packet is large enough
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 16:10:21 +03:00
Vittorio Giovara
1cad7171dd h264: remove an unused static constant
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-20 14:40:10 +03:00
Martin Storsjö
a9d50bb578 dcadec: Validate the lfe parameter
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-20 14:14:45 +03:00
Martin Storsjö
3185a80259 fraps: Make the input buffer size checks more strict
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 22:45:59 +03:00
Martin Storsjö
601c2015bc svq3: Avoid a division by zero
If the height is zero, the decompression will probably end up
failing due to not fitting into the allocated buffer later
anyway, so this doesn't need any more elaborate check.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 22:45:16 +03:00
Martin Storsjö
7a5a557227 qpeg: Add checks for running out of rows in qpeg_decode_inter
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 22:44:39 +03:00
Martin Storsjö
e9d61de96c mpegaudiodec: Validate that the number of channels fits at the given offset
This is similar to the fix in 35cbc98b.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 22:44:18 +03:00
Martin Storsjö
f50803354c asvdec: Verify the amount of extradata
The init function reads one byte of extradata.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 22:43:55 +03:00
Martin Storsjö
fdbd924b84 rv34: Fix a memory leak on errors
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 11:09:18 +03:00
Martin Storsjö
5372cda671 rv10: Validate the dimensions set from the container
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 11:08:54 +03:00
Alex Converse
1914e6f010 aacdec: Add support for LD (Low Delay) AAC 2013-09-18 12:01:53 -07:00
Alex Converse
5cdefc0207 aacdec: Add support for Error Resilience syntax.
This does not add support for any error resilience tools.
2013-09-18 12:01:49 -07:00
Justin Ruggles
c4bfa09807 Add a WebP decoder
Container and lossy decoding by Aneesh Dogra <aneesh@sugarlabs.org>
Lossless decoding by Justin Ruggles <justin.ruggles@gmail.com>
2013-09-18 14:10:05 -04:00
Justin Ruggles
9ae53c5860 lavc: add ff_u8_to_s8() for safe type punning of uint8_t to int8_t 2013-09-18 14:10:05 -04:00
Martin Storsjö
c77d409bf9 twinvqdec: Check the ibps parameter separately
This is required, since invalid parameters actually could
pass the switch check below.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 23:22:46 +03:00
John Stebbins
8411baf6f0 dca_parser: Handle changes in DCA frame size
A change in framesize caused a perpetual loss of synchronization.
So read (and use) the frame size from the frame header instead of
setting it only once.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-09-17 18:16:47 +02:00
Martin Storsjö
18a245a2ae jpeg2000dec: Add more checks when parsing headers
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 15:57:27 +03:00
Martin Storsjö
b1db33159f ffv1: Make sure at least one slice context is initialized
This avoids crashes when initializing the range coder for
the first slice context.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 11:33:38 +03:00
Martin Storsjö
ea78a348d8 eacmv: Make sure a reference frame exists before referencing it
This is similar to an existing check for the second-last frame
from 062421e3.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 11:33:38 +03:00
Martin Storsjö
c39f7eba01 truemotion2: Use av_freep properly in an error path
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 11:33:38 +03:00
Martin Storsjö
f875a732e3 mpeg4videodec: Check the width/height in mpeg4_decode_sprite_trajectory
This avoids a potential division by zero.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 11:33:38 +03:00
Martin Storsjö
a92538b7c0 ivi_common: Make sure color planes have been initialized
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 11:33:38 +03:00
Martin Storsjö
711c970168 rv34: Check the return value from ff_rv34_decode_init
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 11:33:37 +03:00
Martin Storsjö
e1f3847f86 mace: Make sure that the channel count is set to a valid value
Also return a proper error code.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 11:21:46 +03:00
Martin Storsjö
1115689d54 svq3: Check for any negative return value from ff_h264_check_intra_pred_mode
Also pass on any returned error code.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 11:21:16 +03:00
Martin Storsjö
1daea5232f x86: Add an xmm clobbering wrapper for avcodec_encode_video2
This is required since 187105ff8 when we started trying to
wrap this function as well.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 22:22:41 +03:00
Vittorio Giovara
187105ff8a Fix references to deleted avcodec_encode_video() function 2013-09-16 13:59:19 +02:00
Martin Storsjö
85e8192b85 avpacket: Fix error checking in packet_alloc
Previously the wrong buffer pointer was checked, when buf
instead of *buf was checked. But checking the return value
instead is even better.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 11:22:42 +03:00
Martin Storsjö
6fc8226e29 vp3: Check the framerate for validity
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 11:04:52 +03:00
Martin Storsjö
ac9d159015 proresdec: Properly make sure an index doesn't run past the limit
If idx equaled num_coeffs - 1 on entry to the loop, the previous
check failed to break out of the loop.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 11:04:52 +03:00
Martin Storsjö
e90a6846c2 cavsdec: Make sure a sequence header has been decoded before decoding pictures
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 11:04:52 +03:00
Hendrik Leppkes
a06a5b78e2 mathops/x86: work around inline asm miscompilation with GCC 4.8.1
The volatile is not required here, and prevents a miscompilation with GCC
4.8.1 when building on x86 with --cpu=i686

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-09-15 11:15:07 -04:00
Christian Schmidt
aca25104ea pcm-dvd: Minor leftovers
Drop a pointless branch in uninit and use the compact copyright.
2013-09-13 12:14:05 +02:00
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
Diego Biurrun
e95930eda1 avcodec/utils: Simplify a condition that combines HAVE_NEON and ARCH_ARM 2013-08-21 09:40:39 +02:00
Diego Biurrun
c18838f5eb h264_ps: Use more meaningful error values 2013-08-20 21:24:42 +02:00
Diego Biurrun
330ad1f6a5 h264_ps: K&R formatting cosmetics 2013-08-20 21:23:24 +02:00
Diego Biurrun
8fed466b0a h264_ps: Drop commented-out cruft 2013-08-20 21:09:05 +02:00