Commit Graph

68405 Commits

Author SHA1 Message Date
Michael Niedermayer
4be1cc7b1d Update for 2.5.5
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 02:35:00 +01:00
Michael Niedermayer
61dbd3f3d0 avcodec/dnxhddec: Check that the frame is interlaced before using cur_field
Fixes Ticket4227

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:53 +01:00
Michael Niedermayer
38d6ff31b7 avformat/mov: Disallow ".." in dref unless use_absolute_path is set
as this kind of allows to circumvent it to some extend.
We also could add a separate parameter or value to choose this

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:53 +01:00
Michael Niedermayer
b0cd6fb590 avformat/mov: Check for string truncation in mov_open_dref()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8003816e16)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:53 +01:00
Michael Niedermayer
50fd06ea32 avformat/mov: Use sizeof(filename) instead of a literal number
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 21a53dd08d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:53 +01:00
Christophe Gisquet
808d5444c4 eac3dec: fix scaling
This is the remaining error, the output on the SPX samples,
respectively csi_miami_stereo_128_spx.eac3 and
csi_miami_5.1_256_spx.eac3, goes from:
stddev:    8.71 PSNR: 77.52 MAXDIFF:  235
stddev:24270.51 PSNR: 22.17 MAXDIFF:47166
to:
stddev:    0.12 PSNR:114.12 MAXDIFF:    1
stddev:    0.12 PSNR:114.73 MAXDIFF:    1

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:53 +01:00
Christophe Gisquet
6915dd49c7 ac3_fixed: fix computation of spx_noise_blend
It was set to 1 instead of sqrt(3)

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:53 +01:00
Christophe Gisquet
c657b08fd7 ac3_fixed: fix out-of-bound read
Should also improve decoding, but actually doesn't...

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
6d14bea8b5 ac3dec_fixed: always use the USE_FIXED=1 variant of the AC3DecodeContext
The AC3DecodeContext has a float (USE_FIXED=0) and an integer
(USE_FIXED=1) variant, both of which can be present in the same binary.
This is not only very confusing, but it also breaks horribly, when one
variant is used by code expecting the other.

This currently happens, because eac3dec.c is only compiled for the float
variant, but also used from ac3dec_fixed.c, which uses the integer
variant.

The result is memory corruption, leading to crashes.

So compile eac3dec.c once for each variant and adapt it, so that it
works with the integer variant.

A loss of precission and scaling bug has been fixed by the committer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7b05b5093e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Michael Niedermayer
749cd89ca9 avcodec/012v: redesign main loop
Fixes out of array accesses
Fixes: ffmpeg_012v_crash.ts

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Michael Niedermayer
2b408d257f avcodec/012v: Check dimensions more completely
Fixes division by 0

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
8d853dc341 asfenc: fix leaking asf->index_ptr on error
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2c8cff2be4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
86960b1101 roqvideoenc: set enc->avctx in roq_encode_init
So far it is only set in roq_encode_frame, but it is used in
roq_encode_end to free the coded_frame. This currently segfaults if
roq_encode_frame is not called between roq_encode_init and
roq_encode_end.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Michael Niedermayer
94354e368d avcodec/options_table: remove extradata_size from the AVOptions table
allowing access to the size but not the extradata itself is not useful
and could lead to potential problems if writing happens through this field

Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Reviewed-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1f4088b285)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
93a0682b1d ffmdec: limit the backward seek to the last resync position
If resyncing leads to the same position as previously, it will again
lead to a resync attempt, resulting in an infinite loop.

Thus don't seek back beyond the last syncpoint.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
0e16c3843a ffmdec: make sure the time base is valid
A negative time base can trigger assertions.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
819955f0c6 ffmdec: fix infinite loop at EOF
If EOF is reached, while skipping bytes, avio_tell(pb) won't change
anymore, resulting in an infinite loop.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
b36bda3c82 ffmdec: initialize f_cprv, f_stvi and f_stau
They are used in a switch statement, but it is not guaranteed that the
COMM case (where they are set to 0) is reached before the other cases.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
25b8d52fdd avformat/rm: limit packet size
The chunk size is limited to 0xFFFF (written by avio_wb16), so make
sure that the packet size is not too large.

Such large frames need to be split into slices smaller than 64 kB, but
that is currently supported neither by the rv10/rv20 encoders nor the rm
muxer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>

See Ticket244

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
1a2aaa7497 avcodec/webp: validate the distance prefix code
According to the WebP Lossless Bitstream Specification the highest
allowed value for a prefix code is 39.

If prefix_code is too large, the calculated extra_bits has an invalid
value and triggers an assertion in get_bits.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
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 2578a54618)

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 061c489895)

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 2c63081b48)

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 b77e335e44)

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 dcae2e32f7)

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 e878ec0d47)

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 d5e9fc7821)

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 10fd7ff814)

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 6448f15af0)

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 6c583e9048)

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 1ae092587f)

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 e3201c38d5)

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 efff3854f0)

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 c089e720c1)

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 1b4da43ce0.
(cherry picked from commit 6db20926c3)

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 4851db80a4)

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 e8565d21c2)

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 732c3ebffa)

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 5705dc5276)

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 007498fc1a)

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 d0b8640f75)

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 eeda2c3de8)

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 7faa40af98)

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 64ea4a0598)

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 50833c9f7b)

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 b9de1303a6)

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 205b2ba3d6)

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 1f5c7781e6)

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 c23a0e77dd)

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 8f4cbf9402)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00