68385 Commits

Author SHA1 Message Date
Andreas Cadhalpun
f18fc45d18 avcodec/rv10: check size of s->mb_width * s->mb_height
If it doesn't fit into 12 bits it triggers an assertion.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2578a546183da09d49d5bba8ab5e982dece1dede)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Federico Tomassetti
2684ff3573 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>
(cherry picked from commit 061c489895d29049a88dc6118e4b639a273b31d6)

Conflicts:

	libavcodec/eamad.c
2015-03-21 01:52:52 +01:00
Federico Tomassetti
ea0f616a57 mdec: check for out of bounds read
Bug-Id: CID 1257501
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 2c63081b48d98f3a0d0bed7b0ec3c0347b99144c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Martin Storsjö
51b911e948 configure: Move the .object_arch check to the right place
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit b77e335e441040a40fc6156b8e4a134745d10233)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Martin Storsjö
bb508ddb8b arm: Suppress tags about used cpu arch and extensions
When all the codepaths using manually set .arch/.fpu code is
behind runtime detection, the elf attributes should be suppressed.

This allows tools to know that the final built binary doesn't
strictly require these extensions.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit dcae2e32f7d8a1ca5fb8c1e4aa81313be854dd73)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Vittorio Giovara
9246eb1ec5 aic: Fix decoding files with odd dimensions
Normally the aic decoder finds the proper slice combination (multiple of
some number less than 32) but in case of odd width, it resorts to the
default values, which were actually swapped.
The number of slices is modified to account for such odd width cases.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Michael Niedermayer
c5b2ef3bdf avcodec/tiff: move bpp check to after "end:"
This ensures that all current and future code-pathes get bpp checked

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
07df052d8d doc: avoid the incorrect phrase 'allow to'
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 10fd7ff814f2a35b5b49a9c3b0d426ead6c7e83f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Martin Storsjö
9bb7e2bd90 mxfdec: Fix the error handling for when strftime fails
The str variable is a char ** here.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 6448f15af02f2c3cf0df8cb8237957e426041f2d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Michael Niedermayer
90fa2460c0 avcodec/opusdec: Fix delayed sample value
Fixes out of array access
Fixes: ffmpeg_opus_crash1.ogg

This solution is likely not optimal in terms of error concealment but
its simple and fixes the out of array access.

Found-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Tested-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6c583e9048fe9db2ed4d7bbc75f4f1d76e82761a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Michael Niedermayer
50f5037947 avcodec/opusdec: Clear out pointers per packet
This is safer than to assume that all error pathes cleared them and
nothing will use uncleared pointers.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Michael Niedermayer
21533730fc avcodec/utils: Align YUV411 by as much as the other YUV variants
Fixes out of array accesses
Fixes: ffmpeg_mjpeg_crash2.avi

Found-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Tested-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e3201c38d53d2b8b24d0bc95d726b2cb1752dc12)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Ronald S. Bultje
032476f830 vp9: fix segmentation map retention with threading enabled.
Fixes ticket 4359.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
57c7922331 webp: ensure that each transform is only used once
According to the WebP Lossless Bitstream Specification
"each transform is allowed to be used only once".

If a transform is more than once this can lead to memory
corruption.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Stefano Sabatini
73dd8f0a24 doc/protocols/tcp: fix units of listen_timeout option value, from microseconds to milliseconds
s->listen_timeout is passed to ff_listen_bind(), which accepts a timeout
value expressed in milliseconds.

The unit was incorrectly set in 1b4da43ce02452843a1e9bb976da1a39e18a945c.
(cherry picked from commit 6db20926c32ea297418f1f819585007c6b7b6160)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Steve Lhomme
55637b2e5e fix VP9 packet decoder returning 0 instead of the used data size
See https://trac.videolan.org/vlc/ticket/14022#comment:6

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
e6bc1fe10c avformat/flvenc: check that the codec_tag fits in the available bits
flags is later written with avio_w8 and if it doesn't fit in one byte it
triggers an av_assert2.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
e6b18f5700 avcodec/utils: use correct printf specifier in ff_set_sar
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 732c3ebffaff5005367d7f947fa903f3b6e92f68)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
3791436eb5 avutil/imgutils: correctly check for negative SAR components
These could trigger assert failures previously

Found-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5705dc527687fd84d94c934169b6bd753459744f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
61147f58ab swscale/utils: clear formatConvBuffer on allocation
Fixes use of uninitialized memory
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 007498fc1a639ecee2cda1892cbcff66c7c8c951)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
29e435ca33 avformat/bit: only accept the g729 codec and 1 channel
Other codecs/channel numbers are not supported by this muxer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d0b8640f75ff7569c98d6fdb03d83451104e088c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
0540d5c5fc avformat/bit: check that pkt->size is 10 in write_packet
Ohter packet sizes are not supported by this muxer.

This avoids a null pointer dereference of pkt->data.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eeda2c3de8a8484d9e7d1e47ac836bec850b31fc)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
7f97231d97 avformat/adxdec: check avctx->channels for invalid values
This avoids a null pointer dereference of pkt->data.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7faa40af982960608b117e20fec999b48011e5e0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
4005a71def avformat/adxdec: set avctx->channels in adx_read_header
It is used in adx_read_packet, which currently depends on the decoder/parser setting this value between reading the file header and demuxing the first packet.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 64ea4a0598e7ca61b95cf6c93fd409151a448001)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Dyami Caliri
429347afa7 Fix buffer_size argument to init_put_bits() in multiple encoders.
Several encoders were multiplying the buffer size by 8, in order to get
a bit size. However, the buffer_size argument is for the byte size of
the buffer. We had experienced crashes encoding prores (Anatoliy) at
size 4096x4096.
(cherry picked from commit 50833c9f7b4e1922197a8955669f8ab3589c8cef)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
James Cowgill
a81b6a662a mips/acelp_filters: fix incorrect register constraint
Change register constraint on the v variable from = to +. This was causing GCC
to think that the v variable was never read and therefore not initialize it.

