Commit Graph

66586 Commits

Author SHA1 Message Date
Martin Storsjö
932caa50a5 libavformat: Check for malloc failures in avformat_new_stream
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 9f810a9b37)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-12 22:19:11 +01:00
Andreas Cadhalpun
9cc1d21e76 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>
2015-01-10 05:03:51 +01:00
Michael Niedermayer
0b0293ceaf 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:02:19 +01:00
wm4
1b3332659a 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:18:41 +01:00
Michael Niedermayer
07c9df792c 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:18:41 +01:00
wm4
3b4e9dddcf 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:18:41 +01:00
wm4
2ba1af5791 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:18:41 +01:00
James Almer
51e880fed9 configure: bump year
Happy new year!
(cherry picked from commit b8db25a333)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:18:40 +01:00
Michael Niedermayer
86f4ac9365 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:18:40 +01:00
Michael Niedermayer
fe457ce4d1 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:18:40 +01:00
Michael Niedermayer
4506958289 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:18:40 +01:00
Michael Niedermayer
6300790144 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:18:40 +01:00
Paul B Mahol
20a4cf0d09 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:18:40 +01:00
Dale Curtis
54b76eb595 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:18:40 +01:00
Michael Niedermayer
0787163cf3 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:18:40 +01:00
Dale Curtis
134ff88c6a 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>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:18:40 +01:00
wm4
e2e145db89 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:18:40 +01:00
Michael Niedermayer
efdd30df06 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:18:40 +01:00
Michael Niedermayer
54e3aff10e 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:18:40 +01:00
Michael Niedermayer
d9ec3070d1 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:18:40 +01:00
Michael Niedermayer
6ac156864c 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:18:40 +01:00
Michael Niedermayer
0775653b4c 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:18:40 +01:00
Michael Niedermayer
33c8bb2c6a Merge commit '883795fb0face00a07349fbd32f4775431a9f30d' into release/2.4
* commit '883795fb0face00a07349fbd32f4775431a9f30d':
  h264: restore a block mistakenly removed in e10fd08a

See: 0ecb3075c1
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:06:54 +01:00
Anton Khirnov
883795fb0f h264: restore a block mistakenly removed in e10fd08a
CC: libav-stable@libav.org
Bug-ID: 781
(cherry picked from commit 60d4c6ff76)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-27 11:07:45 +01:00
Michael Niedermayer
849f55368c Merge commit '48952116352ab03565cc14805e0f1d63cf0318fe' into release/2.4
* commit '48952116352ab03565cc14805e0f1d63cf0318fe':
  on2avc: check number of channels

See: 550f3e9df3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 12:21:31 +01:00
Michael Niedermayer
b86c2640f6 Merge commit '58dc526ebf722d33bf09275c1241674e0e6b9ef1' into release/2.4
* commit '58dc526ebf722d33bf09275c1241674e0e6b9ef1':
  smc: fix the bounds check

Conflicts:
	libavcodec/smc.c

See: c727401aa9
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 12:20:46 +01:00
Michael Niedermayer
9b9411c1cf Merge commit 'eac49477aa95cf727d87d2741ee8e60be59d394b' into release/2.4
* commit 'eac49477aa95cf727d87d2741ee8e60be59d394b':
  gifdec: refactor interleave end handling

Conflicts:
	libavcodec/gifdec.c

See: 8f1457864b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 12:15:25 +01:00
Michael Niedermayer
54825047ab Merge commit '69a930b988ff4f88ae27e4fc24ff6ed116840b5e' into release/2.4
* commit '69a930b988ff4f88ae27e4fc24ff6ed116840b5e':
  mmvideo: check frame dimensions

See: 8b0e96e1f2
See: 9bafd6a8f6
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 12:11:52 +01:00
Michael Niedermayer
a7c18b628f Merge commit '55788572ea7b89cdd77bab1cf4bf06d14ead34f5' into release/2.4
* commit '55788572ea7b89cdd77bab1cf4bf06d14ead34f5':
  jvdec: check frame dimensions

See: 105654e376
See: 396195c505
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 12:10:46 +01:00
Michael Niedermayer
81754d8f8b Merge commit 'aa7a19b41774ce5f8a4e43f3692a4f9d90aa5c92' into release/2.4
* commit 'aa7a19b41774ce5f8a4e43f3692a4f9d90aa5c92':
  mjpegdec: check for pixel format changes

Conflicts:
	libavcodec/mjpegdec.c

