Commit Graph

29546 Commits

Author SHA1 Message Date
Anton Khirnov
280998b13c wmaprodec: require block_align to be set.
Avoids an infinite loop in the calling programs with decoder not
consuming any input and not returning output.

CC:libav-stable@libav.org
(cherry picked from commit cacad1c058)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 20373a66ec)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-09 20:05:52 +02:00
Xi Wang
530d10792d lzo: fix overflow checking in copy_backptr()
The check `src > dst' in the form `&c->out[-back] > c->out' invokes
pointer overflow, which is undefined behavior in C.

Remove the check.  Also replace `&c->out[-back] < c->out_start' with
a safe form `c->out - c->out_start < back' to avoid overflow.

CC: libav-stable@libav.org

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

(cherry picked from commit ca6c3f2c53)

Conflicts:
	libavutil/lzo.c
2013-05-09 11:29:05 +02:00
Xi Wang
f8d3bb8961 flacdec: simplify bounds checking in flac_probe()
Simplify `p->buf > p->buf + p->buf_size - 4' as `p->buf_size < 4'.
Avoid a possible out-of-bounds pointer, which is undefined behavior
in C.

CC: libav-stable@libav.org

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

(cherry picked from commit 8425d693ee)
2013-05-09 11:29:05 +02:00
Xi Wang
78889be3fb atrac3: avoid oversized shifting in decode_bytes()
When `off' is 0, `0x537F6103 << 32' in the following expression invokes
undefined behavior, the result of which is not necessarily 0.

    (0x537F6103 >> (off * 8)) | (0x537F6103 << (32 - (off * 8)))

Avoid oversized shifting.

CC: libav-stable@libav.org

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

(cherry picked from commit eba1ff3130)

Conflicts:
	libavcodec/atrac3.c
2013-05-09 11:29:05 +02:00
Mans Rullgard
c65763a2c6 lavf: fix arithmetic overflows in avformat_seek_file()
The values compared here can be more than INT64_MAX apart.  Since the
difference is always positive, converting to uint64_t before subtracting
gives the correct result without overflows.

Signed-off-by: Mans Rullgard <mans@mansr.com>

(cherry picked from commit 91ac403b13)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-05-09 11:29:05 +02:00
Michael Niedermayer
9c713f30e4 parser: fix large overreads
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>

(cherry picked from commit 096abfa150)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-05-09 11:29:05 +02:00
Mans Rullgard
799000af70 dsputil: fix invalid array indexing
Indexing outside an array is invalid and causes errors with
gcc 4.8.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 0a07f2b346)

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-05-09 11:29:05 +02:00
Luca Barbato
6d4d186e9e shorten: use the unsigned type where needed
get_uint returns an unsigned value, use an unsigned to store
blocksize to make sure the comparison logic is correct and report
correctly the error for the channel count not supported.

CC: libav-stable@libav.org

(cherry picked from commit 5cf7c72757)
(cherry picked from commit 88089eecfd)
(cherry picked from commit f42d03746a)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/shorten.c
2013-05-09 11:29:01 +02:00
Reinhard Tartler
5ebb5a32bd shorten: report meaningful errors
(cherry picked from commit 4c364eb2b8)
(cherry picked from commit 0daf1428e8)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/shorten.c
2013-05-09 11:28:28 +02:00
Reinhard Tartler
a694b2b158 shorten: set invalid channels count to 0
Prevent the loop shorten_decode_close from writing and freeing out of
the array boundary.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

CC: libav-stable@libav.org

(cherry picked from commit c10da30d84)
(cherry picked from commit 21d568be17)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/shorten.c
2013-05-09 11:28:28 +02:00
Justin Ruggles
d785f69401 shorten: validate that the channel count in the header is not <= 0
(cherry picked from commit 4c53f4aed3)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/shorten.c
2013-05-09 11:28:25 +02:00
Luca Barbato
5bfa208e65 matroskadec: request a read buffer for the wav header
Solve an infiniloop.

