66531 Commits

Author SHA1 Message Date
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 816577716bc6170bccfea3b9e865618b69a4b426)

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 bcaa9099b3648b47060e1724a97dc98b63c83702)

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 b8db25a3338b67186837c49580fe538d63dd73c7)

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 db27f50e0658e91758e8a17fdcf390e6bc93c1d2)

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 369b4cd4120bf67aa5187b6bc72574970a24ca22)

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 bbfca8e84b0e69abba523d665536c0135fc1c00e)

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 6e70e4aca50696040cc9256ec96e5c31d9641432)

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 145a84717b62e086cdb5f26649ad9f1b51ef38d0)

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 3ebd76a9c57558e284e94da367dd23b435e6a6d0)

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 3859868c75313e318ebc5d0d33baada62d45dd75)

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 c9151de7c42553bb145be608df8513c1287f1f24)

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 9bff052b51f27f6cce04e8d7d8b405c710d7ad67)

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 eb767a276bfdb9a0493bdb0b38203638230b7ccb)

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 322f0f5960a743cac47252d90a0f1ea7a025feff)

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 3eb5cbe0c50d0a0bbe10bcabbd6b16d73d93c128)

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 68fa549230af35179df2a2af2bdb84ee6c825bed)

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: 0ecb3075c1c243cfb656d1cbe0b19cdb91bde659
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 60d4c6ff76467d4d8f55c1cc61ab6c618e8ea2f3)
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: 550f3e9df3410b3dd975e590042c0d83e20a8da3
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: c727401aa9d62335e89d118a5b4e202edf39d905
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: 8f1457864be8fb9653643519dea1c6492f1dde57
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: 8b0e96e1f21b761ca15dbb470cd619a1ebf86c3e
See: 9bafd6a8f6a013c5f45141f596574a9a3fbfb561
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: 105654e376a736d243aef4a1d121abebce912e6b
See: 396195c50591a655c6c444925e813ae6a45cb3cc
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: 5c378d6a6df8243f06c87962b873bd563e58cd39
See: a2f680c7bc7642c687aeb4e14d00ac74833c7a09
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: 1b5d11240692025f036e945bc37968735679320a
See: 5ab882d7283f57560c889919c35f2688253b1d9c
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 5ab882d7283f57560c889919c35f2688253b1d9c)

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 1b5d11240692025f036e945bc37968735679320a)

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 cee4490b521fd0d02476d46aa2598af24fb8d686)
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 d423dd72be451462c6fb1cbbe313bed0194001ab)
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 0b39ac6f54505a538c21fe49a626de94c518c903)
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 17ba719d9ba30c970f65747f42d5fbb1e447ca28)
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 88626e5af8d006e67189bf10b96b982502a7e8ad)
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 809c3023b699c54c90511913d3b6140dd2436550)
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 64f7575fbd64e5b65d5c644347408588c776f1fe)
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 4ae87554f3c8bc54db572873f5049427a7e6cb31)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
n2.4.5
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 649c158e8c94ac0cff7f03e97d6ea8bbf71b7f02)

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 a400edbb6d00c0211de38e4f1b4f593681db91d8)

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 a29524bf2e197dd8d582445de0fe17f03b79f79d)

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 ed86dbd05d61363dc1c0d33f3267e2177c985fdd)

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 4b6f2253741f3023928e61ae5105ccd4b1c515fb)

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 0fadbd3623cf9132832f48810c0edb93aa63f51b)

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 6551acab6877addae815decd02aeca33ba4990c8)

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 bde27e1e617dfeb3c026f530f48a77f5ed8aa2ea)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 02:25:54 +01:00
Michael Niedermayer
82db2f2ac8 ffmpeg: drop usage of coded_frame
It causes all kinds of problems and there is no code in the muxers that reads
this field

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 02:25:54 +01:00
Michael Niedermayer
f36b3c5df9 swscale/x86/rgb2rgb_template: fix crash with tiny size and nv12 output
Fixes Ticket4151

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 02:25:54 +01:00
Michael Niedermayer
117dcc2097 avformat/rmdec: Check codec_data_size
Fixes infinite loop
Fixes Ticket4154

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 02:25:54 +01:00
Michael Niedermayer
c4e18917d4 avformat/aviobuf: Fix infinite loop in ff_get_line()
Fixes ticket4152

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 02:25:54 +01:00
Michael Niedermayer
03fbc282ff Merge commit '3ea49fc5081d63277ecbc12ed440af4b02ddfdf9' into release/2.4
* commit '3ea49fc5081d63277ecbc12ed440af4b02ddfdf9':
  vc1: Do not assume seek happens after decoding

See: 6801eb0a0981f113f5f09ed4799d9ae805af62a3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 02:17:20 +01:00