22711 Commits

Author SHA1 Message Date
Anton Khirnov
80c268eaae cdgraphics: do not return 0 from the decode function
0 means no data consumed, so it can trigger an infinite loop in the
caller.

CC:libav-stable@libav.org
(cherry picked from commit c7d9b473e28238d4a4ef1b7e8b42c1cca256da36)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavcodec/cdgraphics.c
2014-08-06 18:46:36 +00:00
Anton Khirnov
8cd67ddde4 cdgraphics: switch to bytestream2
Fixes possible invalid memory accesses on corrupted data.

CC:libav-stable@libav.org
Bug-ID: CVE-2013-3674
(cherry picked from commit a1599f3f7ea8478d1f6a95e59e3bc6bc86d5f812)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-06 18:45:57 +00:00
Michael Niedermayer
c53effc41b huffyuvdec: check width size for yuv422p
Avoid out of array accesses.

CC: libav-stable@libav.org
Bug-Id: CVE-2013-0848
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit a7153444df9040bf6ae103e0bbf6104b66f974cb)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 20:11:08 +00:00
Michael Niedermayer
ede7388800 mmvideo: check horizontal coordinate too
Fixes out of array accesses.

Bug-Id: CVE-2013-3672
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 70cd3b8e659c3522eea5c16a65d14b8658894a94)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 19:28:47 +00:00
Michael Niedermayer
36d8914f1b wmalosslessdec: fix mclms_coeffs* array size
Fixes corruption of context

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
Bug-Id: CVE-2014-2098
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 849b9d34c7ef70b370c53e7af3940f51cbc07d0f)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 15:05:22 +00:00
Luca Barbato
146b187113 lavc: Check the image size before calling get_buffer
Bug-Id: CVE-2011-3935
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-08-04 14:15:45 +02:00
Diego Biurrun
43d6764327 huffyuv: Check and propagate function return values
Bug-Id: CVE-2013-0868

inspired by a patch from Michael Niedermayer <michaelni@gmx.at>
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

(cherry picked from commit 744b406ff3474e77543bcf86125a2f7bc7deaa18)
Signed-off-by: Diego Biurrun <diego@biurrun.de>

Conflicts:
	libavcodec/huffyuvdec.c
2014-08-03 16:08:59 -07:00
Michael Niedermayer
01f9540320 h264_sei: check SEI size
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-08-01 13:36:37 +01:00
Vittorio Giovara
5123541913 h264: prevent theoretical infinite loop in SEI parsing
Properly address CVE-2011-3946 and parse bitstream as described in the spec.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-08-01 13:36:37 +01:00
Michael Niedermayer
00915d3cd2 pgssubdec: Check RLE size before copying
Make sure the buffer size does not exceed the expected
RLE size.

Prevent an out of array bound write.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Bug-Id: CVE-2013-0852

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit a1f7844a11010d8552c75424d1a831b37a0ae5d9)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-01 05:12:07 -07:00
Diego Biurrun
58d7b835e3 fate: Add dependencies for dct/fft/mdct/rdft tests
(cherry picked from commit d396987c303bdc4eea7d1a1ff6776475d9bbd9ea)
Signed-off-by: Diego Biurrun <diego@biurrun.de>

Conflicts:
	libavcodec/fft-test.c
2014-07-30 12:15:44 -07:00
Anton Khirnov
e8ff797206 eamad: use the bytestream2 API instead of AV_RL
This is safer and possibly fixes invalid reads on truncated data.
(cherry-picked from commit 541427ab4d5b4b6f5a90a687a06decdb78e7bc3c)

CC:libav-stable@libav.org

Conflicts:
	libavcodec/eamad.c

(cherry picked from commit f9204ec56a4cf73843d1e5b8563d3584c2c05b47)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-07-30 11:35:41 -07:00
Martin Storsjö
21d3e0ac9e adpcm: Write the proper predictor in trellis mode in IMA QT
The actual predictor value, set by the trellis code, never
was written back into the variable that was written into
the block header. This was accidentally removed in b304244b.

This significantly improves the audio quality of the trellis
case, which was plain broken since b304244b.

Encoding IMA QT with trellis still actually gives a slightly
worse quality than without trellis, since the trellis encoder
doesn't use the exact same way of rounding as in
adpcm_ima_qt_compress_sample and adpcm_ima_qt_expand_nibble.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 0776e0ef6ba4160281ef3fabea43e670f3792b4a)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 13:43:46 +02:00
Martin Storsjö
744e7eea5d adpcm: Avoid reading out of bounds in the IMA QT trellis encoder
This was broken in 095be4fb - samples+ch (for the previous
non-planar case) equals &samples_p[ch][0]. The confusion
probably stemmed from the IMA WAV case where it originally
was &samples[avctx->channels + ch], which was correctly
changed into &samples_p[ch][1].

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 3d79d0c93e5b37a35b1b22d6c18699c233aad1ba)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 13:43:41 +02:00
Justin Ruggles
d7dbc687e3 Check mp3 header before calling avpriv_mpegaudio_decode_header().
As indicated in the function documentation, the header MUST be
checked prior to calling it because no consistency check is done
there.

