17947 Commits

Author SHA1 Message Date
Michael Niedermayer
c1ac5896ef Merge commit '9c7321e2b8981ec867294309e9cf3833055df78f' into release/0.10
* commit '9c7321e2b8981ec867294309e9cf3833055df78f':
  sgidec: fix an incorrect backport

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-20 01:32:33 +02:00
Sean McGovern
9c7321e2b8 sgidec: fix an incorrect backport
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-06-17 21:50:20 +02:00
Michael Niedermayer
6a679279f7 avcodec/mjpegdec: Fix undefined shift
Fixes CID1194388

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-09 01:50:05 +02:00
Michael Niedermayer
90b69d1d02 avcodec/diracdec: fix undefined behavior with shifts
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b8598f6ce61ccda3f2ff0c730b009fb650e42986)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-09 01:13:58 +02:00
Michael Niedermayer
6cf254ea68 avcodec/wma: use av_freep(), do not leave stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d167faafe9dfa0b82bebb267c3c4e5fa5286bd67)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-09 01:13:58 +02:00
Michael Niedermayer
f24246a889 avcodec/h264_mp4toannexb_bsf: prepend global headers before any in stream parameter sets
Fixes h264_mp4toannexb_bsf_failure.mkv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-09 01:13:58 +02:00
Michael Niedermayer
3b977a6ded avcodec/alsdec: Clear MPEG4AudioConfig so that no use of uninitialized memory is possible
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6e6bd5481cf42a9765c492c77754d4633092cece)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-08 14:32:41 +02:00
Michael Niedermayer
952738d0af Merge commit '6f4404b24bcf59ab29cd4b57995d374a578f51a7' into release/0.10
* commit '6f4404b24bcf59ab29cd4b57995d374a578f51a7':
  h264: set parameters from SPS whenever it changes
  alac: Limit max_samples_per_frame

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 02:45:10 +02:00
Michael Niedermayer
d499685d80 Merge commit '7fa72700298107fe756311ecb4dee5270ff12d35' into release/0.10
* commit '7fa72700298107fe756311ecb4dee5270ff12d35':
  swscale: Fix an undefined behaviour
  apedec: do not buffer decoded samples over AVPackets
  isom: lpcm in mov default to big endian

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 02:41:19 +02:00
Michael Niedermayer
18b233428a Merge commit '079758e49a4d6b3e7cf2e22bed71d34c46712242' into release/0.10
* commit '079758e49a4d6b3e7cf2e22bed71d34c46712242':
  h264: reset next_output_pic earlier in start_frame()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 02:32:58 +02:00
Michael Niedermayer
c437ab3c4e Merge commit 'a0a90b1a1116250a2494021da810cc5da89ea36f' into release/0.10
* commit 'a0a90b1a1116250a2494021da810cc5da89ea36f':
  tiffdec: use bytestream2 to simplify overread/overwrite protection

Conflicts:
	libavcodec/tiff.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 02:27:34 +02:00
Michael Niedermayer
b827189c6f Merge commit 'fa60904ebd58da33abf10b05e9933d24619cf096' into release/0.10
* commit 'fa60904ebd58da33abf10b05e9933d24619cf096':
  bytestream: add bytestream2_copy_buffer() functions
  bytestream: add functions for accessing size of buffer
  movenc: allow override of "writing application" tag

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 02:23:03 +02:00
Michael Niedermayer
fe30351d52 Merge commit '330c18032464a4e1f3da907e54db2e69a6fbfcda' into release/0.10
* commit '330c18032464a4e1f3da907e54db2e69a6fbfcda':
  matroskaenc: allow override of "writing application" tag
  avfilter: Add missing emms_c when needed
  mpeg12: check scantable indices in all decode_block functions

Conflicts:
	libavformat/matroskaenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 02:18:16 +02:00
Michael Niedermayer
7c520e5cd6 Merge commit '71b8c8430cf3f7056849257324fc39b423075ba1' into release/0.10
* commit '71b8c8430cf3f7056849257324fc39b423075ba1':
  sgidec: fix buffer size check in expand_rle_row()
  adx: check that the offset is not negative
  mpegvideo: set reference/pict_type on generated reference frames

Conflicts:
	libavcodec/mpegvideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 02:14:02 +02:00
