Commit graph

18025 commits

Author SHA1 Message Date
Michael Niedermayer
7248e73559 avcodec: fix aac/ac3 parser bitstream buffer size
Buffers containing copies of the AAC and AC3 header bits were not padded
before parsing, violating init_get_bits() buffer padding requirement,
leading to potential buffer read overflows.
This change adds FF_INPUT_BUFFER_PADDING_SIZE bytes to the bit buffer
for parsing the header in each of aac_parser.c and ac3_parser.c.

Based on patch by: Matt Wolenetz <wolenetz@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fccd85b9f3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-12 01:31:57 +01:00
Michael Niedermayer
a0316589e4 Merge commit '335ec616cc' into release/0.10
* commit '335ec616cc':
  utvideodec: Handle slice_height being zero

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 23:11:51 +01:00
Michael Niedermayer
90afa95a55 Merge commit 'ec5b2f6a38' into release/0.10
* commit 'ec5b2f6a38':
  tiff: Check that there is no aliasing in pixel format selection

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 22:51:08 +01:00
Michael Niedermayer
22377751c9 Merge commit '905988fe1a' into release/0.10
* commit '905988fe1a':
  eamad: check for out of bounds read

Conflicts:
	libavcodec/eamad.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 22:50:00 +01:00
Michael Niedermayer
60feb8543a Merge commit 'd6deed7916' into release/0.10
* commit 'd6deed7916':
  h264_cabac: Break infinite loops

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 22:38:55 +01:00
Michael Niedermayer
caedb041a6 Merge commit '9ae3cd6e72' into release/0.10
* commit '9ae3cd6e72':
  gifdec: refactor interleave end handling

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 22:32:12 +01:00
Michael Niedermayer
ed69f0f72e Merge commit 'a331e11906' into release/0.10
* commit 'a331e11906':
  smc: fix the bounds check

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 22:31:57 +01:00
Michael Niedermayer
8439378f41 Merge commit 'fc159ba88e' into release/0.10
* commit 'fc159ba88e':
  mmvideo: check frame dimensions

Conflicts:
	libavcodec/mmvideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 22:31:40 +01:00
Michael Niedermayer
17f094697d Merge commit '954aafaa96' into release/0.10
* commit '954aafaa96':
  jvdec: check frame dimensions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 22:21:47 +01:00
Michael Niedermayer
c388db185c Merge commit '893b353362' into release/0.10
* commit '893b353362':
  x86: Only use optimizations with cmov if the CPU supports the instruction

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 22:04:45 +01:00
Michael Niedermayer
35e88167ea Merge commit '2deac60a38' into release/0.10
* commit '2deac60a38':
  adpcmenc: Calculate the IMA_QT predictor without overflow

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 21:50:03 +01:00
Michael Niedermayer
82c8abb34f Merge commit '3eed35addb' into release/0.10
* commit '3eed35addb':
  svq1enc: Set picture_structure correctly

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 21:49:42 +01:00
Michael Niedermayer
7801f3e509 Merge commit 'ec0df23765' into release/0.10
* commit 'ec0df23765':
  h264: Remove an assert on current_picture_ptr being null

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 21:44:24 +01:00
Michael Niedermayer
6c76f3dfaa Merge commit 'd1c490448c' into release/0.10
* commit 'd1c490448c':
  mpegvideo: remove last_picture_ptr / h264 assert.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 21:43:52 +01:00
Michael Niedermayer
9d94589852 Merge commit '9858a723cb' into release/0.10
* commit '9858a723cb':
  elbg: Fix an assert

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 21:37:53 +01:00
Michael Niedermayer
c9a38ffe2f Merge commit '233d1b4861' into release/0.10
* commit '233d1b4861':
  h264_refs: Fix debug tprintf argument types

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 21:36:34 +01:00
Michael Niedermayer
3832db1223 Merge commit '57c36de726' into release/0.10
* commit '57c36de726':
  vp8: avoid race condition on segment map.

Conflicts:
	libavcodec/vp8.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 21:29:31 +01:00
Michael Niedermayer
2a4d9b9af0 Merge commit '8152b02f33' into release/0.10
* commit '8152b02f33':
  arm/neon: dsputil: use correct size specifiers on vld1/vst1

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 21:11:07 +01:00
Michael Niedermayer
6a28ae55c4 Merge commit '9fa9d471a7' into release/0.10
* commit '9fa9d471a7':
  arm: dsputil: prettify some conditional instructions in put_pixels macros

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 21:10:31 +01:00
Michael Niedermayer
78518fb928 Merge commit '6dd19ffd39' into release/0.10
* commit '6dd19ffd39':
  arm: dsputil: fix overreads in put/avg_pixels functions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 21:10:08 +01:00