CC:libav-stable@libav.org
(cherry picked from commit f2f2e7627f0c878d13275af5d166ec5932665e28)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:52:01 +02:00
Justin Ruggles
7997acee05 Check if an mp3 header is using a reserved sample rate.
Fixes an invalid read past the end of avpriv_mpa_freq_tab.
Fixes divide-by-zero due to sample_rate being set to 0.

Bug-Id: 705

CC:libav-stable@libav.org

Conflicts:
	libavcodec/mpegaudiodecheader.c
2014-06-26 12:51:04 +02:00
Michael Niedermayer
71a4a9183f 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-25 23:15:58 +02:00
Michael Niedermayer
bd2266975c avcodec/libvorbisenc: dont add the duration to AV_NOPTS_VALUE
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 19e66c7232d96e4ae8f05b52da2b84dfaa4e4da3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-25 23:15:37 +02:00
Michael Niedermayer
4533e8b30a avcodec/diracdec: move mc buffer allocation to per frame
Fixes out of array accesses for non default buffers with large strides

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-25 23:15:37 +02:00
Michael Niedermayer
724deeb7a8 Merge commit '4310ba273d3bcb7f19a4e40b55b9e832568e56e5' into release/1.1
* commit '4310ba273d3bcb7f19a4e40b55b9e832568e56e5':
  sgidec: fix an incorrect backport

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-20 01:26:57 +02:00
Sean McGovern
4310ba273d sgidec: fix an incorrect backport
Bug-Id: 691

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-06-17 21:44:38 +02:00
Michael Niedermayer
cb0d255e2f 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-05-10 21:55:41 +02:00
Michael Niedermayer
ebefc92a3d Merge commit '945a1b7ab9b9df317e175e480a135a41e7e05b5c' into release/1.1
* commit '945a1b7ab9b9df317e175e480a135a41e7e05b5c':
  h264: reset next_output_pic earlier in start_frame()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 22:14:45 +02:00
Michael Niedermayer
11b3462aa3 Merge commit 'cf7bb6ceb1da7682aa54989f83d81c67a5e6790d' into release/1.1
* commit 'cf7bb6ceb1da7682aa54989f83d81c67a5e6790d':
  Revert "pthread: flush all threads on flush, not just the first one"

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 22:02:08 +02:00
Rafaël Carré
05de372350 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-03 12:06:08 -04:00
Anton Khirnov
945a1b7ab9 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-04-24 13:06:02 +02:00
Anton Khirnov
cf7bb6ceb1 Revert "pthread: flush all threads on flush, not just the first one"
This reverts commit 2eb15cdeef29eb8a0a32658154decba94b4b89cb.

It does not work correctly in pre-refcounting threading code.
2014-04-24 07:46:48 +02:00
Michael Niedermayer
47c23f9392 avcodec/g723_1: add assert to help static code analyzers
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1457f3fd90e17745791354fbb87899fc4803085a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:28 +02:00
Michael Niedermayer
d51e0dd9b4 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-04-22 00:21:28 +02:00
Michael Niedermayer
15f122316e avcodec/x86/idct_sse2_xvid: fix non C99 inline function
Found-by: Matt Oliver <protogonoi@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 46d5625f44185271862337d61cd246fd569c42a4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:28 +02:00
Anthoine Bourgeois
b546b7a029 avcodec/dirac_arith: Fix build with PIC and stack-check options
Fixes Ticket3540

The function dirac_get_arith_bit in libavcodec/dirac_arith.h can't be
built with PIC and check-stack because the asm code needs 6 registers
and PIC and check-stack options take 1 each and x86 is quite limited
in this area.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:28 +02:00
Michael Niedermayer
93fe53da91 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-04-22 00:21:28 +02:00
Michael Niedermayer
8130449f32 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-04-22 00:21:28 +02:00
Michael Niedermayer
f741c39752 avcodec/x86/mpegvideoenc_template: fix integer overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:27 +02:00
Michael Niedermayer
af1bf7f277 avcodec/h263dec: Fix use of uninitialized memory from the bitstream buffer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f07cebcd910c97ff6012085c21493231752990e9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:27 +02:00
Michael Niedermayer
63b38d4a91 Merge commit '85b8b169175a55fc862e01ecc96f649374bc14d2' into release/1.1
* commit '85b8b169175a55fc862e01ecc96f649374bc14d2':
  tiffdec: use bytestream2 to simplify overread/overwrite protection

