15141 Commits

Author SHA1 Message Date
Laurent Aimar
5bb9ce755b cook: Fix js_vlc_bits value validation for joint stereo
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 3a742470a845c24e7c3a40c0a228705ca951e673)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Laurent Aimar
619aab2f41 Fixed deference of NULL pointer in motionpixels decoder.
Some of the arguments given to init_vlc() come from the stream
and can be corrupted.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 69a0bce753a5d5556d5bc0888afe390e22611dd8)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Ronald S. Bultje
8099d77ca4 mpegvideo: set correct offset for edge emulation buffer.
Using the old code, half of it was unused and the other half was too
small for e.g. >8bpp interlaced data, causing random buffer overruns.
(cherry picked from commit 330deb75923675224fb9aed311d3d6ce3ec52420)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Ronald S. Bultje
bb7fd94eeb mpegvideo: fix position of bottom edge.
It was wrong in colorspaces where horizontal and vertical chroma
subsampling are not the same, e.g. 422.
(cherry picked from commit 0884dd5a1b87aff6c8a06e6492dece5cef8f3978)

Conflicts:

	libavcodec/mpegvideo.c

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Chris Rankin
ea311af23d qcelpdec: fix the return value of qcelp_decode_frame().
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
(cherry picked from commit bde25700134b98068e2ad21c1f92955a4b489cdc)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Justin Ruggles
4562f95ba8 sipr: fix the output data size check and only calculate it once.
(cherry picked from commit 1b5a189f06879338088809b3049ea7620f4e7e78)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:27 +01:00
Justin Ruggles
fc0e151cdc mpc8: check output buffer size before decoding
(cherry picked from commit 5674d4b0a35a34b75e3533a8580e0b5a0a8895a7)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:25 +01:00
Justin Ruggles
56fe62ec94 mpc7: return error if packet is too small.
(cherry picked from commit 8290d1f38b438f1b070de67645c8b4a42014c7ac)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:22 +01:00
Justin Ruggles
ce3e0d48f8 mpc7: check output buffer size before decoding
(cherry picked from commit c8b5c4d27409dfdcec80868686b173ba446c998b)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:20 +01:00
Justin Ruggles
d46efbebe7 nellymoser: check output buffer size before decoding
(cherry picked from commit 8b31c086b6065084644b86a63c9171f3094cf6ad)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:17 +01:00
Justin Ruggles
7fc9aa6d35 flacdec: fix buffer size checking in get_metadata_size()
Adds an additional check before reading the next block header and avoids a
potential integer overflow when checking the metadata size against the
remaining buffer size.
(cherry picked from commit 4c5e7b27d57dd2be777780e840eef9be63242158)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:17 +01:00
Peter Ross
8475df8158 permit decoding of multichannel ADPCM_EA_XAS
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3a549eb82be709d633a0ba964b037ee2f700e0c9)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:17 +01:00
Reimar Döffinger
282a1a960a Fix input buffer size check in adpcm_ea decoder.
Unfortunately the output buffer size check assumes that the
input buffer is never over-consumed, thus this actually
also allowed to write outside the output buffer if "lucky".

Based on:
git.videolan.org/ffmpeg.git
commit 701d0eb185192542c4a17f296e39e37cedf7abc6
(cherry picked from commit ffe92ff9f0c7f390d895de12c8ffef959ced3cd8)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:17 +01:00
Sean McGovern
2ba86066be fft: avoid a signed overflow
As a signed integer, 1<<31 overflows, so force it to unsigned.

