Anton Khirnov
a84c8af042
FATE: add a test for the ONE_STR mapping mode of the channelmap filter
2014-03-16 07:44:03 +01:00
Anton Khirnov
e843612695
af_channelmap: fix ONE_STR mapping mode
...
get_channel() returns 0 on success
CC:libav-stable@libav.org
2014-03-16 07:43:52 +01:00
Anton Khirnov
e854b8f9f4
Work around broken floating point limits on some systems.
...
The values of {FLT,DBL}_{MAX,MIN} macros on some systems (older musl
libc, some BSD flavours) are not exactly representable, i.e.
(double)DBL_MAX == DBL_MAX is false
This violates (at least some interpretations of) the C99 standard and
breaks code (e.g. in vf_fps) like
double f = DBL_MAX;
[...]
if (f == DBL_MAX) { // f has not been changed yet
[....]
}
2014-03-10 10:27:17 +01:00
Anton Khirnov
713d3f98c8
vf_shuffleplanes: fix the type of the mapping indices
...
They are TYPE_INT AVOptions, so they must be ints
2014-03-06 09:24:53 +01:00
Anton Khirnov
e1f2987b10
FATE: add tests for the shuffleplanes filter
2014-03-05 21:52:03 +01:00
Anton Khirnov
599b81ca9a
lavfi: add shuffleplanes filter
2014-03-05 21:52:02 +01:00
Anton Khirnov
bba2a7cc5f
lavfi: use the correct filter context for logging an error.
2014-03-05 21:52:02 +01:00
Anton Khirnov
d1f9563d50
pthread_frame: flush all threads on flush, not just the first one
...
avcodec_flush_buffers() must release all internally held references
according to its documentation, for which all the threads need to be
flushed.
CC:libav-stable@libav.org
Bug-Id: vlc/9665
2014-02-28 21:55:46 +01:00
Anton Khirnov
bc6461c286
af_compand: replace strtok_r() with av_get_token()
2014-02-28 21:55:46 +01:00
Anton Khirnov
291e49d4e7
af_compand: add a dependency on strtok_r
2014-02-26 21:59:14 +01:00
Anton Khirnov and Diego Biurrun
e7dfaf16a4
libavfilter: example audio filtering program
...
Based on a patch by Andrew Kelley <superjoe30@gmail.com >
Signed-off-by: Diego Biurrun <diego@biurrun.de >
2014-02-25 13:22:10 +01:00
Anton Khirnov
39c2880eea
af_volume: preserve frame properties
2014-02-24 17:32:26 +01:00
Anton Khirnov
dcc7e4bf1d
af_resample: preserve frame properties
2014-02-24 17:30:48 +01:00
Anton Khirnov
67f2a68814
avconv: remove a write-only variable
2014-02-24 17:30:48 +01:00
Anton Khirnov
30517a9f05
Use av_frame_copy() to simplify code where appropriate.
2014-02-24 07:25:07 +01:00
Anton Khirnov
8feac29cc4
lavc: use AVFrame API properly in ff_reget_buffer()
2014-02-24 07:25:07 +01:00
Anton Khirnov
1155fd02ae
frame: add a convenience function for copying AVFrame data
2014-02-24 07:25:07 +01:00
Anton Khirnov
746dca483a
avconv: support forcing codec tags for input streams
2014-02-24 07:25:07 +01:00
Anton Khirnov
1db03a6864
lavr: return an error if a avresample_open() is called on an open context
2014-02-22 20:53:09 +01:00
Anton Khirnov
7e86c27b4e
lavr: add a function for checking whether AVAudioResampleContext is open
2014-02-22 20:52:36 +01:00
Anton Khirnov
c3ecd968f0
AVOptions: add flags for read/read-only options
2014-02-19 21:52:17 +01:00
Anton Khirnov
6bb8720f00
AVOptions: deprecate unused AV_OPT_FLAG_METADATA
...
It was never used since it was added and the things it was intended for
are now exported differently.
2014-02-19 21:52:17 +01:00
Anton Khirnov
ba7dfe5c50
lavfi doxy: add buffer{src,sink}.h to the main lavfi doxy group
2014-02-14 22:02:39 +01:00
Anton Khirnov
f758ea6e99
buffersink: document special error codes returned from av_buffersink_get_frame
2014-02-14 22:02:25 +01:00
Anton Khirnov
77bb0004bb
rpza: limit the number of blocks to the total remaining blocks in the frame
...
Fixes invalid writes.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-10 15:22:28 +01:00
Anton Khirnov
a46dc49744
rpza: move some variables to the blocks where they are used
2014-02-10 15:22:01 +01:00
Anton Khirnov
c7769df178
rpza: use fixed-width int types
2014-02-10 15:21:35 +01:00
Anton Khirnov
e1218ce914
rpza: switch to bytestream2
2014-02-10 15:18:21 +01:00
Anton Khirnov
394fb56c29
lavf: always unref the packet passed to av_interleaved_write_frame() on error
2014-02-10 15:08:06 +01:00
Anton Khirnov
18c896be3d
lavf: extend / improve the AVFormatContext doxy
2014-02-10 11:46:49 +01:00
Anton Khirnov
54f7e79d47
lavf: add some basic documentation of the muxing process
2014-02-10 11:44:21 +01:00
Anton Khirnov
4c75059950
lavf: rewrite the av_write_frame() doxy
...
Remove some vague / incorrect statements and make the text more specific
and less confusing.
2014-02-10 11:37:30 +01:00
Anton Khirnov
ad7f2b69a5
lavf: rewrite the av_interleaved_write_frame() doxy
...
Remove some vague / incorrect statements and make the text more specific
and less confusing.
2014-02-10 11:34:41 +01:00
Anton Khirnov
b36bc81cca
avplay: add support for seeking to chapter marks
2014-02-10 11:23:01 +01:00
Anton Khirnov
b5f851ed7e
FATE: force FLAC in the lavf ogg test
...
Since b0c2c09 , vorbis would be used if libvorbis is compiled in.
2014-02-10 07:43:40 +01:00
Anton Khirnov
38893dc028
pcmdec: replace a reachable assert with an error check
...
Libavformat should not make any assumptions about values returned from
other libraries. This assert is easily reachable by using a non-raw
codec id.
2014-02-10 07:41:21 +01:00
Anton Khirnov
cca4742a5e
doc/APIchanges: mark the place where 9 was branched
2014-02-10 07:29:27 +01:00
Anton Khirnov
d711d839ca
doc/APIchanges: fill in missing hashes and dates
2014-02-10 07:29:27 +01:00
Anton Khirnov
4c3e1956ee
lagarith: reallocate rgb_planes when needed
...
Fixes invalid writes on pixel format changes.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-04 22:00:27 +01:00
Anton Khirnov
2240e2078d
truemotion1: check the header size
...
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-04 22:00:13 +01:00
Anton Khirnov
1713eec29a
shorten: pad the internal bitstream buffer
...
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-04 21:59:57 +01:00
Anton Khirnov
5430839144
eacmv: clear references on frame dimensions change
...
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-04 21:59:14 +01:00
Anton Khirnov
1f097d168d
h264: reset data partitioning at the beginning of each decode call
...
Prevents using GetBitContexts with data from previous calls.
Fixes access to freed memory.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-04 11:26:17 +01:00
Anton Khirnov
e46ad30a80
vp8: use a fixed-size edge emu buffer
...
The reason is the same as for e588615d93
Based on a patch by Ronald S. Bultje <rsbultje@gmail.com >
2014-02-04 11:21:07 +01:00
Anton Khirnov
33c859c142
lavf: ignore attachment streams for interleaving purposes
...
Those streams should never get any packets by definition.
2014-02-04 11:17:06 +01:00
Anton Khirnov
7b03b65bf0
lavf: do basic sanity checking on muxed packets
...
Reject packets for non-existing or attachment streams.
2014-02-04 11:10:55 +01:00
Anton Khirnov
b25e84b739
hevc: check that the VCL NAL types are the same for all slice segments of a frame
...
Fixes possible invalid memory access for mismatching skipped/non-skipped
slice segments.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Sample-Id: 00001533-google
2014-02-04 10:39:07 +01:00
Anton Khirnov
e0ab5078a7
lavc: do not force the emu edge flag
...
The default get_buffer2() implementation (and possibly some
user ones) does not allocate edges when this flag is set, which may
expose bugs in some decoders. Until the 10 release is out, it is safer
to remove this part.
2014-01-21 17:54:09 +01:00
Anton Khirnov
93c553c71e
lavc: deprecate CODEC_FLAG_EMU_EDGE and avcodec_get_edge_width().
2014-01-20 12:52:28 +01:00
Anton Khirnov
024db24912
mpegvideo: allocate edges when encoding.
...
Allocating edges will be removed from generic code, so the encoder must
handle this explicitly.
2014-01-20 12:50:14 +01:00
Anton Khirnov
f7e85ee996
lavc: allow the caller to override dimensions in ff_get_buffer()
...
This will be useful for allocating edges in the encoders.
2014-01-20 12:49:47 +01:00
Anton Khirnov
8b2e5e42bb
h264: check that an IDR NAL only contains I slices
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:53:31 +01:00
Anton Khirnov
9ecabd7892
h264: reset num_reorder_frames if it is invalid
...
An invalid VUI is not considered a fatal error, so the SPS containing it
may still be used. Leaving an invalid value of num_reorder_frames there
can result in writing over the bounds of H264Context.delayed_pic.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:53:06 +01:00
Anton Khirnov
0652e024c6
h264: reset ref count if decoding the slice header fails
...
Otherwise the ER code might try to use some already freed references.
Fixes possible access to freed memory.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:51:04 +01:00
Anton Khirnov
98cc9efc5f
h264: prevent two matching fields from being both a short/long ref combination
...
Fixes possible access to freed memory.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:42:39 +01:00
Anton Khirnov
00dbff4c3e
h264: do not call field_end if we do not have a current picture
...
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:42:21 +01:00
Anton Khirnov
7f0e81db3c
h264: limit allowed pred modes in ff_h264_check_intra_pred_mode() to 3
...
Higher modes are not allowed for 16x16/chroma, which is what this
function is used for. Otherwise this function would return 0 (vertical
prediction) for invalid higher modes, which could result in invalid
reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:41:59 +01:00
Anton Khirnov
d1b3fabe69
h264: reset first_field if frame_start() fails for missing refs
...
In this case we may not have a current frame, while first_field being
set implies we do.
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:41:24 +01:00
Anton Khirnov
104a97beaf
buffersrc: handle non-refcounted frames in av_buffersrc_add_frame() correctly
2014-01-17 10:30:45 +01:00
Anton Khirnov
5ef11b8dcc
yuv4mpeg: set average frame rate
2014-01-17 10:30:45 +01:00
Anton Khirnov
2ce8bca51f
avconv: print a warning when falling back to default 25fps
2014-01-17 10:30:45 +01:00
Anton Khirnov
33018907bd
mp3enc: allow omitting the id3v2 header with -id3v2_version 0
2014-01-17 10:30:45 +01:00
Anton Khirnov
f9cc6883a4
mp3enc: add an option for disabling the Xing frame.
2014-01-17 10:30:45 +01:00
Anton Khirnov
2115a35974
lavf: make av_probe_input_buffer more robust
...
Always use the actually read size as the offset instead of making
possibly invalid assumptions.
Addresses: CVE-2012-6618
2014-01-13 15:00:09 +01:00
Anton Khirnov
8b76362836
lavf: use a fixed width type
...
It's shorter and more consistent with the rest of the code.
2014-01-13 15:00:09 +01:00
Anton Khirnov
c1868e7ee7
lavf: simplify handling of offset in av_probe_input_buuffer()
2014-01-13 15:00:09 +01:00
Anton Khirnov
d48132b7de
mjpegdec: apply flipping after decoding, not before
...
This is simpler and removes a silly restriction on edges being present.
2014-01-09 09:56:51 +01:00
Anton Khirnov
a246af86e4
FATE: add MSS2 tests
2014-01-09 09:44:48 +01:00
Anton Khirnov
ca96e33716
vp9: drop support for real (non-emulated) edges
...
They are not measurably faster on x86, they might be somewhat faster on
other platforms due to missing emu edge SIMD, but the gain is not large
enough to justify the added complexity.
2014-01-09 09:43:59 +01:00
Anton Khirnov
ef8c93e2f1
vp8: drop support for real (non-emulated) edges
...
They are not measurably faster on x86, they might be somewhat faster on
other platforms due to missing emu edge SIMD, but the gain is not large
enough to justify the added complexity.
2014-01-09 09:41:24 +01:00
Anton Khirnov
ebfe622bb1
mpegvideo: drop support for real (non-emulated) edges
...
Several decoders disable those anyway and they are not measurably faster
on x86. They might be somewhat faster on other platforms due to missing
emu edge SIMD, but the gain is not large enough (and those decoders
relevant enough) to justify the added complexity.
2014-01-09 09:41:19 +01:00
Anton Khirnov and Michael Niedermayer
02dd178d9d
avisynth: More av_new_packet changes
...
These are the remaining av_packet-related bits from 9eac7c4
that didn't get merged at that time.
Changes authored by Anton Khirnov <anton@khirnov.net >, split out
from 9eac7c4 by Stephen Hutchinson <qyot27@gmail.com >
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2014-01-08 12:54:22 +01:00
Anton Khirnov
6892d145a0
segafilm: fix leaks if reading the header fails
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-06 08:26:09 +01:00
Anton Khirnov
9cbf2d78f0
pthread_frame: unref decoded frames on failure
...
This is similar to what the non-threaded code already does.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-06 08:25:55 +01:00
Anton Khirnov
a03a642d5c
h264: do not use 422 functions for monochrome
...
Fixes invalid memory access.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-06 08:25:36 +01:00
Anton Khirnov
9eef9eb301
h264: check that execute_decode_slices() is not called too many times
...
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-06 08:25:25 +01:00
Anton Khirnov
bfd26b7ce6
h264: reject mismatching luma/chroma bit depths during sps parsing
...
There is no point in delaying the check and it avoids bugs with a
half-initialized context.
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-06 08:23:45 +01:00
Anton Khirnov
9a026c7298
h264: rebuild the default ref list if the reference count changes
...
Fixes possible access to freed memory.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-06 08:23:17 +01:00
Anton Khirnov
4736d003fa
cavsdec: check ff_get_buffer() return value
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-06 08:22:48 +01:00
Anton Khirnov
50079a6aa9
lavc: do not leak the internal frame if opening the codec fails
2014-01-06 08:21:58 +01:00
Anton Khirnov
3867f3718b
lavf: remove a pointless check
...
AVStream.codec is always non-NULL
2014-01-06 08:21:53 +01:00
Anton Khirnov
75647dea6f
oggparseogm: check timing variables
...
Fixes a potential divide by zero.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-06 08:21:38 +01:00
Anton Khirnov
8058284ce0
lavc: add 422/444 YUV with alpha to align_dimensions()
...
Aligns frame dimensions to 16, which fixes potential invalid writes.
2014-01-06 08:20:56 +01:00
Anton Khirnov
f4a8a00805
sgidec: fix buffer size check in expand_rle_row()
...
Right now it will spuriously fail if the linesize is exactly equal to
the data width.
CC:libav-stable@libav.org
2014-01-06 08:18:45 +01:00
Anton Khirnov
adb199d1bc
kgv1dec: replace forcing EMU_EDGE by a copy
...
The decoder currently sets CODEC_FLAG_EMU_EDGE and relies on
get_buffer2() to always provide buffers with linesize == 2 * width.
This is wrong, since we place no such restriction on get_buffer2()
implementations.
Fix this by decoding into internal buffers and copying them to output
frames. Since this is a very obscure decoder, the performance hit should
not be an issue.
2014-01-06 08:15:36 +01:00
Anton Khirnov
fe80fa53bc
4xm: replace forcing EMU_EDGE by a copy
...
The decoder currently sets CODEC_FLAG_EMU_EDGE and relies on
get_buffer2() to always provide buffers with linesize == 2 * width.
This is wrong, since we place no such restriction on get_buffer2()
implementations.
Fix this by decoding into internal buffers and copying them to output
frames. Since this is a very obscure decoder, the performance hit should
not be an issue.
2014-01-06 08:14:14 +01:00
Anton Khirnov
fffca3d278
4xm: return a proper error code.
2014-01-06 08:13:50 +01:00
Anton Khirnov
a3a55645f0
mpegvideo: remove disabled bfin asm
...
It has been disabled as 'broken' over 3 years ago in b716a792
2014-01-03 16:54:24 +01:00
Anton Khirnov
a4d0c6e050
mpegvideo: move dct_unquantize functions up to avoid forward declarations
2014-01-03 16:54:00 +01:00
Anton Khirnov
aec25b1c46
mpegvideo: split the encoding-only parts of frame_start() into a separate function
...
This introduces some code duplication. However, much of it should go
away once the decoders stop using MpegEncContext.
2014-01-03 16:52:49 +01:00
Anton Khirnov
b318106fae
FATE: add a test for the lavr mixing case fixed in fc6a3ef40d
2014-01-03 16:44:03 +01:00
Anton Khirnov
a8cc88b1a2
tests/Makefile: allow FILTER* to be called with lists of filter names
2014-01-03 16:43:41 +01:00
Anton Khirnov
cc976a75df
audio_mix: print (SKIP) instead of 0.0 for matrix columns removed along with output zeroing
2014-01-03 16:43:25 +01:00
Anton Khirnov
fc6a3ef40d
audio_mix: fix zeroing output channels in certain cases
...
Specifically, when the corresponding input channel exists and its matrix
column is all-zero (which is necessary for zeroing the output), the
matrix column must be removed from the matrix.
This is not done currently, so the mixing code would end up using
uninitialized pointers from stack.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-01-03 16:42:46 +01:00
Anton Khirnov
3d95d27376
audio_mix: initialize the data pointers to NULL
...
This should make it easier to catch problems where some of those
pointers are used uninitialized, since reading from NULL should always
crash, while random numbers from stack can turn out to be valid
pointers, so random memory may be silently overwritten.
2014-01-03 16:42:23 +01:00
Anton Khirnov
58312b2472
h264: reset data_partitioning if decoding the slice header for NAL_DPA fails
...
If it was set before then we can end up trying to decode a slice without
a valid slice header, which can lead to invalid memory access.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-03 16:42:02 +01:00
Anton Khirnov
e89aa4bf56
lzw: switch to bytestream2
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-03 16:40:43 +01:00
Anton Khirnov
1b5d065ca7
pmpdec: check that there is at least one audio packet.
...
The code cannot handle there being none, but that should not happen for
valid files.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-03 16:40:22 +01:00
Anton Khirnov
94a417acc0
mathematics: remove asserts from av_rescale_rnd()
...
It is a public function, it must not assert on its parameters.
2014-01-03 16:39:30 +01:00
Anton Khirnov
24057c8320
eacmv: check the framerate before setting it.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-03 16:39:09 +01:00