Commit Graph

68425 Commits

Author SHA1 Message Date
Michael Niedermayer
e3b6144e0c avdevice: Use av_format_get_control_message_cb()
This is required as the location of this field could change and is
specified in libavformat not avdevice

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ba97cf2c45)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Vittorio Giovara
8acbba0ec3 vp8: improve memory allocation checks
Check memory earlier, check one more allocation and clean up on error.

CC: libav-stable@libav.org
Bug-Id: CID 1257773
(cherry picked from commit 014b6b416f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Andreas Cadhalpun
9e9cde6afa configure: enable vsx together with altivec for ppc64el
The altivec optimizations on little endian ppc64 don't work without vsx.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6108485cf7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
4f8814964c avcodec/hevc: Fix handling of skipped_bytes() reallocation failures
Fixes CID1260704

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e172f5e53a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
wm4
8a6770a214 qpeg: avoid pointless invalid memcpy()
If refdata was NULL, the memcpy() ended up copying the same memory
block onto itself, which is not only pointless, but also undefined
behavior.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 921706691a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Carl Eugen Hoyos
763e6ecf83 lavc/aarch64: Do not use the neon horizontal chroma loop filter for H.264 4:2:2.
(cherry picked from commit 4faea46bd9)
2015-02-03 23:08:15 +01:00
Andreas Cadhalpun
07d508e4f5 doc/examples: fix lib math dep for decoding_encoding
It uses at least sin().

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f97f2a3527)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
n2.5.3
2015-01-10 05:03:04 +01:00
Michael Niedermayer
b089b58250 avformat/movenc: workaround bug in "PathScale EKOPath(tm) Compiler Suite Version 4.0.12.1"
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7824dc5150)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-10 05:01:20 +01:00
Michael Niedermayer
a7dd37169c Update for 2.5.3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:37:34 +01:00
wm4
3032291b3a vp9: fix parser return values in error case
The parser must always set the out_size and out_data pointers. The API
seems to require it, and the common code in parser.c also relies on it.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b88e80589b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
f9bbc26e69 ffmpeg: Clear error message array at init.
This avoids printing uninitialized bytes if no error message is set

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6d1a2efb8a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
wm4
b895e29941 avcodec/dvdsubdec: fix accessing dangling pointers
dvdsub_decode() can call append_to_cached_buf() 2 times, the second time
with ctx->buf as argument. If the second append_to_cached_buf() reallocs
ctx->buf, the argument will be a pointer to the previous, freed block.
This can cause invalid reads at least with some fuzzed files - and
possibly with valid files.

Since packets can apparently not be larger than 64K (even if packets are
combined), just use a fixed size buffer. It will be allocated as part of
the DVDSubContext, and although some memory is "wasted", it's relatively
minimal by modern standards and should be acceptable.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 816577716b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
wm4
3d71024f8a avcodec/dvdsubdec: error on bitmaps with size 0
Attemtping to decode them could lead to invalid writes with some fuzzed
samples.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bcaa9099b3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
James Almer
b834dc14da configure: bump year
Happy new year!
(cherry picked from commit b8db25a333)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
d0041dc8c4 avformat/mov: Fix mixed declaration and statement warning
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit db27f50e06)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
b3c082412c cmdutils: Use 64bit for file size/offset related variable in cmdutils_read_file()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 369b4cd412)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
918ed73b70 avformat/utils: Clear pointer in ff_alloc_extradata() to avoid leaving a stale pointer in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bbfca8e84b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
2791eba1d7 avformat/matroskadec: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6e70e4aca5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
0d3a07852c avformat/mov: use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 383c6a3a07)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Paul B Mahol
c7a2ac6b6b lavfi: check av_strdup() return value
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 145a84717b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Dale Curtis
0ce35b8ce8 mov: Fix negative size calculation in mov_read_default().
The previous code assumed if an atom was marked with a 64-bit
size extension, it actually had that data available. The new
code verfies there's enough data in the atom for this to be
done.

Failure to verify causes total_size > atom.size which will
result in negative size calculations later on.

Found-by: Paul Mehta <paul@paulmehta.com>
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3ebd76a9c5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
25312a427b avformat/mov: fix integer overflow in mov_read_udta_string()
Found-by: Paul Mehta <paul@paulmehta.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3859868c75)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Dale Curtis
9143ab0e5a mov: Fix overflow and error handling in read_tfra().
Under abnormal conditions the item_count may exceed the max
allocation size on 32-bit systems, this causes the allocated
size to overflow and become too small for the given count.

Additionally, if av_reallocp() fails its allocation, the
fragment_index_count is not correctly decremented.

Ensuring further havoc may be wrought, the error code for
read_tfra() is not checked upon return.

Found-by: Paul Mehta <paul@paulmehta.com>

positive return code and use of _array functions by commiter

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit db42d93a61)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Dale Curtis
022bfd3dd4 mov: Avoid overflow with mov_metadata_raw()
The code previously added 1 to len without checking its size,
resulting in an overflow which can corrupt value[-1] -- which
may be used to store unaligned ptr information for certain
allocators.

