Commit Graph

66883 Commits

Author SHA1 Message Date
Andreas Cadhalpun
1a8b4158c5 alsdec: ensure channel reordering is reversible
If the same idx is used for more than one i, at least one entry in
sconf->chan_pos remains uninitialized.

This can cause segmentation faults.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Michael Niedermayer
b28fab2ebe avcodec/atrac3plusdsp: fix on stack alignment
Fixes fate failure on ARM
(cherry picked from commit 38f6726068)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Andreas Cadhalpun
6b1c8797f4 ac3: validate end in ff_ac3_bit_alloc_calc_mask
This fixes an invalid read if end is 0:
     band_end   = ff_ac3_bin_to_band_tab[end-1] + 1;

Depending on what is before the array, this can cause stack smashing,
when band_end becomes too large.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Andreas Cadhalpun
6458ee5af8 aacpsy: avoid psy_band->threshold becoming NaN
If band->thr is 0.0f, the division is undefined, making norm_fac not a
number or infinity, which causes psy_band->threshold to become NaN.

This is passed on to other variables until it finally reaches
sce->sf_idx and is converted to an integer (-2147483648).

This causes a segmentation fault when it is used as array index.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: Claudio Freire <klaussfreire@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e224aa4191)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Andreas Cadhalpun
cfbfe6cd4d aasc: return correct buffer size from aasc_decode_frame
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0be54ad280)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Andreas Cadhalpun
d2ff2c9dd3 aacdec: consistently use avctx for logging in decode_eld_specific_config
ac may be NULL and then accessing ac->avctx results in a segmentation fault.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Andreas Cadhalpun
65b257b21c msrledec: use signed pixel_ptr in msrle_decode_pal4
This fixes segmentation faults, when pic->linesize[0] is negative.
In that case 'line * pic->linesize[0] + pixel_ptr' is treated as
unsigned and wraps around.

This reverts commit 7d78a964.
The problem was introduced in commit f7e1367f, which should obsolete
that commit.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Michael Niedermayer
164ababc62 swresample/swresample-test: Randomly wipe out channel counts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ff50b1b13b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Michael Niedermayer
115961acc1 swresample: Check channel layouts and channels against each other and print human readable error messages
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3c77bb5f23)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Michael Niedermayer
6a87a152e8 swresample: Allow reinitialization without ever setting channel layouts
(cherry picked from commit 80a28c7509)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Michael Niedermayer
72ddcb2459 swresample: Allow reinitialization without ever setting channel counts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d7b9cb2f7a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Michael Niedermayer
fd90005b46 avcodec/h264: Do not fail with randomly truncated VUIs
Fixes Ticket4445

Tested-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bc48c88918)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Michael Niedermayer
cf80856cbc avcodec/h264_ps: Move truncation check from VUI to SPS
This more completely checks for truncation

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Michael Niedermayer
9c4b09c4bd avcodec/h264: Be more tolerant to changing pps id between slices
Fixes Ticket4446

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

Conflicts:

	libavcodec/h264.c
(cherry picked from commit 0cd0fa9d0baabd2dc0442ed8b53ba65282733b61)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Michael Niedermayer
2adcdf5084 avcodec/aacdec: Fix storing state before PCE decode
Fixes Ticket4460

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Michael Niedermayer
4191e01e99 avcodec/h264: reset the counts in the correct context
Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8f8d632220100bfde26587b27da73901b05cb774)
2015-04-25 15:06:54 +02:00
Michael Niedermayer
e617d6f988 avcodec/h264_slice: Dont reset mb_aff_frame per slice
Fixes null pointer dereference
Fixes Ticket4440

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

Conflicts:

	libavcodec/h264_slice.c
(cherry picked from commit ce6d38e9ed0842870f3cd5414937bb6d1f2417d9)
2015-04-25 15:06:54 +02:00
Timothy Gu
155e0e9fd9 tests: Fix test name for pixfmts tests(cherry picked from commit e1ee0521a6)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Michael Niedermayer
7493c54ad0 avcodec/h264: finish previous slices before switching to single thread mode
Fixes null pointer dereference
Fixes Ticket4438

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

Conflicts:

	libavcodec/h264.c
(cherry picked from commit 09cc7aee3f4d1bd1d7107d38520f782c62c14036)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Michael Niedermayer
27993da8e7 avcodec/h264: Fix race between slices where one overwrites data from the next
Fixes non deterministic crash in ticket4408/fuzz2.264
Likely fixes other samples as well

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

Conflicts:

	libavcodec/h264.h
	libavcodec/h264_slice.c
