49523 Commits

Author SHA1 Message Date
Anton Khirnov
03bfd8419f mathematics: remove asserts from av_rescale_rnd()
It is a public function, it must not assert on its parameters.

(cherry picked from commit 94a417acc05cc5151b473abc0bf51fad26f8c5a0)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 23:51:46 -05:00
Michael Niedermayer
3cc8d9bc1f vc1: Always reset numref when parsing a new frame header.
Fixes an issue where the B-frame coding mode switches from interlaced
fields to interlaced frames, causing incorrect decisions in the motion
compensation code and resulting in visual artifacts.

CC: libav-stable@libav.org
Signed-off-by: Tim Walker <tdskywalker@gmail.com>
(cherry picked from commit dd2d0039b6405dc724e4fef0d5b8f49530eea3aa)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 23:51:46 -05:00
Anton Khirnov
299c5dcfb0 h264: reset num_reorder_frames if it is invalid
An invalid VUI is not considered a fatal error, so the SPS containing it
may still be used. Leaving an invalid value of num_reorder_frames there
can result in writing over the bounds of H264Context.delayed_pic.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 9ecabd7892ff073ae60ded3fc0a1290f5914ed5c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/h264_ps.c
2014-02-01 23:51:46 -05:00
Martin Storsjö
44079902c4 mov: Free intermediate arrays in the normal cleanup function
These arrays are normally freed at the end of mov_read_trak,
but make sure they're freed in case mov_read_trak returned
early (due to errors) or in case the atoms that allocate arrays
are encountered at some other point than within a trak (which
we don't have checks against).

Sample-Id: 00000496-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit d51f09962d5b4bc999fb70c040f330dd1873212e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 23:51:45 -05:00
Martin Storsjö
a1b4d42d31 mov: Free an earlier allocated array if allocating a new one
It could probably also be considered an error if the pointer isn't
null at this point, but then we might risk rejecting some
slightly broken files that we might have handled so far.

Sample-Id: 00000496-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 2620df13104ddaa136158eb6bb1195adbf9d7692)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 23:51:45 -05:00
Anton Khirnov
f728782c0d segafilm: fix leaks if reading the header fails
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 6892d145a0c80249bd61ee7dd31ec851c5076bcd)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 23:51:45 -05:00
Luca Barbato
c85e5f13f6 cavs: Check for negative cbp
Sample-Id: 00000647-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-02-01 14:59:50 -05:00
Luca Barbato
f1476459b7 vmnc: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-02-01 14:59:50 -05:00
Anton Khirnov
b5275ca1a8 h264_cavlc: check the size of the intra PCM data.
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-01 14:59:50 -05:00
Luca Barbato
3485a07977 avi: DV in AVI must be considered single stream
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-02-01 14:59:50 -05:00
Michael Niedermayer
d9c82cea11 h263: Check init_get_bits return value
And use init_get_bits8 to check for integer overflows while at it.

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-02-01 14:59:50 -05:00
Luca Barbato
4b24eb1a03 vmnc: Check the cursor dimensions
And manage the reallocation failure path.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 5e992a4682d2c09eed3839c6cacf70db3b65c2f4)
2014-02-01 14:59:50 -05:00
Anton Khirnov
969028870c cavsdec: check ff_get_buffer() return value
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-01 14:59:50 -05:00
Luca Barbato
9f9e773881 vmnc: Port to bytestream2
Fix some buffer overreads.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-02-01 14:59:50 -05:00
Michael Niedermayer
10d48fe6d3 flashsv: Check diff_start diff_height values
Fix out of array accesses.

Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Adresses: CVE-2013-7015
(cherry picked from commit 57070b1468edc6ac8cb3696c817f3c943975d4c1)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 13:56:58 -05:00
Michael Niedermayer
af9799790d dsputil/pngdsp: fix signed/unsigned type in end comparison
Fixes out of array accesses and integer overflows.

(cherry picked from commit d1916d13e28b87f4b1b214231149e12e1d536b4b)
Adresses: CVE-2013-7010, CVE-2013-7014

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 13:53:41 -05:00
Michael Niedermayer
6fa9741357 avcodec/aacdec: Dont fail if channels arent known yet
Fixes Ticket3312

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

Conflicts:
	libavcodec/aacdec.c
2014-01-19 14:58:22 +01:00
Michael Niedermayer
bb26a88193 avcodec/mjpegdec: Dont treat the lack of a startcode differently from end of the bitstream
Fixes Ticket3303

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 31e703e899bee74c50efd8eb62c3d012ef5ab26d)
2014-01-19 14:57:56 +01:00
Michael Niedermayer
55a4228ac2 avcodec/mjpegdec: only run EOI emulation code when there was a scan
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 361e27a3d8096baacc45d2551a1ebfcbfdaa6a67)
2014-01-19 14:56:18 +01:00
Michael Niedermayer
3ae81880e1 avcodec/mjpegdec: update cur_scan also for non-LS jpeg
This should make no difference but the variable will be used in a subsequent commit

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

Conflicts:
	libavcodec/mjpegdec.c