CC: libav-stable@libav.org

(cherry picked from commit 37cb3b180a)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-05-09 11:20:11 +02:00
Reinhard Tartler
7d4c38d58d h264: check for luma and chroma bit depth being equal
The decoder assumes a single bit depth for all the planes while
the specification allows different bit depths for luma and chroma.

Avoid the possible problems described in CVE-2013-2277

Conflicts:
	libavcodec/h264.c
2013-05-09 11:20:11 +02:00
Reinhard Tartler
7e6625a9af xxan: fix invalid memory access in xan_decode_frame_type0()
The loop a few lines below the xan_unpack() call accesses up to
dec_size * 2 bytes into y_buffer, so dec_size must be limited to
buffer_size / 2.

CC:libav-stable@libav.org
(cherry picked from commit 8a49d2bcbe)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 62a657de16)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/xxan.c
2013-05-09 11:20:11 +02:00
Anton Khirnov
f13f6f82c6 wmadec: require block_align to be set.
Avoids an infinite loop in the calling programs with decoder not
consuming any input and not returning output.

CC:libav-stable@libav.org
(cherry picked from commit ea1136baaf)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit c1f479e8df)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-09 11:20:11 +02:00
Anton Khirnov
5025dbc577 wmaprodec: return an error, not 0, when the input is too small.
Returning 0 may result in an infinite loop in valid calling programs. A
decoder should never return 0 without producing any output.

CC:libav-stable@libav.org
(cherry picked from commit 4c0080b7e7)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 60dd8b5733)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-09 11:20:11 +02:00
Michael Niedermayer
d86a5ce03f vorbisdec: Error on bark_map_size equal to 0.
The value is used to calculate output LSP curve and a division by zero
and out of array accesses would occur.

CVE-2013-0894

CC: libav-stable@libav.org

Reported-by: Dale Curtis <dalecurtis@chromium.org>
Found-by: inferno@chromium.org
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 11dcecfcca)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 494ddd377a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-09 11:20:11 +02:00
Reinhard Tartler
c313f3160a Update RELEASE file for 0.7.8 2013-05-09 11:20:11 +02:00
Reinhard Tartler
8489c0599f update year to 2013
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-09 11:20:10 +02:00
Luca Barbato
ee6b868ac8 oggdec: make sure the private parse data is cleaned up
Related to CVE-2012-2882

(cherry picked from commit d894f74762)

Conflicts:

	libavformat/oggdec.h
	libavformat/oggparsevorbis.c
(cherry picked from commit b0240165d93d4a08d15d244953219a4d4e725d3f)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-09 11:20:10 +02:00
Michael Niedermayer
b6783b8826 indeo5: update AVCodecContext width/height on size change
Fixes CVE-2012-2787

Note that in 0.7, there is only indeo 5, no indeo 4 decoder

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit b146d74730)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 2bc1e4fcb9)

Conflicts:

	libavcodec/ivi_common.c
2013-05-09 11:20:10 +02:00
Vicente Jimenez Aguilar
c10582e703 doc: filters: Correct BNF FILTER description
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit b5ad422bf4)
2013-02-24 19:50:31 +01:00
Reinhard Tartler
db5b454c3d Update changelog for 0.7.7 release 2013-02-02 09:59:21 +01:00
Anton Khirnov
301761792a mpeg12: do not decode extradata more than once.
Fixes CVE-2012-2803.

(cherry picked from commit 5823686261)

Conflicts:

	libavcodec/mpeg12.c
	libavcodec/mpeg12.h
2013-02-02 09:54:16 +01:00
Anton Khirnov
440e98574b indeo4/5: check empty tile size in decode_mb_info().
This prevents writing into a too small array if some parameters changed
without the tile being reallocated.

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

Fixes CVE-2012-2800

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit ae3da0ae55)

Conflicts:

	libavcodec/ivi_common.c
