32051 Commits

Author SHA1 Message Date
Anton Khirnov
0582b8e3ea avidec: use actually read size instead of requested size
Fixes CVE-2012-2788
(cherry picked from commit 0af49a63c7f87876486ab09482d5b26b95abce60)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:24 -04:00
Michael Niedermayer
6744eee1e5 wmaprodec: check num_vec_coeffs for validity
Fixes CVE-2012-2789

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:24 -04:00
Michael Niedermayer
14bba214fa lagarith: check count before writing zeros.
Fixes CVE-2012-2793

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:24 -04:00
Anton Khirnov
1c8e2561b4 indeo3: fix out of cell write.
Fixes CVE-2012-2776.

CC:libav-stable@libav.org

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:24 -04:00
Michael Niedermayer
5c413648c1 indeo5: check tile size in decode_mb_info().
This prevents writing into a too small array if some parameters changed
without the tile being reallocated.

Fixes CVE-2012-2794

CC:libav-stable@libav.org

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:24 -04:00
Janne Grunau
3efe6becc7 indeo5: prevent null pointer dereference on broken files
Found by John Villamil <johnv@matasano.com>
(cherry picked from commit 366ac22ea5a8bab63c7f46cdad2ddb2ff22cdbed)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:24 -04:00
Michael Niedermayer
dc8371b2b1 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 891918431db628db17885ed947ee387b29826a64)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:24 -04:00
Anton Khirnov
0815d9174c 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

CC:libav-stable@libav.org

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:24 -04:00
Anton Khirnov
332555f660 ivi_common: make ff_ivi_process_empty_tile() static.
It's not used outside of ivi_common.c
(cherry picked from commit 5d2170c53bf4c2b0499f230c43764e4acf228f88)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:24 -04:00
Kostya Shishkov
c5ec190859 indeo: check for invalid motion vectors
(cherry picked from commit cf61aaaca16810b9b3a28395ed48fda8db0e87d9)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:23 -04:00
Kostya Shishkov
b561618014 indeo: clear allocated band buffers
(cherry picked from commit 23ba1503f2b11057c65052b4a07961236d8d69c7)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:23 -04:00
Kostya Shishkov
e0daa15a96 indeo: track tile macroblock size
(cherry picked from commit a6e4ac40a62930d3c90f869990f96fedb9a5d654)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:23 -04:00
Kostya Shishkov
911c250aef factor out common decoding code for Indeo 4 and Indeo 5
(cherry picked from commit aa372cf4705343a9fff422ab9ead99cef7e0b415)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:23 -04:00
Kostya Shishkov
965302c9f3 indeo: check custom Huffman tables for errors
(cherry picked from commit fe7a37c36febd71576cbefc385d995a8d6e444e7)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:23 -04:00
Anton Khirnov
0c19855539 dfa: improve boundary checks in decode_dds1()
Fixes CVE-2012-2798

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:23 -04:00
Kostya Shishkov
d0267ecf76 dfa: use more meaningful return codes
(cherry picked from commit fb5c1aaea60a714dab3d4e6e71228855fd816222)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:20 -04:00
Kostya Shishkov
2281ac9ffd dfa: add some checks to ensure that decoder won't write past frame end
(cherry picked from commit 8099187e897ddc90cb3902332c76fb2542dac308)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 16:03:18 -04:00
Paul B Mahol
12941dbe2c dfa: convert to bytestream2 API
Protects from overreads.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 29b0d94b43ac960cb442049a5d737a3386ff0337)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 15:33:38 -04:00
Anton Khirnov
9e575e54a0 dfa: check that the caller set width/height properly.
Fixes CVE-2012-2786.
(cherry picked from commit ee715f49a06bf3898246d01b056284a9bb1bcbb9)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 15:31:46 -04:00
Michael Niedermayer
9a76b7375e avsdec: Set dimensions instead of relying on the demuxer.
The decode function assumes that the video will have those dimensions.

Fixes CVE-2012-2801