Found-by: Paul Mehta <paul@paulmehta.com>
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
2015-01-09 17:19:10 +01:00
wm4
e0a12b3dc3 avcodec/dvdsubdec: fix out of bounds accesses
The code blindly trusted buffer offsets read from the file in the RLE
decoder. Explicitly check the offset. Also error out on other RLE
decoding errors.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c9151de7c4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
252ba4a925 avfilter/vf_sab: fix filtering tiny images
Fixes out of array reads

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9bff052b51)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
5bb31e856d avformat/flvdec: Increase string array size
Fixes parsing httphostheader of Scarlatti\,\ Pieter-Jan\ Belder\ -\ Sonata\ K113\ in\ A\ major\ -\ Alle.flv

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eb767a276b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
eac0451e47 avformat/flvdec: do not inject dts=0 metadata packets which failed to be parsed into a new data stream
Such data streams (which then contain no other packets except the faulty one)
confuse some user applications, like VLC
Works around vlcticket 12389

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 322f0f5960)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
68c6347089 avformat/cdxl: Fix integer overflow of image_size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3eb5cbe0c5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:09 +01:00
Michael Niedermayer
bcd7f35717 avformat/segment: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 68fa549230)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:09 +01:00
Martin Storsjö
93cbdcd4d3 libavformat: Build hevc.o when building the RTP muxer
The RTP muxer enables the actual codepaths within sdp.c,
which depend on hevc.o since e5cfc8fd.

This fixes builds with --disable-everything --enable-muxer=rtp.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit fccfc22d1f)
2015-01-09 00:50:31 -03:00
Michael Niedermayer
959ab06c68 Changelog: update for 2.5.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
n2.5.2
2014-12-23 04:28:09 +01:00
Michael Niedermayer
46db3121c6 update for 2.5.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:41:27 +01:00
Michael Niedermayer
c96c755320 Makefile: add dependencies which require ffversion.h
Without this ffversion.h could sometimes be built too late

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4ae87554f3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:56 +01:00
Michael Niedermayer
9f8cdd520b Add FFMPEG_VERSION into the binary libs
This simplifies identifying from which revision a binary of a lib came from

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 649c158e8c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:56 +01:00
Anton Khirnov
f5631d23e0 mmvideo: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 2.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
See: 8b0e96e1f2
These should be redundant, but are backported for saftey anyway
2014-12-22 03:17:56 +01:00
Anton Khirnov
50f4543c6b jvdec: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 8.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
See: 105654e376
These should be redundant, but are backported for saftey anyway
2014-12-22 03:17:56 +01:00
Michael Niedermayer
1344e91f33 avcodec/indeo3: ensure offsets are non negative
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 368642361f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
f13e6ec7a6 avcodec/h264: Check *log2_weight_denom
Fixes undefined behavior
Fixes: signal_sigsegv_14768d2_2248_cov_3629497219_h264_h264___pi_20070614T182942.h264
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 61296d41e2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
bf2c9e1ad4 avcodec/hevc_ps: Check diff_cu_qp_delta_depth
Fixes undefined behavior
Fixes: asan_static-oob_17aa046_582_cov_1577759978_DBLK_G_VIXS_1.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3281fa8925)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
0663aab1d9 avcodec/h264: Clear delayed_pic on deallocation
Fixes use of freed memory

Fixes: case5_av_frame_copy_props.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e8714f6f93)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
e911f125fc avcodec/hevc: clear filter_slice_edges() on allocation
This avoids use of uninitialized memory
Fixes: asan_static-oob_17aa046_582_cov_212287884_DBLK_G_VIXS_1.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8aa8d12554)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
5aead5ee05 avcodec/dcadec: Check that the added xch channel isnt already there
Fixes null pointer dereference
Fixes: signal_sigsegv_369609d_623_cov_2008234281_ES_6.1_16bit.dts
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7d593495e4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
3a5b749d7c avcodec/indeo3: use signed variables to avoid underflow
Fixes out of array read
Fixes: signal_sigsegv_1b0a4da_1865_cov_2167818389_computer_anger.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3305acdc92)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
4b4d0b0290 avcodec/h264: make the first field of H264Context an AVClass
Fixes use of freed memory
Fixes: asan_heap-uaf_3660f67_757_cov_1257014655_Hi422FR1_SONY_A.jsv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f3b5b139ad)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
c9b25252cb swscale: increase yuv2rgb table headroom
Fixes out of array access
Fixes: case2_bad_read_yuv2rgbx32.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2a983ff7fe)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
4400385d5f avformat/mov: fix integer overflow of size
Fixes: case1_call_stack_overflow.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be9ce6e10a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
d85e25fe0b avformat/mov: check atom nesting depth
Fixes call stack overflow
Fixes: case1_call_stack_overflow.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit caa7a3914f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
3d1972d182 avcodec/utvideodec: Fix handling of slice_height=0
Fixes out of array accesses
Fixes: asan_heap-oob_25bcd7e_3783_cov_3553517262_utvideo_rgba_median.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3881606240)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
71b1abe638 avcodec/xface: Add asserts to limit nb_words from becoming too large
Approved-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 211200e0c0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00