2013-02-02 09:54:16 +01:00
Anton Khirnov
604d72aa0d dfa: improve boundary checks in decode_dds1()
Fixes CVE-2012-2798

CC:libav-stable@libav.org
(cherry picked from commit d05f72c754)

Conflicts:

	libavcodec/dfa.c
2013-02-02 09:54:16 +01:00
Michael Niedermayer
03ddc26066 indeo5dec: Make sure we have had a valid gop header.
This prevents decoding happening on a half initialized context.

Fixes CVE-2012-2779

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 891918431d)

Conflicts:

	libavcodec/ivi_common.c
	libavcodec/ivi_common.h
2013-02-01 06:46:04 +01:00
Janne Grunau
801eff785a rv34: error out on size changes with frame threading
(cherry picked from commit cb7190cd2c)

Fixes: CVE-2012-2772 (according to Ubuntu)
2013-02-01 06:46:04 +01:00
Janne Grunau
dd0c5e0fa9 h264: check ref_count validity for num_ref_idx_active_override_flag
Fixes segfault in the fuzzed sample bipbop234.ts_s226407.
CC: libav-stable@libav.org
(cherry-picked from commit 6e5cdf2628)
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2013-01-12 19:36:38 +01:00
Janne Grunau
ad02537746 h264: check context state before decoding slice data partitions
Fixes mov_h264_aac__Demo_FlagOfOurFathers.mov.SIGSEGV.4e9.656.

Found-by: Mateusz "j00ru" Jurczyk
CC: libav-stable@libav.org
(cherry-picked from commit c1fcf563b1)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:36:38 +01:00
Reinhard Tartler
3bc9cfe66e oggdec: free the ogg streams on read_header failure
Plug an annoying memory leak on broken files.
(cherry picked from commit 89b51b570d)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 42bd6d9cf6)

Conflicts:

	libavformat/oggdec.c

Conflicts:

	libavformat/oggdec.c
2013-01-12 19:36:27 +01:00
Luca Barbato
910c1f2352 oggdec: check memory allocation
(cherry picked from commit ba064ebe48)

Conflicts:

	libavformat/oggdec.c
2013-01-12 19:34:40 +01:00
Dale Curtis
55065315ca Fix uninitialized reads on malformed ogg files.
The ogg decoder wasn't padding the input buffer with the appropriate
FF_INPUT_BUFFER_PADDING_SIZE bytes. Which led to uninitialized reads in
various pieces of parsing code when they thought they had more data than
they actually did.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit ef0d779706)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:34:40 +01:00
Martin Storsjö
8081879655 rtsp: Recheck the reordering queue if getting a new packet
If we timed out and consumed a packet from the reordering queue,
but didn't return a packet to the caller, recheck the queue status.
Otherwise, we could end up in an infinite loop, trying to consume
a queued packet that has already been consumed.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 8729698d50)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:34:40 +01:00
Justin Ruggles
a39c6bf1b8 alacdec: do not be too strict about the extradata size
Sometimes the extradata has duplicate atoms, but that shouldn't prevent
decoding. Just ensure that it is at least 36 bytes as a sanity check.

CC: libav-stable@libav.org
(cherry picked from commit 68a04b0cce)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:34:10 +01:00
Victor Lopez
884a9b0d29 h264: fix sps parsing for SVC and CAVLC 4:4:4 Intra profiles
Fixes bug 396.

CC: libav-stable@libav.org
(cherry picked from commit 1c8bf3bfed)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:34:10 +01:00
Janne Grunau
4457e6137d h264: check sps.log2_max_frame_num for validity
Fixes infinite or long taking loop in frame num gap code in
the fuzzed sample bipbop234.ts_s223302.

CC: libav-stable@libav.org
(cherry picked from commit d7d6efe42b)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:34:10 +01:00
Luca Barbato
08d9fd611e ppc: always use pic for shared libraries
CC: libav-stable@libav.org
(cherry picked from commit 1944d532a8)

