49523 Commits

Author SHA1 Message Date
Anton Khirnov
cbf51c4d36 matroskadec: pad EBML_BIN data.
It might be passed to code requiring padding, such as lzo decompression.

Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org

(cherry picked from commit 30be1ea33e5525266ad871bed60b1893a53caeaf)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:13:19 -05:00
Anton Khirnov
26221a54ec motionpixels: clip VLC codes.
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org

(cherry picked from commit ca41c72c6d9515d9045bd3b68104525dee81b8d0)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:13:08 -05:00
Anton Khirnov
7c214e313c avidec: fix a memleak in the dv init code.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit ce9bba5340a5fb6f38974a19af019dd6aa2da035)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:12:52 -05:00
Anton Khirnov
7b337b1229 truemotion1: make sure index does not go out of bounds
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org

(cherry picked from commit c918e08b9cc9ce8d06159c51da55ec5ab018039a)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:12:39 -05:00
Anton Khirnov
51ff11647f pcx: round up in bits->bytes conversion in a buffer size check
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org

(cherry picked from commit 430d12196432ded13f011a3bf7690f03c9b2e5d6)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:12:31 -05:00
Michael Niedermayer
35f9a0896e omadec: Fix wrong number of array elements
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: David Goldwich <david.goldwich@gmail.com>
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 97f50e92b5cf3b47a76f75d76ed4340e822030db)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:12:19 -05:00
Michael Niedermayer
cdc47c4813 omadec: check GEOB sizes against buffer size
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: David Goldwich <david.goldwich@gmail.com>
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 1c736bedd9891501960ebac0f7c05eb60225e947)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:12:06 -05:00
Michael Niedermayer
e776a1e8f3 ac3dec: fix outptr increment.
Fixes corrupt data errors when downmixing in the AC-3 decoder.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>

CC:libav-stable@libav.org
(cherry picked from commit 6c82c87dbbc0582658968eae46cfebeea90a9c5e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:11:54 -05:00
Luca Barbato
d6d2617d07 avio: Use AVERROR_PROTOCOL_NOT_FOUND
When the protocol is missing ffurl_alloc() should return
AVERROR_PROTOCOL_NOT_FOUND instead of AVERROR(ENOENT).

Bug-Id: 577
CC: libav-stable@libav.org
(cherry picked from commit ea71aafd6881d7ce5cffec56feb45488e3ac5221)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:08:19 -05:00
Luca Barbato
0e8ae6d10c mpegvideo: Drop a faulty assert
That check is easily reachable by faulty input.

CC:libav-stable@libav.org
Reported-by: Torsten Sadowski <tsadowski@gmx.net>
(cherry picked from commit 72072bf9de3241848ea86f68d2297b7a5d6ad49b)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:08:03 -05:00
Justin Ruggles
24a8dfd37b lavr: check that current_buffer is not NULL before using it
Fixes a segfault during resampling when compiled with -DDEBUG.
Fixes all fate-lavr-resample tests with -DDEBUG.

CC:libav-stable@libav.org
(cherry picked from commit 211ca69b13eb0a127a9ef7e70ddaccdab125d1c5)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:07:46 -05:00
Anton Khirnov
a8f6d93071 pmpdec: check that there is at least one audio packet.
The code cannot handle there being none, but that should not happen for
valid files.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 1b5d065ca722eb8028c7a08e054b6da3419faf5d)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:01:18 -05:00
Anton Khirnov
ffa83bcc49 lzw: switch to bytestream2
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit e89aa4bf56e5b5c45f569eb12733519789e057da)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:01:03 -05:00
Anton Khirnov
819541ff83 gifdec: convert to bytestream2
(cherry picked from commit 1f3e56b6dcc163a705704e98569d4850a31d651c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:00:51 -05:00
Anton Khirnov
c5c7e3e6f7 gifdec: check that the image dimensions are non-zero
Also add an error message an return a more suitable error code
(INVALIDDATA, not EINVAL);
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org

(cherry picked from commit c453723ad7d14abc5e82677eebaa6025fa598f08)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:00:40 -05:00
Anton Khirnov
5e7a5dd70b gifdec: return meaningful error codes.
(cherry picked from commit 048ffb9bb26f30f1995400b8cd3809221ba03441)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 16:59:55 -05:00
Anton Khirnov
f194f2be41 eacmv: check the framerate before setting it.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 24057c83207d6ea8bfd824155ac37be8a33dfd0c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/eacmv.c
2014-01-05 16:57:17 -05:00
Anton Khirnov
343c87ac19 rv30: fix extradata size check.
It has been checking the number of bits in the offset instead of the
actual offset.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit a6a2282c25abe43e352010a7c3fbc92994c0bc1c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 16:52:11 -05:00
Martin Storsjö
12479588d7 sdp: Check that fmt->oformat is non-null before accessing it
This avoids crashes when avserver tries to create an SDP, since
d77f4af.

Addresses: CVE-2012-6617

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 82b9799bb211ecd117171115e4a8b832c4942314)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 16:49:49 -05:00
Aurelien Jacobs
3e089e8f71 matroskadec: use correct compression parameters for current track CodecPrivate
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 8b516f154a0a08655cec2d13d12aadc58cae0b1c)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 16:49:15 -05:00
Kostya Shishkov
5dcc179924 vc1: Reset numref if fieldmode is not set
There are samples in the wild with B-frames and P-frames with different
interlace mode.