CC:libav-stable@libav.org

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 15:29:00 -04:00
Justin Ruggles
d7de11260b ac3dec: ensure get_buffer() gets a buffer for the correct number of channels
If there is an error during frame parsing, but AVCodecContext.channels was
changed and AC3DecodeContext.out_channels was set previously, the two may not
match.

Fixes CVE-2012-2802
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-14 15:27:39 -04:00
Martin Storsjö
31bc3fb563 snow: Check mallocs at init
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 4d8516fdb15d0177ad745228508254dee187dff9)

Conflicts:

	libavcodec/snow.c
2012-10-06 08:43:43 +02:00
Alex Converse
9aaaeba45c vorbis: Validate that the floor 1 X values contain no duplicates.
Duplicate values in this vector are explicitly banned by the Vorbis I spec
and cause divide-by-zero crashes later on.
(cherry picked from commit ecf79c4d3e8baaf2f303278ef81db6f8407656bc)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-06 08:43:43 +02:00
Justin Ruggles
e46cf805b1 vorbisenc: check all allocations for failure
(cherry picked from commit be8d812c9635f31f69c30dff9ebf565a07a7dab7)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-10-06 08:43:43 +02:00
Kostya Shishkov
d4f3abca6a indeo3: validate new frame size before resetting decoder
(cherry picked from commit 6de226a2b8b703abc823f18c3fd7f39a0787aeb5)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-06 08:43:43 +02:00
Mina Nagy Zaki
e5f4e24942 lavfi: avfilter_merge_formats: handle case where inputs are same
This fixes a double-free crash if lists are the same due to the two
merge_ref() calls at the end of the (useless) merging that happens.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 11b6a82412bcd372adf694a26d83b07d337e1325)

Conflicts:

	libavfilter/formats.c

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-10-06 08:43:43 +02:00
Janne Grunau
b1ad5a21da rv34: error out on size changes with frame threading
Fixes CVE-2012-2772

(cherry picked from commit cb7190cd2c691fd93e4d3664f3fce6c19ee001dd)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-10-06 08:43:42 +02:00
Janne Grunau
90575bd7dd rv34: Handle only complete frames in frame-mt.
Correct handling of errors to prevent hags or crashes is very complex
otherwise.

The frame initializing is also moved from decode_slice() to
decode_frame() for clarity.
(cherry picked from commit 73ad4471a48bd02b2c2a55de116161b87e061023)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-10-06 08:43:22 +02:00
Janne Grunau
f695bd6016 rv34: use AVERROR return values in ff_rv34_decode_frame()
Also adds an error message.
(cherry picked from commit 29330721b0e8514f9f8b4d54be75a662a2b79e44)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-29 09:34:19 +02:00
Martin Storsjö
8c0bbe5156 vlc/rl: Add ff_ prefix to the nonstatic symbols
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e96b4a53df101403c54e329abfadad2edddc47c4)

Conflicts:
	libavcodec/4xm.c

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-29 09:34:19 +02:00
Martin Storsjö
6d1b91324c h263: Add ff_ prefix to nonstatic symbols
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit ddce8953a5056800ec795df2dfd84fc17a11b5fc)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-29 09:34:19 +02:00
Michael Niedermayer
a1b127515b alsdec: check opt_order.
Fixes out of array write in quant_cof.
Also make sure no invalid opt_order stays in the context.

Fixes CVE-2012-2775

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
(cherry picked from commit 9853e41aa0a6cfff629ff7009685eb8bf8d64e7f)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-28 08:20:11 +02:00
Justin Ruggles
d9ffa2aca1 golomb: check remaining bits during unary decoding in get_ur_golomb_jpegls()
Fixes infinite loop in FLAC decoding in case of a truncated bitstream due to
the safe bitstream reader returning 0's at the end.

Fixes Bug 310.

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-28 08:07:00 +02:00
Anton Khirnov
7124fa5d36 lavf: don't segfault when a NULL filename is passed to avformat_open_input()
This can easily happen when the caller is using a custom AVIOContext.

Behave as if the filename was an empty string in this case.

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-28 08:06:39 +02:00
Michael Niedermayer
da0c457663 mpegvideo: Don't use ff_mspel_motion() for vc1
Using ff_mspel_motion assumes that s (a MpegEncContext
poiinter) really is a Wmv2Context.