2014-01-19 14:56:08 +01:00
Anton Khirnov
8575f5362f lavf: make av_probe_input_buffer more robust
Always use the actually read size as the offset instead of making
possibly invalid assumptions.

Addresses: CVE-2012-6618

(cherry picked from commit 2115a3597457231a6e5c0527fe0ff8550f64b733)

Conflicts:
	libavformat/utils.c

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-13 15:32:24 +01:00
Anton Khirnov
539d255871 lavf: use a fixed width type
It's shorter and more consistent with the rest of the code.

(cherry picked from commit 8b76362836f3c373c3aadc544522edcbef16dd5f)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-13 15:32:17 +01:00
Anton Khirnov
e38c62fe0c lavf: simplify handling of offset in av_probe_input_buffer()
(cherry picked from commit c1868e7ee7b07b40a0fe15f50df89fe499a01a50)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-13 15:24:08 +01:00
Michael Niedermayer
1017b5914c update for 1.1.8
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
n1.1.8
2014-01-13 15:20:18 +01:00
Michael Niedermayer
9f47f95e70 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  prores: Error out only on surely incomplete ac_coeffs

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 15:14:13 +01:00
Luca Barbato
9aa22918c2 prores: Error out only on surely incomplete ac_coeffs
(cherry picked from commit 2df7f7714a12a59d31058aba15fb1e348e36b0ab)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-13 14:18:37 +01:00
Michael Niedermayer
9b89824f20 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  shorten: Fix out-of-array read

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-12 17:06:54 +01:00
Michael Niedermayer
f479c17894 Merge commit '65830277d2d2ee3658e1f070a61044fff261ed3e' into release/1.1
* commit '65830277d2d2ee3658e1f070a61044fff261ed3e':
  prores: Add a codepath for decoding errors
  nut: Fix unchecked allocations
  avi: directly resync on DV in AVI read failure
  mov: Don't allocate arrays with av_malloc that will be realloced
  shorten: Extend fixed_coeffs to properly support pred_order 0
  Prepare for 9.11 RELEASE
  avi: properly fail if the dv demuxer is missing
  prores: Reject negative run and level values
  audio_mix: fix channel order in mix_1_to_2_fltp_flt_c
  indeo4: Check the inherited quant_mat

Conflicts:
	RELEASE
	libavcodec/indeo4.c
	libavcodec/shorten.c
	libavformat/nut.c
	libavformat/nutdec.c
	libavformat/nutenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-12 16:51:26 +01:00
Michael Niedermayer
1203e92181 Merge commit '0358a099f8abe60230dc2e5bec59bfceb7d1be07' into release/1.1
* commit '0358a099f8abe60230dc2e5bec59bfceb7d1be07':
  indeo4: Check the block size if reusing the band configuration
  ffv1: Assume bitdepth 0 means 8bit
  alsa-audio-dec: explicitly cast the delay to a signed int64
  matroskadec: pad EBML_BIN data.
  motionpixels: clip VLC codes.
  avidec: fix a memleak in the dv init code.

Conflicts:
	libavcodec/ffv1dec.c
	libavcodec/indeo4.c
	libavdevice/alsa-audio-dec.c
	libavformat/matroskadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-12 16:37:42 +01:00
Michael Niedermayer
c693ccb89a Merge commit '7b337b122959b9bf634c31b549892df974f35b40' into release/1.1
* commit '7b337b122959b9bf634c31b549892df974f35b40':
  truemotion1: make sure index does not go out of bounds
  pcx: round up in bits->bytes conversion in a buffer size check
  omadec: Fix wrong number of array elements
  omadec: check GEOB sizes against buffer size
  ac3dec: fix outptr increment.
  avio: Use AVERROR_PROTOCOL_NOT_FOUND

Conflicts:
	libavcodec/ac3dec.c
	libavcodec/pcx.c
	libavformat/omadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-12 16:16:58 +01:00
Michael Niedermayer
7e34379897 Merge commit '0e8ae6d10c609bb968c141aa2436413a55852590' into release/1.1
* commit '0e8ae6d10c609bb968c141aa2436413a55852590':
  mpegvideo: Drop a faulty assert
  lavr: check that current_buffer is not NULL before using it
  pmpdec: check that there is at least one audio packet.
  lzw: switch to bytestream2
  gifdec: convert to bytestream2

Conflicts:
	libavcodec/gifdec.c
	libavcodec/lzw.c
	libavcodec/lzw.h
	libavformat/pmpdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-12 16:08:27 +01:00
Michael Niedermayer
ce795ac0f5 Merge commit 'c5c7e3e6f7cf17943c04bd078f260eaf789afbc9' into release/1.1
* commit 'c5c7e3e6f7cf17943c04bd078f260eaf789afbc9':
  gifdec: check that the image dimensions are non-zero
  gifdec: return meaningful error codes.
  eacmv: check the framerate before setting it.
  rv30: fix extradata size check.
  sdp: Check that fmt->oformat is non-null before accessing it
  matroskadec: use correct compression parameters for current track CodecPrivate
  vc1: Reset numref if fieldmode is not set