Michael Niedermayer
d076ee5216 Merge commit '27ac9585c97d35b809382be5634c8e5f7211243a' into release/0.10
* commit '27ac9585c97d35b809382be5634c8e5f7211243a':
  h264: reset data partitioning at the beginning of each decode call

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 01:47:53 +02:00
Michael Niedermayer
8d32735629 Merge commit '35ba079fbf281a066f3ac1e1271f3caa402dcd74' into release/0.10
* commit '35ba079fbf281a066f3ac1e1271f3caa402dcd74':
  h264: reset ref count if decoding the slice header fails

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 01:47:33 +02:00
Michael Niedermayer
0558832796 Merge commit 'a7cce9ebf3ae3b9678970236c964900393603a73' into release/0.10
* commit 'a7cce9ebf3ae3b9678970236c964900393603a73':
  h264: reset first_field if frame_start() fails for missing refs

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 01:47:16 +02:00
Michael Niedermayer
ced5c8e6b3 Merge commit '51ae8e26af8f5b26efb41edc0fe4812368d16ae9' into release/0.10
* commit '51ae8e26af8f5b26efb41edc0fe4812368d16ae9':
  h264: limit allowed pred modes in ff_h264_check_intra_pred_mode() to 3

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 01:46:59 +02:00
Michael Niedermayer
1e83191d5c Merge commit 'c4033cd4eb921a9cc8deb513efc6d6a6ba3b2163' into release/0.10
* commit 'c4033cd4eb921a9cc8deb513efc6d6a6ba3b2163':
  h264: reject mismatching luma/chroma bit depths during sps parsing

Conflicts:
	libavcodec/h264.c
	libavcodec/h264_ps.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 01:39:49 +02:00
Michael Niedermayer
69db5f2779 Merge commit '7f33a24e824c6d20cb941e6b20c5382becfbc923' into release/0.10
* commit '7f33a24e824c6d20cb941e6b20c5382becfbc923':
  h264: check that execute_decode_slices() is not called too many times

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 01:38:03 +02:00
Michael Niedermayer
97a5b4ba53 Merge commit '0f71a5df4bc913f17a53c7ac66d4957914fa1d3d' into release/0.10
* commit '0f71a5df4bc913f17a53c7ac66d4957914fa1d3d':
  h264: do not use 422 functions for monochrome

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 01:37:45 +02:00
Michael Niedermayer
f2275400fe Merge commit '3ee26080d6b3e777992b4b4124e62e1bf0ac0a65' into release/0.10
* commit '3ee26080d6b3e777992b4b4124e62e1bf0ac0a65':
  h264: reset data_partitioning if decoding the slice header for NAL_DPA fails

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 01:27:27 +02:00
Michael Niedermayer
1ab94468dd Merge commit 'e0d8a17402b934b8fba7b86c6c990abf1257901b' into release/0.10
* commit 'e0d8a17402b934b8fba7b86c6c990abf1257901b':
  h264_refs: make sure not to write over the bounds of the default ref list

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 01:27:12 +02:00
Michael Niedermayer
2b40afae70 Merge commit 'ecf21ab0ec798eea96f862333568336098b4610c' into release/0.10
* commit 'ecf21ab0ec798eea96f862333568336098b4610c':
  cmdutils: update copyright year to 2014.
  ituh263: reject b-frame with pp_time = 0

Conflicts:
	cmdutils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 01:17:01 +02:00
Janne Grunau
6f4404b24b h264: set parameters from SPS whenever it changes
Fixes a crash in the fuzzed sample sample_varPAR.avi_s26638 with
alternating bit depths.
2014-05-31 20:07:52 -04:00
Martin Storsjö
110680c5a2 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>
2014-05-31 20:07:52 -04:00
Rafaël Carré
65c3593792 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

Bug-Debian: http://bugs.debian.org/744901
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
(cherry picked from commit 91d4cfb8127f1de6c4ad173a30fffe584700046d)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-05-31 20:07:52 -04:00
Anton Khirnov
079758e49a h264: reset next_output_pic earlier in start_frame()
In case start_frame() fails, this potentially invalid frame can still be
output to the caller.

Bug-Id: 672
Bug-Id: debian/741240
Bug-Id: ubuntu/1288206
2014-05-31 20:07:51 -04:00
Justin Ruggles
a0a90b1a11 tiffdec: use bytestream2 to simplify overread/overwrite protection
Based on a patch by Paul B Mahol <onemda@gmail.com>

CC:libav-stable@libav.org
2014-05-31 20:05:19 -04:00
Justin Ruggles
fa60904ebd bytestream: add bytestream2_copy_buffer() functions
This is basically an overread/overwrite-safe memcpy between a
GetByteContext and a PutByteContext.