(cherry picked from commit dbbc42858e87cdd04e6c3b7694f8b394d4bfcdc6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:54 +02:00
Michael Niedermayer
d7071efae4 avformat/utils: avoid discarded streams in av_find_default_stream_index()
Fixes Ticket2010

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:53 +02:00
Michael Niedermayer
81e4b6f11a avformat/utils: Ensure that AVFMT_FLAG_CUSTOM_IO is set before use
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ba631b7914)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:53 +02:00
Michael Niedermayer
8c832e3cc0 avformat/img2dec: do not rewind custom io buffers
Fixes double free with some applications

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 15:06:53 +02:00
Timothy Gu
0014b24373 fate: Include branch information in the payload header
The server is properly equiped not to choke on that now.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-24 04:54:59 +02:00
Michael Niedermayer
0b71cedfe8 Merge commit '3e1c9da38b849ce2982b516004370081fdd89ed0' into release/2.4
* commit '3e1c9da38b849ce2982b516004370081fdd89ed0':
  matroskadec: fix crash when parsing invalid mkv

See: d9fe6b926c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-19 16:13:27 +02:00
Thomas Guillem
3e1c9da38b matroskadec: fix crash when parsing invalid mkv
CC: libav-stable@libav.org

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit b8d7f3186e)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-04-18 16:50:30 +02:00
James Almer
3a5b4afd91 doc: add aarch64 cpuflags to fftools documentation
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 9fc45681e0)
2015-04-11 16:29:51 -03:00
James Almer
4b817e2fff doc: add missing arm cpuflags to fftools documentation
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 666ec9bd09)
2015-04-11 16:29:49 -03:00
James Almer
5598d62a07 doc: add missing x86 cpuflags to fftools documentation
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 410c93cfd5)
2015-04-11 16:29:47 -03:00
Michael Niedermayer
4347cf9f0f Merge commit '420aa06a2487469259a04f9be66fd15535372796' into release/2.4
* commit '420aa06a2487469259a04f9be66fd15535372796':
  avconv: do not overwrite the stream codec context for streamcopy

Conflicts:
	ffmpeg.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 16:08:29 +02:00
Michael Niedermayer
17b27a7cbe ffmpeg: Fix extradata allocation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4d02dfbde4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 16:07:48 +02:00
Anton Khirnov
420aa06a24 avconv: do not overwrite the stream codec context for streamcopy
Since we are not doing encoding, there is no point in ever touching the
separate encoding context. Always use the stream codec context.

Fixes writing attachments.

CC:libav-devel@libav.org
(cherry picked from commit 3892bdab9b)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	avconv.c
2015-04-05 09:26:54 +02:00
Michael Niedermayer
2c8c55195d Update for 2.4.8
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-30 01:28:28 +02:00
James Almer
e74ad9035f avutil/cpu: add missing check for mmxext to av_force_cpu_flags
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 1f5d1eed78)
2015-03-28 22:10:57 -03:00
Michael Niedermayer
539172c85b avcodec/msrledec: restructure msrle_decode_pal4() based on the line number instead of the pixel pointer
Fixes out of array access
Fixes: da14e86d8462be6493eab16bc2d40f88/asan_heap-oob_204cfd2_528_cov_340150052_COMPRESS.BMP

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-29 03:34:23 +02:00
Michael Niedermayer
2049d95f2f avcodec/hevc_ps: Check cropping parameters more correctly
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 06c70d4537)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-29 03:34:23 +02:00
Michael Niedermayer
760c384f7d 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-29 03:34:23 +02:00
Michael Niedermayer
17e6d249b7 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-29 03:34:23 +02:00
Michael Niedermayer
e0975c31f1 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-29 03:34:23 +02:00
Michael Niedermayer
e168db3eae 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-29 03:34:23 +02:00
Christophe Gisquet
b9b56ded7d 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-29 03:34:23 +02:00
Christophe Gisquet
691f9dee00 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-29 03:34:23 +02:00
Christophe Gisquet
40dab45050 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-29 03:34:23 +02:00
Andreas Cadhalpun
f45f3f99a4 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-29 03:34:22 +02:00
Michael Niedermayer
f11afe6bc6 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-29 03:34:22 +02:00
Michael Niedermayer
8639c37d2b 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-29 03:34:22 +02:00
Andreas Cadhalpun
de2f46c59d 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-29 03:34:22 +02:00
Andreas Cadhalpun
7b3d8ae32d 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-29 03:34:22 +02:00
Michael Niedermayer
7700947525 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-29 03:34:22 +02:00
Andreas Cadhalpun
820b84d065 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-29 03:34:22 +02:00