Michael Niedermayer
335ec616cc utvideodec: Handle slice_height being zero
Fixes out of array accesses.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Bug-Id: CVE-2014-9604
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 0ce3a0f9d9)
(cherry picked from commit 3a417a86b3)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit e032e647dd)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 789f433bc6)

Conflicts:
	libavcodec/utvideodec.c
2015-03-09 22:08:49 -04:00
Anton Khirnov
ec5b2f6a38 tiff: Check that there is no aliasing in pixel format selection
Fixes possible issues with unexpected bpp/bppcount values.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Bug-Id: CVE-2014-8544
(cherry picked from commit ae5e1f3d66)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit eb9041403d)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 62b0462e5f)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-03-08 22:30:43 -04:00
Federico Tomassetti
905988fe1a eamad: check for out of bounds read
Bug-Id: CID 1257500
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-03-08 20:36:47 +00:00
Michael Niedermayer
d6deed7916 h264_cabac: Break infinite loops
This fixes out of array reads and/or infinite loops.

30 is the maximum number of bits that can be read into
coeff_abs below.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-23 00:06:28 +00:00
Michael Niedermayer
9ae3cd6e72 gifdec: refactor interleave end handling
Fixes invalid writes with very small image heights.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8547
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 0b39ac6f54)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit eac49477aa)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 92888e9ed4)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 02de44073a)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 11:19:47 +01:00
Michael Niedermayer
a331e11906 smc: fix the bounds check
Fixes invalid writes when there are more blocks in a run than total
remaining blocks.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8548
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit d423dd72be)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 58dc526ebf)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit f249e98891)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 306ee95088)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 11:16:34 +01:00
Anton Khirnov
fc159ba88e mmvideo: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 2.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8543
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 17ba719d9b)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 69a930b988)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 3f10a779b4)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavcodec/mmvideo.c

(cherry picked from commit 03dba25a40)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 11:16:27 +01:00
Anton Khirnov
954aafaa96 jvdec: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 8.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8542
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 88626e5af8)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 55788572ea)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 8f238dd9bd)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavcodec/jvdec.c

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

Conflicts:
	libavcodec/jvdec.c
2014-12-20 11:16:15 +01:00
Diego Biurrun
893b353362 x86: Only use optimizations with cmov if the CPU supports the instruction
Also fill in missing hash for AV_CPU_FLAG_CMOV addition in APIChanges.

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

Conflicts:
	libavcodec/x86/dsputil_mmx.c
2014-09-16 01:48:53 -07:00
Michael Niedermayer
2deac60a38 adpcmenc: Calculate the IMA_QT predictor without overflow
Previously, the value given to put_bits was 10 bits long for positive
predictors, even though 9 bits were to be written. The extra bit could
in some cases overwrite existing bits in the bitstream writer cache.

This fixes a failed assert in put_bits.h, when running a version
built with -DDEBUG.

The fate test result gets slightly improved, thanks to getting rid
of the overwritten bits in the bitstream writer cache.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit aa264da5bf)
Signed-off-by: Diego Biurrun <diego@biurrun.de>

Conflicts:
	tests/ref/fate/acodec-adpcm-ima_qt
2014-08-23 05:19:12 -07:00
Michael Niedermayer
3eed35addb svq1enc: Set picture_structure correctly
This fixes assert failures when running in debug mode.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 2d7d91f06d)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-23 05:19:12 -07:00
Michael Niedermayer
ec0df23765 h264: Remove an assert on current_picture_ptr being null
It is possible in various error paths as well as gap handling
that this has already been allocated. It is not clear why that
would be a problem with the current code, thus disable the
assert to avoid a common assert failure when asserts are enabled.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 5e997688f8)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-23 05:19:12 -07:00
Martin Storsjö
372f742dd1 parser: Don't use pc as context for av_dlog
The ParserContext class doesn't have an AVClass, required for
using it as a logging class.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 6d65496990)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-23 05:19:12 -07:00
Michael Niedermayer
d1c490448c mpegvideo: remove last_picture_ptr / h264 assert.
This assert is no longer true since h264 error concealment needs
last_picture_ptr to be set.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 91672504a4)
Signed-off-by: Diego Biurrun <diego@biurrun.de>