Signed-off-by: Alex Converse <alex.converse@gmail.com>
(cherry picked from commit c2d3f561072132044114588a5f56b8e1974a2af7)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:17 +01:00
Laurent Aimar
000bd5209f rv34: Check for invalid slices offsets
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit fe476e5a9b5a1e56e53f1fa62374778fa00ec1fd)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:11 +01:00
Ronald S. Bultje
047c6ad752 h264: disallow constrained intra prediction modes for luma.
Conversion of the luma intra prediction mode to one of the constrained
("alzheimer") ones can happen by crafting special bitstreams, causing
a crash because we'll call a NULL function pointer for 16x16 block intra
prediction, since constrained intra prediction functions are only
implemented for chroma (8x8 blocks).

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 45b7bd7c53b41bc5ff6fc2158831f2b1b1256113)

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-02-19 15:41:16 +01:00
Mans Rullgard
6362264e2d h264: fix HRD parameters parsing
The bit_rate_value_minus1 and cpb_size_value_minus1 elements
allow a wider range than get_ue_golomb() supports.  This
adds a get_ue_golomb_long() function supporting up to 31
leading zeros, which is the maximum for these syntax
elements, and uses it in decode_hrd_parameters().

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:43 +01:00
Mans Rullgard
ccb3b71b42 h264: fix invalid shifts in init_cavlc_level_tab()
The level_code expression includes a shift which is invalid in
those cases where the value is not used.  Moving the calculation
to the branch where the result is used avoids these.

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:43 +01:00
Mans Rullgard
4ed486dc3a h264: fix detection of optional trailing PPS elements
The PPS may contain a few trailing elements whose presence is
only signalled by data remaining after the the mandatory part
has been parsed.  The current code fails to take into account
the rbsp_trailing_bits() when deciding whether to parse these
optional elements.  Assuming no unnecessary padding bytes are
passed to this function, the optional elements are present if
either more than 8 extra bits remain or the remaining bits do
not form a valid rbsp_trailing_bits() after the mandatory PPS
elements have been parsed.

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:42 +01:00
Laurent Aimar
ba31a01681 h264: reset h->ref_count in case of errors in ff_h264_decode_ref_pic_list_reordering()
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 4c7a232fc81fdbdee279ab819a255f624a22b083)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:42 +01:00
Mans Rullgard
1e809ab887 h264pred: use unsigned types for pixel values, fix signed overflows
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 60f10e0ad37418cc697765d85b0bc22db70f726a)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:42 +01:00
Michael Niedermayer
c6bb93dcd9 H264: Only wait before triggering ff_thread_setup_complete() until the next slice that contains a start-of-field/frame macroblock
This allows concurrent decoding of the last field/frame, rather than
only the last slice, of data packets with multiple NAL units packed
together.

This will fix the slowdown reported in e.g. bug 52.

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:42 +01:00
Ronald S. Bultje
485f85aa90 h264: correct implicit_weight for field-interlaced pictures.
(cherry picked from commit 4418aa9cb3b2f0b83748e37d2952560cf84b3611)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:42 +01:00
Laurent Aimar
ec2a1d91e2 h264: check for out of bounds reads in ff_h264_decode_extradata().
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit d1186ff72d75b6067770890758c4feb92abd84f7)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:42 +01:00
Michael Niedermayer
f9c9ee445f Merge branch 'release/0.8' into release/0.7
* release/0.8:
  shorten: Fix invalid free()
  j2kdec: Fix crash in get_qcx
  j2kdec: Check curtileno for validity
  atrac3: Fix crash in tonal component decoding. Fixes Ticket780 Bug Found by: cosminamironesei
  h264: check chroma_format_idc range. Fixes Ticket758 Bug found by: Diana Elena Muscalu
  aacsbr: Fix memory corruption. Fixes Ticket760 and Ticket761 Bug Found by: Diana Elena Muscalu
  j2kdec: Fix integer overflow leading to a segfault Fixes Ticket776 Bug found by: Diana Elena Muscalu
  ws_snd1: Fix wrong samples count and crash.
  lavfi: add missing check in avfilter_filter_samples()
  Update Changelog for 0.7.4 release
  Update RELEASE file for 0.7.4
  swscale: fix crash in fast_bilinear code when compiled with -mred-zone.
  vorbis: An additional defense in the Vorbis codec.
  vorbisdec: Fix decoding bug with channel handling

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-12 22:19:40 +01:00
Michael Niedermayer
8935e7474a shorten: Fix invalid free()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 18bcfc912e48bf77a5202a0e24a3b884b9b2ff2c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-12 21:55:59 +01:00
Michael Niedermayer
4ad5618210 j2kdec: Fix crash in get_qcx
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 282bb02839b1ce73963c8e3ee46804f1ade8b12a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-12 21:55:38 +01:00
Michael Niedermayer
6b4c38b362 j2kdec: Check curtileno for validity
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3eedf9f716733b3b4c5205726d2c1ca52b3d3d78)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-12 21:54:42 +01:00
Michael Niedermayer
049b08d04c atrac3: Fix crash in tonal component decoding.
Fixes Ticket780
Bug Found by: cosminamironesei

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-12 21:54:09 +01:00
Michael Niedermayer
8454d81ebe h264: check chroma_format_idc range.
Fixes Ticket758
Bug found by: Diana Elena Muscalu

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-12 21:52:50 +01:00
Michael Niedermayer
6f0e349a02 aacsbr: Fix memory corruption.
Fixes Ticket760 and Ticket761
Bug Found by: Diana Elena Muscalu

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-12 21:52:43 +01:00
Michael Niedermayer
56173eabb6 j2kdec: Fix integer overflow leading to a segfault
Fixes Ticket776
Bug found by: Diana Elena Muscalu

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-12 21:52:31 +01:00
Michael Niedermayer
d80db23e7d ws_snd1: Fix wrong samples count and crash.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5257743aee0c3982f0079e6553aabc6aa39401d2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-12 21:52:10 +01:00
Michael Niedermayer
1c1af2af0d Merge remote-tracking branch 'qatar/release/0.7' into release/0.8
* qatar/release/0.7:
  Update Changelog for 0.7.4 release
  Update RELEASE file for 0.7.4
  swscale: fix crash in fast_bilinear code when compiled with -mred-zone.
  vorbis: An additional defense in the Vorbis codec.
  vorbisdec: Fix decoding bug with channel handling