CC: libav-stable@libav.org
Reported-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit de44dfc7c0ec02bda7d846ef713145c890bfae3f)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 16:48:34 -05:00
Michael Niedermayer
848af79dec nutenc/write_index: warn if 2 consecutive keyframes have the same PTS and discard the 2nd
This fixes an assertion failure and regression and restores previous behaviour
Fixes Ticket3197

An alternative would be to fail hard in this case and refuse to mux such data.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit de2a2caf4dedb28a959d0ff6f02751bb6c3ff033)
2013-12-24 08:09:53 +01:00
Michael Niedermayer
50ff83e3af Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  arm: Don't clobber callee saved registers in scalarproduct
  alsdec: check block length
  h264/mpegvideo: do not provide pixel formats for hwaccels that are not compiled in
  mpeg4video_parser: init mpeg4 static tables.

Conflicts:
	libavcodec/mpeg4video_parser.c
	libavcodec/mpeg4videodec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 02:43:44 +01:00
Michael Niedermayer
2d7f139155 Merge commit '56eded8bc7bccdf14245bae3a45b0fecf9d9d122' into release/1.1
* commit '56eded8bc7bccdf14245bae3a45b0fecf9d9d122':
  mpeg4videodec: split initializing static tables into a separate function
  x86: ac3dsp: Remove 3dnow version of ff_ac3_extract_exponents
  pthread: Avoid spurious wakeups

Conflicts:
	libavcodec/mpeg4videodec.c
	tests/fate/ac3.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 02:31:41 +01:00
Michael Niedermayer
b589b8a704 Merge commit '1a5a6ac01b0ad2cf3d2128372ea41f3c1cfc2d3f' into release/1.1
* commit '1a5a6ac01b0ad2cf3d2128372ea41f3c1cfc2d3f':
  pthread: Fix deadlock during thread initialization

Conflicts:
	libavcodec/pthread.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 02:14:24 +01:00
Michael Niedermayer
5bd291e265 avfilter/ff_insert_pad: fix order of operations
Fixes out of bounds access
Fixes CID732170
Fixes CID732169

No filter is known to use this function in a way so the issue can be reproduced.

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

Conflicts:

	libavfilter/avfilter.c
(cherry picked from commit 86591b244f3a27293153896813f5569b49b2f5c0)

Conflicts:

	libavfilter/avfilter.c
(cherry picked from commit 400c4f8fa3fd58951dc3f356b2b00484e3363694)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 01:45:20 +01:00
Martin Storsjö
bdb975ab69 arm: Don't clobber callee saved registers in scalarproduct
q4-q7/d8-d15 are supposed to not be clobbered by the callee.

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

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-12-20 21:26:12 +02:00
Reinhard Tartler
3f7d89034b alsdec: check block length
Fix writing over the end

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Addresses: CVE-2013-0845
(cherry picked from commit 2a0fb7286d67c47e44aa76c237ede117b22af616)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-12-14 12:51:40 -05:00
Michael Niedermayer
b8eaf47917 avcodec/cabac: force get_cabac to be not inlined
works around bug in gccs inline asm register assignment
Fixes Ticket3177

gcc from 4.4 to 4.6 is affected at least, no non affected gccs known
clang seems not affected

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0538b29ae8002c44f27bae8a1a6fc6e646998be5)
2013-12-09 10:37:41 +01:00
Anton Khirnov
718a2ddcb8 h264/mpegvideo: do not provide pixel formats for hwaccels that are not compiled in 2013-11-29 20:09:44 +01:00
Anton Khirnov
bd405475ce mpeg4video_parser: init mpeg4 static tables.
They are used when decoding the frame header.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-27 09:51:42 +01:00
Anton Khirnov
56eded8bc7 mpeg4videodec: split initializing static tables into a separate function
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-27 09:47:01 +01:00
Michael Niedermayer
f401e60063 avformat/utils: dont count attached pics toward the probesize
Such pics behave more like headers which we also dont count.
Fixes Ticket3146

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a8dec360c5db15e8da4b44ff3c0f02a6c57e8ac0)
2013-11-18 15:15:37 +01:00
Clément Bœsch
7f174cec8b build: avoid stdin stall with GNU AS probing.
a758c5e added probing for various tools, such as AS. Unfortunately, GNU
AS is reading stdin with -v, and thus configure is stalled with
configure arguments such as --as=as.