CC:libav-stable@libav.org
(cherry picked from commit 5748faf291fec297ef25d81962b52b3438f54278)
2014-05-31 20:05:19 -04:00
Anton Khirnov
71b8c8430c 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-05-31 20:05:19 -04:00
Anton Khirnov
27ac9585c9 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-05-31 20:05:19 -04:00
Anton Khirnov
35ba079fbf 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-05-31 20:05:19 -04:00
Anton Khirnov
a7cce9ebf3 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-05-31 20:05:19 -04:00
Anton Khirnov
51ae8e26af 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-05-31 20:05:19 -04:00
Anton Khirnov
c4033cd4eb 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-05-31 20:05:19 -04:00
Paul B Mahol
b473fdcde3 bytestream: add functions for accessing size of buffer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>

CC:libav-stable@libav.org
(cherry picked from commit de9d2705f61ef569487ec5f8974a9c7ce34ec783)
2014-05-31 20:05:19 -04:00
Anton Khirnov
d0ecfe3249 adx: check that the offset is not negative
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 5569146d48f06564e8fa393424782cceed510916)
2014-05-31 20:05:19 -04:00
Janne Grunau
9938e450c8 mpeg12: check scantable indices in all decode_block functions
Add checks to the fast functions used with CODEC_FLAGS2_FAST and move
the check for all other functions to before the invalid memory is
accessed. Fixes https://trac.videolan.org/vlc/ticket/9713 with
CODEC_FLAGS2_FAST.

CC: libav-stable@libav.org
2014-05-31 20:05:19 -04:00
Anton Khirnov
07558d0b9f mpegvideo: set reference/pict_type on generated reference frames
Otherwise the generic code will unref them, which can then result in
last_picture_ptr == current_picture_ptr, which causes deadlocks at least
in rv40.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-05-31 20:05:19 -04:00
Anton Khirnov
7f33a24e82 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-05-31 20:05:18 -04:00
Anton Khirnov
0f71a5df4b 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-05-31 20:05:18 -04:00
Anton Khirnov
3ee26080d6 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-05-31 20:05:18 -04:00
Anton Khirnov
e0d8a17402 h264_refs: make sure not to write over the bounds of the default ref list
Fixes invalid writes.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-05-31 20:05:18 -04:00
Anton Khirnov
2cbc8dfedd h264: check buffer size before accessing it
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-05-31 20:05:18 -04:00
Keiji Costantini
16f0f97eec ituh263: reject b-frame with pp_time = 0
Avoid a division by 0 in ff_mpeg4_set_one_direct_mv.

Sample-Id: 00000168-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
(cherry picked from commit 9514440337875e0c63b409abcd616b68c518283f)
(cherry picked from commit 5df52b0131d3d4d804ad6e221bc9a2cd8b201ef2)
(cherry picked from commit aa2a3ca27a3269e2b975686652204607fad8bc49)
2014-05-31 20:03:35 -04:00
Michael Niedermayer
43b1762ab8 avcodec/snow: split block clipping checks
Fixes out of array read
Fixes: d4476f68ca1c1c57afbc45806f581963-asan_heap-oob_2266b27_8607_cov_4044577381_snow_chroma_bug.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 61d59703c91869f4e5cdacd8d6be52f8b89d4ba4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-10 18:51:50 +01:00
Michael Niedermayer
f157f18b34 avcodec/msrle: use av_image_get_linesize() to calculate the linesize
Fixes out of array access
Fixes: 14a74a0a2dc67ede543f0e35d834fbbe-asan_heap-oob_49572c_556_cov_215466444_44_001_engine_room.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c919e1ca2ecfc47d796382973ba0e48b8f6f92a2)

Conflicts:

	libavcodec/msrle.c
(cherry picked from commit bc1c8ec5e65098fd2ccd8456f667151dfc9cda42)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-10 18:51:50 +01:00
Michael Niedermayer
ae51d93983 avcodec/wmalosslessdec: fix mclms_coeffs* array size
Fixes corruption of context
Fixes: 8835659dde6a4f7dcdf341de6a45c6c8-signal_sigsegv_1dce67b_4564_cov_2504444599_classical_22_16_1_14000_v3c_0_extend_0_29.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ec9578d54d09b64bf112c2bf7a34b1ef3b93dbd3)

Conflicts:

	libavcodec/wmalosslessdec.c
2014-03-10 18:51:50 +01:00
Michael Niedermayer
ca8c3ec11b wmalosslessdec: make mclms arrays big enough for whats written into them.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a0abefb0af64a311b15141062c77dd577ba590a3)

Conflicts:

	libavcodec/wmalosslessdec.c
2014-03-10 18:51:50 +01:00