See: 5c378d6a6d
See: a2f680c7bc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 11:50:12 +01:00
Michael Niedermayer
36e6842aa6 Merge commit '577f1feb3fd1e51fd14af7ce6d79d468faa3b929' into release/2.4
* commit '577f1feb3fd1e51fd14af7ce6d79d468faa3b929':
  mov: avoid a memleak when multiple stss boxes are present

Conflicts:
	libavformat/mov.c

See: 1b5d112406
See: 5ab882d728
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 11:49:03 +01:00
Clément Bœsch
47e4a1ac6d avformat/mov: strengthen some table allocations
(cherry picked from commit 5ab882d728)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 11:47:06 +01:00
Michael Niedermayer
a058cbcfdf avformat/mov: Fix memleaks for duplicate STCO/CO64/STSC atoms
Also see [FFmpeg-devel] [PATCH] avformat/mov: strengthen some table allocations
which contains more fixes but is unfinished

Fixes: signal_sigabrt_7ffff6ac7bb9_3484_cov_1830000177_starfox2.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1b5d112406)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 11:47:02 +01:00
Michael Niedermayer
4895211635 on2avc: check number of channels
Fixes invalid memory access.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8549
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit cee4490b52)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:51:41 +01:00
Michael Niedermayer
58dc526ebf smc: fix the bounds check
Fixes invalid writes when there are more blocks in a run than total
remaining blocks.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8548
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit d423dd72be)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:51:41 +01:00
Michael Niedermayer
eac49477aa gifdec: refactor interleave end handling
Fixes invalid writes with very small image heights.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8547
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 0b39ac6f54)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:51:41 +01:00
Anton Khirnov
69a930b988 mmvideo: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 2.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8543
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 17ba719d9b)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:51:41 +01:00
Anton Khirnov
55788572ea jvdec: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 8.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8542
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 88626e5af8)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:51:40 +01:00
Anton Khirnov
aa7a19b417 mjpegdec: check for pixel format changes
Fixes possible invalid memory access.

Based on code by Michael Niedermayer <michaelni@gmx.at>

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8541
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 809c3023b6)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:51:40 +01:00
Anton Khirnov
577f1feb3f mov: avoid a memleak when multiple stss boxes are present
CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 64f7575fbd)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:51:40 +01:00
Michael Niedermayer
4afe2684d8 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-20 04:34:45 +01:00
Michael Niedermayer
5d1d143a4e Update for FFmpeg 2.4.5
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 03:03:47 +01:00
Michael Niedermayer
820f41e1a1 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-20 02:26:27 +01:00
wm4
14d6ea0c45 lavu/frame: fix malloc error path in av_frame_copy_props()
The error path frees all side data, but forgets to reset the side data
count. This can blow up later in av_frame_unref() and free_side_data().

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 02:25:54 +01:00
Michael Niedermayer
0fb2b61614 avformat/utils: Do not update programs streams from program-less streams in update_wrap_reference()
Fixes Ticket3686

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 02:25:54 +01:00
Michael Niedermayer
0d277be45a avformat/aviobuf: Check that avio_seek() target is non negative
Fixes out of array access

Suggested-by: Andrew Scherkus <scherkus@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ed86dbd05d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 02:25:54 +01:00
Rob Sykes
3b332ef33c swresample/soxr_resample: fix error handling
Fixes CID1257659

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 02:25:54 +01:00
Michael Niedermayer
787e4d12da avformat/flvdec: fix potential use of uninitialized variables
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0fadbd3623)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 02:25:54 +01:00
wm4
95c298b125 avformat/matroskadec: fix handling of recursive SeekHead elements
When matroska_execute_seekhead() is called, it goes through the list of
seekhead entries and attempts to read elements not read yet. When doing
this, the parser can find further SeekHead elements, and will extend the
matroska->seekhead list. This can lead to a (practically) infinite loop
with certain broken files. (Maybe it can happen even with valid files.
The demuxer doesn't seem to check correctly whether an element has
already been read.)

Fix this by ignoring elements that were added to the seekhead field
during executing seekhead entries.

This does not fix the possible situation when multiple SeekHead elements
after the file header (i.e. occur after the "before_pos" file position)
point to the same elements. These elements will probably be parsed
multiple times, likely leading to bugs.

Fixes ticket #4162.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 02:25:54 +01:00
Michael Niedermayer
fd72ff6f31 doc/examples/transcoding: check encoder before using it
Fixes null pointer exception

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 02:25:54 +01:00