Conflicts:
	libavcodec/tiff.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 17:06:03 +02:00
Michael Niedermayer
260f37ee4d Merge commit 'd946e4c1bcfb6accd97f6d4cbfa324ef01913c8d' into release/1.1
* commit 'd946e4c1bcfb6accd97f6d4cbfa324ef01913c8d':
  bytestream: add bytestream2_copy_buffer() functions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:57:01 +02:00
Michael Niedermayer
0162ad1a59 Merge commit '2eb15cdeef29eb8a0a32658154decba94b4b89cb' into release/1.1
* commit '2eb15cdeef29eb8a0a32658154decba94b4b89cb':
  pthread: flush all threads on flush, not just the first one

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:25:24 +02:00
Michael Niedermayer
fa73d13678 Merge commit 'b701e26a4e89e3816490bc74bc47f82e6b7f7002' into release/1.1
* commit 'b701e26a4e89e3816490bc74bc47f82e6b7f7002':
  mpeg12: check scantable indices in all decode_block functions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:18:24 +02:00
Michael Niedermayer
8401ed651b Merge commit 'ea1806ce650f0502dd25939c335b9216fa4a955f' into release/1.1
* commit 'ea1806ce650f0502dd25939c335b9216fa4a955f':
  sgidec: fix buffer size check in expand_rle_row()

Conflicts:
	libavcodec/sgidec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:00:51 +02:00
Michael Niedermayer
fcaf78f5f9 Merge commit 'ff409c7d80b6781e4b81dd860badb569061ddaa5' into release/1.1
* commit 'ff409c7d80b6781e4b81dd860badb569061ddaa5':
  adx: check that the offset is not negative

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:55:28 +02:00
Michael Niedermayer
8e5a021512 Merge commit 'c9be276f8b040e7d441a77f774afe94b6f137be6' into release/1.1
* commit 'c9be276f8b040e7d441a77f774afe94b6f137be6':
  mpegvideo: set reference/pict_type on generated reference frames

Conflicts:
	libavcodec/mpegvideo.c

See: 532b93b51631ee58443bee8aec7c2a2b2a1746be
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:54:30 +02:00
Michael Niedermayer
a23748a804 Merge commit 'd8e89a37267f276afd404bd062e5112a336d1a36' into release/1.1
* commit 'd8e89a37267f276afd404bd062e5112a336d1a36':
  h264: reset data partitioning at the beginning of each decode call

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:33:52 +02:00
Michael Niedermayer
6961f9f9f4 Merge commit '7e8d27c8510a024e6d66d2e1116bb8692d9cb98a' into release/1.1
* commit '7e8d27c8510a024e6d66d2e1116bb8692d9cb98a':
  h264: reset ref count if decoding the slice header fails

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:29:34 +02:00
Michael Niedermayer
11dfd2a74a Merge commit '7fd6c9fb49573870b48a995947edc83eedd7e86e' into release/1.1
* commit '7fd6c9fb49573870b48a995947edc83eedd7e86e':
  h264: reset first_field if frame_start() fails for missing refs

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:28:24 +02:00
Michael Niedermayer
f294748cbc h264: fix size of arrays in ff_h264_check_intra_pred_mode()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d6a33f5d20b6ef2eae2cbb959b001cb125a564b7)

Conflicts:

	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:17:43 +02:00
Michael Niedermayer
40e6c148f5 h264/ff_h264_check_intra_pred_mode: fix input value check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2005fddcbb4e18e8f7c34326e40609e4a2d83c31)

Conflicts:

	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:17:04 +02:00
Michael Niedermayer
9081b4dddd Merge commit '7f604a048e9b6128cdf9ce7e95f21d1a9822ba39' into release/1.1
* commit '7f604a048e9b6128cdf9ce7e95f21d1a9822ba39':
  h264: reject mismatching luma/chroma bit depths during sps parsing

Conflicts:
	libavcodec/h264_ps.c

See: bdeb61ccc67911cfc5e20c7cfb1312d0501ca90a
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:15:41 +02:00
Michael Niedermayer
58e2d529b3 Merge commit '7e513d85e80d730718695d09fcaf0295ae24699e' into release/1.1
* commit '7e513d85e80d730718695d09fcaf0295ae24699e':
  h264: check that execute_decode_slices() is not called too many times

See: 64591f8f86f2dfeac13ee6b4e971d069675ca814
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:02:54 +02:00
Michael Niedermayer
b9550ea116 Merge commit 'b6a0f5cde808d84626f07b11c381cc6ef0954940' into release/1.1
* commit 'b6a0f5cde808d84626f07b11c381cc6ef0954940':
  h264: do not use 422 functions for monochrome

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:01:30 +02:00