Fixes Ticket #1898.
(cherry picked from commit dbb41f93c16cbc65a899a75723c95da51c851cd5)
2013-11-18 15:15:23 +01:00
Diego Biurrun
a3f8c6a427 x86: ac3dsp: Remove 3dnow version of ff_ac3_extract_exponents
The function requires increasing the fuzz factor for the ac3/eac3 encode
tests and even so makes fate fail. It only provides a slight encoding
speedup for legacy CPUs that do not support SSE2. Thus its benefit is not
worth the trouble it creates and fixing it would be a waste of time.
2013-10-31 12:09:55 +01:00
Michael Niedermayer
4c17e20ff0 avformat/utils: do not override pts in h264 when they are provided from the demuxer
Fixes Ticket2143

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1e5271a9fd6ddcceb083f2185a4bbd8d44c9a813)
2013-10-27 19:45:15 +01:00
Michael Niedermayer
6960372475 h264: make flush_change() set mmco_reset
This ensures that frames do not get mixed on context reinits

Fixes Ticket2836

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3c9dd93faa9f3c250428dd0548c075583aa07cc3)
2013-10-26 02:43:50 +02:00
Michael Niedermayer
5bce35d958 avcodec/h264: reduce noisiness of "mmco: unref short failure"
Do not consider it an error if we have no frames and should discard one.
This condition can easily happen when decoding is started from an I frame

Fixes Ticket2811

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

Conflicts:
	libavcodec/h264_refs.c
2013-10-26 01:19:03 +02:00
Michael Niedermayer
8e72a8d1c2 avformat/mp3dec: perform seek resync in the correct direction
Fixes seeking to the last frame in CBR files
Fixes Ticket2773

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ba8716df7fb541fb690d1a898cda0e12f9011faf)
2013-10-26 01:15:06 +02:00
Michael Niedermayer
a4b705b4cb avcodec/h264: do not trust last_pic_droppable when marking pictures as done
This simplifies the code and fixes a deadlock

Fixes Ticket2927
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 29ffeef5e73b8f41ff3a3f2242d356759c66f91f)

Conflicts:
	libavcodec/h264.c
2013-10-26 01:15:00 +02:00
Michael Niedermayer
802c4f5231 avformat/mov: force parsing of headers if stts is absent
Fixes Ticket2991

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e41ea866fc26f38d770bbc1ad67703e7f4400ae1)
2013-10-24 11:23:59 +02:00
Michael Niedermayer
6636dd551f avcodec/h264_refs: modify key frame detection heuristic to detect more cases
Fixes Ticket2968

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

Conflicts:
	libavcodec/h264_refs.c
2013-10-24 11:22:24 +02:00
Michael Niedermayer
8ffdcd04c4 avformat/matroskadec: only set r_frame_rate if the value is within reasonable limits
Fixes Ticket2451

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6853e40106cac769f0641183ea0bdd530ae9a0a1)
2013-10-24 11:14:37 +02:00
Michael Niedermayer
de32de679b avformat/wavdec: Dont trust the fact chunk for PCM
Fixes Ticket3033

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

Conflicts:
	libavformat/wavdec.c
2013-10-24 11:13:59 +02:00
Ben Jackson
311583e779 pthread: Avoid spurious wakeups
pthread_wait_cond can wake up unexpectedly (Wikipedia: Spurious_wakeup).

The FF_THREAD_SLICE thread mechanism could spontaneously execute
jobs or allow the caller of avctx->execute to return before all
jobs were complete.

Test both cases to ensure the wakeup is real.

Signed-off-by: Ben Jackson <ben@ben.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-21 12:25:26 -04:00
Derek Buitenhuis
1a5a6ac01b pthread: Fix deadlock during thread initialization
Sometimes, if pthread_create() failed, then pthread_cond_wait() could
accidentally be called in the worker threads after the uninit function
had already called pthread_cond_broadcast(), leading to a deadlock.

Don't call pthread_cond_wait() if c->done is set.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-10-21 12:25:16 -04:00
Michael Niedermayer
4bc7c1ba8e update for 1.1.7
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
n1.1.7
2013-10-11 15:39:23 +02:00
Michael Niedermayer
0efb4ff86c avcodec/parser: reset indexes on realloc failure
Fixes Ticket2982

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-11 15:36:12 +02:00
Michael Niedermayer
f0bb0aaaa7 avcodec/ffv1enc: update buffer check for 16bps
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3728603f1854b5c79d1a64dd3b41b80640ef1e7f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-11 15:36:12 +02:00
Michael Niedermayer
eb3330b050 Merge remote-tracking branch 'TimothyGu/release/1.1' into release/1.1
* TimothyGu/release/1.1:
  doc/encoders: add doc for AAC encoder
  doc/ffmpeg-formats: Add documentation for 2 parameters that have been missing
  doc/encoders: improve libvo-aacenc doc
  doc/encoders: Remove options that were not there when branch was cut from master
  doc/encoders: reformat and add some clarification in libtwolame doc
  doc/encoders: reformat libmp3lame doc

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-11 15:28:11 +02:00