Conflicts:
	libavcodec/mpegvideo.c
2014-08-21 05:40:26 -07:00
Michael Niedermayer
9858a723cb elbg: Fix an assert
It seems the condition was flipped from what was intended.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 2c340596ca)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-21 05:40:26 -07:00
Diego Biurrun
233d1b4861 h264_refs: Fix debug tprintf argument types
(cherry picked from commit 6c5b0517e0)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-20 10:19:33 -07:00
Aaron Colwell
57c36de726 vp8: avoid race condition on segment map.
This change avoids accessing the segment map of the previous frame if
segmentation is not enabled for the current frame. The caller of
decode_mb_mode() only calls ff_thread_await_progress() on the reference
segmentation index array if segmentation is enabled, so Chromium's TSAN
will report a race when accessing this data while segmentation is not
enabled.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 30011bf201)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-19 06:15:26 -07:00
Mans Rullgard
8152b02f33 arm/neon: dsputil: use correct size specifiers on vld1/vst1
Change the size specifiers to match the actual element sizes
of the data.  This makes no practical difference with strict
alignment checking disabled (the default) other than somewhat
documenting the code.  With strict alignment checking on, it
avoids trapping the unaligned loads.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2014-08-17 09:52:39 +02:00
Mans Rullgard
9fa9d471a7 arm: dsputil: prettify some conditional instructions in put_pixels macros
Signed-off-by: Mans Rullgard <mans@mansr.com>
2014-08-17 09:52:23 +02:00
Mans Rullgard
6dd19ffd39 arm: dsputil: fix overreads in put/avg_pixels functions
The vertically interpolating variants of these functions read
ahead one line to optimise the loop.  On the last line processed,
this might be outside the buffer.  Fix these invalid reads by
processing the last line outside the loop.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2014-08-17 09:52:13 +02:00
Mans Rullgard
394f4ee61e pcmenc: set correct bitrate value
This fixes a bogus bitrate value in the header of WAV files with
alaw/ulaw audio.

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

Conflicts:

	libavcodec/pcm.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 20:36:47 +02:00
Michael Niedermayer
497d661262 Merge commit 'b5d7b80a7e' into release/0.10
* commit 'b5d7b80a7e':
  ffv1dec: check that global parameters do not change in version 0/1

Conflicts:
	libavcodec/ffv1.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 20:28:37 +02:00
Michael Niedermayer
8044ab94e4 Merge commit '452e343295' into release/0.10
* commit '452e343295':
  avcodec: Add more missing #includes for ff_get_buffer()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 20:26:07 +02:00
Michael Niedermayer
80a77c0c5b avcodec/libspeexdec: fix missing header includes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 20:13:11 +02:00
Michael Niedermayer
854fa0d1ab Merge commit 'e24d1cbc4e' into release/0.10
* commit 'e24d1cbc4e':
  lavf: Fix leftovers from the ff_get_buffer patch

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 20:01:58 +02:00
Michael Niedermayer
bb015b519e Merge commit '0ab76ddf31' into release/0.10
* commit '0ab76ddf31':
  avcodec: Introduce ff_get_buffer

Conflicts:
	libavcodec/8svx.c
	libavcodec/dpcm.c
	libavcodec/utils.c
	libavcodec/vmdav.c
	libavcodec/yop.c

See: 668494acd8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 19:53:37 +02:00
Michael Niedermayer
688ab26604 Merge commit 'c79cf0129e' into release/0.10
* commit 'c79cf0129e':
  error_concealment: avoid using the picture if not fully setup

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 18:58:09 +02:00
Michael Niedermayer
a2c6cb260f avcodec/svq1dec: Fix multiple bugs from "svq1: do not modify the input packet"
Add padding, clear size, use the correct pointer.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 18:51:33 +02:00
Michael Niedermayer
aed8f48545 Merge commit '9d5f4f0253' into release/0.10
* commit '9d5f4f0253':
  svq1: do not modify the input packet

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 18:51:22 +02:00
Michael Niedermayer
6596f5c3aa Merge commit 'cf6b2a0ad2' into release/0.10
* commit 'cf6b2a0ad2':
  cdgraphics: do not return 0 from the decode function

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 18:47:24 +02:00