This fixes crashes in error resilience on vc1/wmv3 videos.

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-28 08:06:18 +02:00
Janne Grunau
7a7229b52d imgconvert: avoid undefined left shift in avcodec_find_best_pix_fmt
CC: libav-stable@libav.org
(cherry picked from commit 39bb27bf79bc4c2d8beaed637a14176264cb1916)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-28 08:06:02 +02:00
Max Lazarov
25a1a5b1b3 eval: fix swapping of lt() and lte()
CC: libav-stable@libav.org
(cherry picked from commit caac3ab6efde4fc9769e8a7472269356f262970a)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-28 08:05:40 +02:00
Janne Grunau
6704522ca9 nuv: check RTjpeg header for validity
CC: libav-stable@libav.org
(cherry picked from commit 859a579e9bbf47fae2e09494c43bcf813dcb2fad)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-28 08:05:24 +02:00
Janne Grunau
fdb7080781 Revert "nuv: check per-frame header for validity."
The check is bogus since the nuv frameheader is already skipped
and the (decompressed) RTjpeg header is checked.

This reverts commit f6afacdb3b708720c9fb85984b4f7fdbca2b2036.

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-28 08:05:11 +02:00
Anton Khirnov
bed5847563 bmpdec: only initialize palette for pal8.
Gray8 is not considered to be paletted, so this would cause an invalid
write.

Fixes bug 367.

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-28 08:04:43 +02:00
Reimar Döffinger
e9ac06160f sipr: fall back to setting mode based on bit_rate.
Not all applications (e.g. MPlayer) set block_align, and
when using a different demuxer it might not even be
easily available.
So fall back to selecting mode based on bit rate as before
if block_align has not useful value.
It can't be worse than failing to decode completely.

(cherry picked from commit 1d0d63052b82c76e10c45cd38cdd27677de72e81)

CC: libav-stable@libav.org
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit c54e00610f20d2342fe9b17a5460abfbd411c8fb)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-28 08:04:33 +02:00
Kostya Shishkov
02b7239462 vc1dec: add flush function for WMV9 and VC-1 decoders
CC: libav-stable@libav.org
(cherry picked from commit 4dc8c8386eef942dba35c4f2fb3210e22b511a5b)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-28 08:04:33 +02:00
Reimar Döffinger
8efae4cbbf avconv: fix parsing of -force_key_frames option.
Currently it always exits with an error when more than
one position is specified.

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-28 08:04:33 +02:00
Anton Khirnov
1846f3b5b1 avconv: fix -force_key_frames
parse_forced_keyframes() relies in encoder timebase being set, so call
it from transcode_init() after it is known.

Conflicts:

	avconv.c

(cherry picked from commit 19ad567311b29a42e308317b5329218c590afac8)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-06-26 14:02:58 +02:00
Mans Rullgard
2fb4be9a99 mov: set AVCodecContext.width/height for h264
This is required for correct cropping of files from Canon
cameras.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-06-10 11:22:57 +02:00
Mans Rullgard
e1608014c5 h264: allow cropping to AVCodecContext.width/height
Override the frame size from the SPS with AVCodecContext values
if the latter specify a size smaller by less than one macroblock.
This is required for correct cropping of MOV files from Canon cameras.

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

Conflicts:

	libavcodec/h264.c
2012-06-10 09:47:45 +02:00
Ronald S. Bultje
ce39a84a7d cmdutils: update copyright year to 2012. 2012-06-08 12:38:58 +02:00
Reinhard Tartler
4dfea3e9f0 Update Changelog for the 0.8.3 Release 2012-06-03 19:09:07 +02:00
Reinhard Tartler
f9ee7d13e8 Prepare for 0.8.3 Release 2012-06-03 19:05:29 +02:00
Ronald S. Bultje
ec27262c4d ea: check chunk_size for validity.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 273e6af47b38391f2bcc157cca0423fe7fcbf55c)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-06-03 19:05:29 +02:00