Conflicts:

	configure
2013-01-12 19:33:10 +01:00
Janne Grunau
5fa739e685 h264: enable low delay only if no delayed frames were seen
Dropping frames is undesirable but that is the only way by which the
decoder could return to low delay mode. Instead emit a warning and
continue with delayed frames.
Fixes a crash in fuzzed sample nasa-8s2.ts_s20033 caused by a larger
than expected has_b_frames value. Low delay keeps getting re-enabled
from a presumely broken SPS.

CC: libav-stable@libav.org
(cherry picked from commit 706acb558a)

Conflicts:

	libavcodec/h264.c
2013-01-12 19:32:24 +01:00
Janne Grunau
10ff052c60 lavf: avoid integer overflow in ff_compute_frame_duration()
Scaling the denominator instead of the numerator if it is too large
loses precision. Fixes an assert caused by a negative frame duration in
the fuzzed sample nasa-8s2.ts_s202310.

CC: libav-stable@libav.org
(cherry picked from commit 7709ce029a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:27:42 +01:00
Alex Converse
b143844ea0 aacdec: Fix an off-by-one overwrite when switching to LTP profile from MAIN.
Found-by: pawlkt
CC: libav-stable@libav.org
Fixes: CVE-2012-5144
(cherry picked from commit 6d5b009267)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:27:42 +01:00
Luca Barbato
4ede95e69c vp6: properly fail on unsupported feature
Interlacing is not supported at all and mismanaged down the normal
codepaths causing possible buffer management issues.

Fixes: CVE-2012-2783
(cherry picked from commit be75fed975)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:27:29 +01:00
Reinhard Tartler
ce8910d861 h264: Fix parameters to ff_er_add_slice() call
s->mb_x is reset to zero a couple of lines above. It does not make
sense to call ff_er_add_slice() with 0 as endx when the end of the
macroblock row was reached. Fixes unnecessary and counterproductive
error resilience in https://bugzilla.libav.org/show_bug.cgi?id=394.

(cherry picked from commit e6160bda98)

Conflicts:

	libavcodec/h264.c

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:

	libavcodec/h264.c
2013-01-12 19:22:22 +01:00
Justin Ruggles
3d0c9c9af6 flacenc: ensure the order is within the min/max range in LPC order search
This fixes use of uninitialized values when the FLAC encoder uses the
2-level, 4-level, and 8-level search methods. Fixes failure of the
fate-flac-24-comp-8 test when run using valgrind.
(cherry picked from commit 3a2731cbd3)

Conflicts:

	libavcodec/flacenc.c

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:20:27 +01:00
Luca Barbato
f3f22f183f yuv4mpeg: reject unsupported codecs
The muxer already rejects unsupported pixel formats, reject also
unsupported codecs to prevent dangerous misuses.
(cherry picked from commit 424b1e7642)

Conflicts:

	libavformat/yuv4mpeg.c

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:20:27 +01:00
Sami Pietila
bfbff1c748 vp8: reset loopfilter delta values at keyframes.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>

(cherry picked from commit 0bf511d579)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:20:27 +01:00
Luca Barbato
7fd7950174 vp56: release frames on error
Fixes CVE-2012-2783

CC: libav-stable@libav.org

(cherry picked from commit f33b5ba63e)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:20:27 +01:00
Luca Barbato
700fb8c8dd vp56: make parse_header return standard error codes
Returning 0 for failure is misleading.

CC: libav-stable@libav.org

(cherry picked from commit bb675d3ac6)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:20:27 +01:00
Anton Khirnov
9f80712454 ivi_common: check that scan pattern is set before using it.
Fixes CVE-2012-2791.

CC: libav-stable@libav.org

(cherry picked from commit deabb52ab4)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-12 19:20:27 +01:00
Reinhard Tartler
642d758a2d Update RELEASE file for 0.7.7 2013-01-04 07:43:39 +01:00