Conflicts:
	Changelog
	RELEASE

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-12 20:55:46 +01:00
Michael Niedermayer
c0cbf3af01 Merge branch 'release/0.8' into release/0.7
* release/0.8:
  matroskadec: Fix a bug where a pointer was cached to an array that might later move due to a realloc()
  vorbis: Avoid some out-of-bounds reads
  vp3: fix oob read for negative tokens and memleaks on error. (cherry picked from commit 8370e426e42f2e4b9d14a1fb8107ecfe5163ce7f)
  avserver: Fix a bug where the socket is IPv4, but IPv6 is autoselected for the loopback address.
  vp3: fix streams with non-zero last coefficient
  Update for 0.8.9
  vp3: fix regression with mplayer-crash.ogv
  h264: fix init of topleft ref/mv. Fixes Ticket778
  Update for 0.8.8

Conflicts:
	Doxyfile
	RELEASE
	VERSION

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-09 00:08:15 +01:00
Chris Evans
b0283ccb9e vorbis: An additional defense in the Vorbis codec.
Fixes Bug: #190
Chromium Bug: #100543
Related to CVE-2011-3893

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-01-08 09:11:02 +01:00
Reinhard Tartler
97f23c72a3 vorbisdec: Fix decoding bug with channel handling
Fixes Bug: #191
Chromium Bug: #101458
CVE-2011-3895

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-01-08 09:10:55 +01:00
Michael Niedermayer
3b0b8c6531 Merge remote-tracking branch 'qatar/release/0.7' into release/0.8
* qatar/release/0.7:
  matroskadec: Fix a bug where a pointer was cached to an array that might later move due to a realloc()
  vorbis: Avoid some out-of-bounds reads
  vp3: fix oob read for negative tokens and memleaks on error. (cherry picked from commit 8370e426e42f2e4b9d14a1fb8107ecfe5163ce7f)
  avserver: Fix a bug where the socket is IPv4, but IPv6 is autoselected for the loopback address.
  vp3: fix streams with non-zero last coefficient

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-08 06:53:38 +01:00
Chris Evans
4a94678f1b vorbis: Avoid some out-of-bounds reads
Fixes Bug: #190
Chromium Bug: #100543
Related to CVE-2011-3893

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-01-07 21:59:02 +01:00
Ronald S. Bultje
c624935554 vp3: fix oob read for negative tokens and memleaks on error.
(cherry picked from commit 8370e426e42f2e4b9d14a1fb8107ecfe5163ce7f)