Conflicts:
	libavcodec/gifdec.c
	libavcodec/rv30.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-12 15:48:39 +01:00
Michael Niedermayer
5ea2a8d43e avcodec/msvideo1enc: fix SKIPS_MAX
Fixes Ticket3270

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fb8f5d0510619cea2204246631f1c0dcd994ee25)
2014-01-09 11:52:48 +01:00
Carl Eugen Hoyos
3ada932202 Use the h264 parser when decoding VSSH in avi.
Fixes ticket #3261 visually.

Analyzed-by: Michael Doilnitsyn
(cherry picked from commit 94cf4f8bac12c58e30ce3b5d72cf5898baafe9a8)

Conflicts:
	libavformat/avidec.c
2014-01-09 11:52:19 +01:00
Michael Niedermayer
adb784ad86 avformat/mxfdec: detect loops during header parsing
The header parser uses forward and backward parsing, making the
bulletproof prevention of loops difficult, thus this simple
detection code.
If someone improves the forward/backward parsing so it cannot loop
then this commit should be reverted

Fixes Ticket3278

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1c010fd035c1a14dc73827b84f21f593e969a5d6)
2014-01-09 11:51:32 +01:00
Michael Niedermayer
4de4eb60a1 avformat/oggdec: dont read timestamps from EOS pages of ogm videos
Some muxers store invalid timestamps there, which breaks seeking
Fixes Ticket2739

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5e0c7eab2a9d43e6e3be967ec1a6b04a3e0328da)
2014-01-09 11:50:29 +01:00
Tim Walker
a0866c7129 shorten: Fix out-of-array read
pred_order == FF_ARRAY_ELEMS(fixed_coeffs) is invalid too.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 5f5ada3dbf97e306a74250ba8dcf8619ad59b020)
Signed-off-by: Tim Walker <tdskywalker@gmail.com>
2014-01-06 16:36:56 +01:00
Luca Barbato
65830277d2 prores: Add a codepath for decoding errors
(cherry picked from commit 44690dfa683f620c77e9f0e8e9bc5682608636b1)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-01-06 02:31:17 +00:00
Derek Buitenhuis
5ae7ed3aa4 nut: Fix unchecked allocations
CC: libav-stable@libav.org

(cherry picked from commit b1fcdc08ceb5df69fac34aa0d57c56905d32b8b4)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-01-06 02:31:05 +00:00
Luca Barbato
61057f4604 avi: directly resync on DV in AVI read failure
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit ceec6e792e4b5baaa23b220f4fd33417631f5288)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:34:06 -05:00
Martin Storsjö
d149c14a22 mov: Don't allocate arrays with av_malloc that will be realloced
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit b698542ad83284fbb8c22404e3cafeb2dd739d38)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:31:06 -05:00
Luca Barbato
5bbee02ae0 shorten: Extend fixed_coeffs to properly support pred_order 0
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit b2148faca9e9e553c14b27844b56e367c85a777e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:30:53 -05:00
Reinhard Tartler
f53a5332b0 Prepare for 9.11 RELEASE 2014-01-05 17:23:12 -05:00
Luca Barbato
e361fde8b0 avi: properly fail if the dv demuxer is missing
CC: libav-stable@libav.org
(cherry picked from commit 1cac9accbd1f9b8596122d0735e37b97a844c514)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:21:47 -05:00
Luca Barbato
1d7a453dcf prores: Reject negative run and level values
Sample-Id: 00000611-google

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit c0de9a23c7080e2fac8f879b9d9a0ce2b64ea953)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:21:35 -05:00
Anton Khirnov
481e55eba7 audio_mix: fix channel order in mix_1_to_2_fltp_flt_c
CC:libav-stable@libav.org
(cherry picked from commit df6737a55f5dc7c0ae5272bc5fa6182836d5481c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:21:24 -05:00
Luca Barbato
03457cabd6 indeo4: Check the inherited quant_mat
Invalidate it if not supported.

Sample-Id: 00000262-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit c9ef6b09326a24010bf86d6b0d19cfa42df4d546)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/indeo4.c
2014-01-05 17:21:07 -05:00
Luca Barbato
0358a099f8 indeo4: Check the block size if reusing the band configuration
Sample-Id: 00000287-google

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 0cb83c563848bf8f8365e7bd30e7e6b57ef360f0)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:16:42 -05:00
Luca Barbato
2656036757 ffv1: Assume bitdepth 0 means 8bit
CC: libav-stable@libav.org
Reported-by: debian/726189
(cherry picked from commit a90905db2e6ab1840890f3a88bfd3bf008b9d886)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:15:41 -05:00
Anton Khirnov
f9f2591beb alsa-audio-dec: explicitly cast the delay to a signed int64
Otherwise the expression will be evaluated as unsigned, which will break
when the result should be negative.
CC:libav-stable@libav.org

(cherry picked from commit 089fac77a6bf9199a5ec161e9c27850f0a680541)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:15:04 -05:00