This fixes about 20 fate failures on mips64el.

Signed-off-by: James Cowgill <james410@cowgill.org.uk>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b9de1303a6414174ab2f3bccefa801bfabcf0f88)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
6168fe32f1 avcodec/hevc_ps: Sanity checks for some log2_* values
log2 values which imply numeric overflow are not supported

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
711374b626 avcodec/zmbv: Check len before reading in decode_frame()
Fixes out of array read
Fixes: asan_heap-oob_4d4eb0_3994_cov_3169972261_zmbv_15bit.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1f5c7781e63d6519192ada59c1e36bcecc92791d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
9a63a36dc6 avcodec/h264: Only reinit quant tables if a new PPS is allowed
Fixes null pointer dereference
Fixes: signal_sigsegv_3042097_3007_cov_1741463594_non_monotone_timestamps1.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c23a0e77dd492d6c794f89dbff3a438c95745e70)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
db1a99a209 avcodec/snowdec: Fix ref value check
Fixes integer overflow and out of array read.
Fixes: signal_sigsegv_24169e6_3445_cov_3778346427_snow_chroma_bug.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8f4cbf940212079a34753c7f4d6c6b5a43586d30)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
fe8c81a0f3 swscale/utils: More carefully merge and clear coefficients outside the input
Fixes out of array read
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1895d414aaacece3b57d7bf19502305e9a064fae)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
728051d9b1 avcodec/a64multienc: Assert that the Packet size does not grow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 29bbc1be488ea4fc591d3e0ef12f0fc7c8812afb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
99d58a0da4 avcodec/a64multienc: simplify frame handling code
This also fixes a memleak

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
9783f9fb98 avcodec/a64multienc: fix use of uninitialized values in to_meta_with_crop
Averaging over 2 pixels doesn't work correctly for the last pixel, because the
rest of the buffer is not initialized.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
2ed0a77b7b avcodec/a64multienc: initialize mc_meta_charset to zero
This fixes the use of uninitialized values in avpriv_do_elbg.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
804e1e1610 avcodec/a64multienc: don't set incorrect packet size
This fixes invalid reads of the packet buffer in av_dup_packet

Based on patch by Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
99d2d1404c avcodec/a64multienc: use av_frame_ref instead of copying the frame
This fixes freeing the frame buffer twice on cleanup leading to a crash.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
cb1c9294f3 avcodec/x86/mlpdsp_init: Simplify mlp_filter_channel_x86()
Based on patch by Francisco Blas Izquierdo Riera
Commit message partly taken from carl

fixes a compilation
error in mlpdsp_init.c with -fstack-check and some gcc compilers (I
reproduced the issue with gcc 4.7.3) by simplifying the code.

See also https://bugs.gentoo.org/show_bug.cgi?id=471756

$ make libavcodec/x86/mlpdsp_init.o
libavcodec/x86/mlpdsp_init.c: In function ‘mlp_filter_channel_x86’:
libavcodec/x86/mlpdsp_init.c:142:5: error: can’t find a register in
class ‘GENERAL_REGS’ while reloading ‘asm’
libavcodec/x86/mlpdsp_init.c:142:5: error: ‘asm’ operand has impossible
constraints

4551 -> 4509 dezicycles

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 03f39fbb2a558153a3c464edec1378d637a755fe)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Anton Khirnov
84341627d7 h264: initialize H264Context.avctx in init_thread_copy
This prevents using a wrong (first thread's) AVCodecContext if decoding
a frame in the first pass over all threads fails.
(cherry picked from commit a06b0b1295c51d100101e0ca0434e199ad6de6b5)

Conflicts:

	libavcodec/h264.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
4f694182e0 avformat/omadec: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0f55bc29d41585d110b126cb4ed4b395fd46d7ac)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
a2cfb784fb avformat/vqf: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb08687180683a755d0fe9d425280d0e4d1e6db2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
6faf18acbd avformat/wtvdec: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d44e0d8b930732a4a247b4884d75cf62b4ad3664)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
96807933d8 avformat/mvdec: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 26c0cc154e06cb0064b3a3da49447ac44d82444f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
4ef32aa2a6 avformat/apngdec: Use 64bit for ret to avoid overflow
Missed this hunk in first commit

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Michael Niedermayer
727730e279 avformat/gxf: Use 64bit for res to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 12987f89007ee82b9d3a6090085dfaef8461ab8b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Michael Niedermayer
5a829ee69e avformat/idcin: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d1923d15a3544cbb94563a59e7169291db76b312)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Michael Niedermayer
7fe22c3fe6 avformat/apngdec: Use 64bit ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0e3d6e17dea758fdb7d0adfc57f7655551ab32b3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Michael Niedermayer
c7565b143c avformat/asfdec: Use 64bit ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d4936d28a11fac6c9c4b4df9625185f93b086986)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Rodger Combs
303ecfc373 wtvdec: fix integer overflow resulting in errors with large files
This fixes a regression in 9fbc613f0df1628e7e78bca791fa8833846f8210

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Carl Eugen Hoyos
1456ed2dd5 lavf: Do not list mov-only codecs in riff.c.
Instead check for all mov code-points when demuxing avi
and print a warning if a video codec is found like this.
Fixes ticket #4307.
(cherry picked from commit 2e0b5f5c90a4bc1440703ba5e8bf7139ff42f367)

Conflicts:
	libavformat/riff.c
2015-03-13 09:15:18 +01:00