Fixes: #189
Chromium-Bug: 101172,100465
CVE-2011-3892

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-01-07 09:24:52 +01:00
Janne Grunau
82a11fcff2 vp3: fix streams with non-zero last coefficient
Fixes a regression introduced in 8b94df0f2047e972.
(cherry picked from commit 9b4767e4784577f3107730316fe652ccaccd9b3a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-01-05 20:59:29 +01:00
Michael Niedermayer
1218f8ed49 vp3: fix regression with mplayer-crash.ogv
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a2a12e3358c3bbdc0246ffc94973e58eba50ee30)
2012-01-02 17:24:43 +01:00
Michael Niedermayer
c409ac5adc vp3: fix regression with mplayer-crash.ogv
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a2a12e3358c3bbdc0246ffc94973e58eba50ee30)
2012-01-02 17:24:31 +01:00
Michael Niedermayer
575cbbffaa h264: fix init of topleft ref/mv.
Fixes Ticket778

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 680880c98db2817437e19c3fc7f6349261bbbbb0)
2011-12-28 02:17:28 +01:00
Michael Niedermayer
680880c98d h264: fix init of topleft ref/mv.
Fixes Ticket778

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-27 21:33:32 +01:00
Michael Niedermayer
ef0c89e969 Merge branch 'release/0.8' into release/0.7
* release/0.8: (22 commits)
  Update Changelog for 0.7.3 release
  4xm: Add a check in decode_i_frame to prevent buffer overreads
  wma: initialize prev_block_len_bits, next_block_len_bits, and block_len_bits.
  Update RELEASE file for 0.7.3
  swscale: #include "libavutil/mathematics.h"
  vp3dec: Check coefficient index in vp3_dequant()
  svq1dec: call avcodec_set_dimensions() after dimensions changed.
  mpegtsenc: fix handling of large audio packets (sorry i have no sample, just a user report)
  h264: Use mismatching frame numbers in fields
  swscale: Readd #define _SVID_SOURCE
  vp6: Fix illegal read.
  vp6: Fix illegal read.
  vp6: Reset the internal state when aborting key frames header parsing
  vp6: Check for huffman tree build errors
  vp6: partially propagate huffman tree building errors during coeff model parsing and fix misspelling
  imgutils: Fix illegal read.
  qdm2: check output buffer size before decoding
  Fix out of bound reads in the QDM2 decoder.
  Check for out of bound writes in the QDM2 decoder.
  vmd: fix segfaults on corruped streams
  ...

Conflicts:
	Doxyfile
	RELEASE
	VERSION

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-25 19:57:17 +01:00
Michael Niedermayer
df825c956a Merge remote-tracking branch 'qatar/release/0.7' into release/0.8
This merge is primary for metadata, theres little actually changed
except cosmetics

* qatar/release/0.7:
  4xm: Add a check in decode_i_frame to prevent buffer overreads
  wma: initialize prev_block_len_bits, next_block_len_bits, and block_len_bits.
  Update RELEASE file for 0.7.3
  swscale: #include "libavutil/mathematics.h"
  vp3dec: Check coefficient index in vp3_dequant()
  svq1dec: call avcodec_set_dimensions() after dimensions changed.
  swscale: Readd #define _SVID_SOURCE

Conflicts:
	RELEASE
	libavcodec/4xm.c
	libavcodec/vp3.c
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-24 01:41:43 +01:00
Shitiz Garg
d912a30c7d 4xm: Add a check in decode_i_frame to prevent buffer overreads
Fixes bugzilla #135

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 355d917c0bd8163a3f1c7d4a6866dac749efdb84)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-12-23 22:27:02 +01:00
Justin Ruggles
8dba5608dc wma: initialize prev_block_len_bits, next_block_len_bits, and block_len_bits.
The initial values are not checked against the number of block sizes.
Initializing them to frame_len_bits will result in a block size index of 0
in these cases instead of something that might be out-of-range.

Fixes Bug 81.
(cherry picked from commit 05d1e45d1f42cc90d1f2f36c546d0096cea126a8)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-12-23 22:27:02 +01:00
Reinhard Tartler
bba709214a vp3dec: Check coefficient index in vp3_dequant()
Based on a patch by Michael Niedermayer <michaelni@gmx.at>

Fixes NGS00145, CVE-2011-4352

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

(cherry picked from commit 8b94df0f2047e9728cb872adc9e64557b7a5152f)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-12-23 15:56:01 +01:00