67344 Commits

Author SHA1 Message Date
Andreas Cadhalpun
933ae708c5 matroskadec: validate audio channels and bitdepth
In the TTA extradata re-construction the values are written with
avio_wl16 and if they don't fit into uint16_t, this triggers an
av_assert2 in avio_w8.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:38:25 +02:00
Michael Niedermayer
e588252a42 avcodec/dpxenc: implement write16/32 as functions
Fixes undefined behavior and segfault

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:38:25 +02:00
Andreas Cadhalpun
7de7d81ee5 postproc: fix unaligned access
QP_store is only 8-bit-aligned, so accessing it as uint32_t causes
SIGBUS crashes on sparc.
The AV_RN32/AV_WN32 macros only do unaligned access in the
HAVE_FAST_UNALIGNED case.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:38:25 +02:00
wm4
9d0aa058c9 avio: fix potential crashes when combining ffio_ensure_seekback + crc
Calling ffio_ensure_seekback() if ffio_init_checksum() has been called
on the same context can lead to out of bounds memory accesses and
crashes. The reason is that ffio_ensure_seekback() does not update
checksum_ptr after reallocating the buffer, resulting in a dangling
pointer.

This effectively fixes potential crashes when opening mp3 files.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:38:25 +02:00
Andreas Cadhalpun
5302adb323 h264: er: Copy from the previous reference only if compatible
Also use the frame pixel format instead of the one from the codec
context, which is more robust.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit fdc64a104410f5fcc7f35b62287b0ae502b7061a)

Conflicts:

	libavcodec/h264_slice.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:12 +02:00
Andreas Cadhalpun
c5dd6fefd4 sonic: set avctx->channels in sonic_decode_init
Otherwise it can be 0 in sonic_decode_frame, causing SIGFPE crashes.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:12 +02:00
Andreas Cadhalpun
13a9a0c1a4 vp8: change mv_{min,max}.{x,y} type to int
If one of the dimensions is larger than 8176, s->mb_width or
s->mb_height is larger than 511, leading to an int16_t overflow of
s->mv_max.{x,y}. This then causes av_clip to be called with amin > amax.

Changing the type to int avoids the overflow and has no negative
effect, because s->mv_max is only used in clamp_mv for clipping.
Since mv_max.{x,y} is positive and mv_min.{x,y} negative, av_clip can't
increase the absolute value. The input to av_clip is an int16_t, and
thus the output fits into int16_t as well.

For additional safety, s->mv_{min,max}.{x,y} are clipped to int16_t range
before use.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 6fdbaa2b7fb56623ab2163f861952bc1408c39b3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:12 +02:00
Andreas Cadhalpun
9da5ba1f57 vp9: change type of tile_size from unsigned to int64_t
Otherwise the check 'tile_size < size' treats a negative size as
unsigned, causing the check to pass. This subsequently leads to
segmentation faults.

This was originally fixed as part of Libav commit 72ca83, so the
original author is one of the following developers:
        Anton Khirnov <anton@khirnov.net>
        Diego Biurrun <diego@biurrun.de>
        Luca Barbato <lu_zero@gentoo.org>
        Martin Storsjö <martin@martin.st>

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit b18eac7ff22332c9344769af15f7b245dd13cc64)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:12 +02:00
Andreas Cadhalpun
8c8406462b arm: only enable setend on ARMv6
Without this check it causes SIGILL crashes on ARMv5.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:12 +02:00
Andreas Cadhalpun
18aef7c075 libopenjpegdec: check existence of image component data
libopenjpeg can return images with components without data.

This fixes segmentation faults.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:12 +02:00
Andreas Cadhalpun
cd83ff5d4c mov: abort on EOF in ff_mov_read_chan
Otherwise the loop can take a lot of time if num_descr is very large.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit a5718863da99b54b6c853d45c84871c4a96a57c0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:12 +02:00
Michael Niedermayer
22349b9f7d ffmpeg_opt: Check for localtime() failure
Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8e91d9652ea5048d9014e7636e12c6ed4732d7b7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:12 +02:00
Deliang Fu
d54ca4167c avformat: Fix bug in parse_rps for HEVC.
Make the logic in libavformat/hevc.c parse_rps align with libavcodec/hevc_ps.c ff_hevc_decode_short_term_rps

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:12 +02:00
Andreas Cadhalpun
670832e2a2 takdec: ensure chan2 is a valid channel index
If chan2 is not smaller than the number of channels, it can cause
segmentation faults due to dereferencing a NULL pointer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 05c57ba2f42324da2fdc93d83d65bb68dd637613)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:11 +02:00
Michael Niedermayer
6ff5c4cd49 avcodec/h264_slice: Use AVFrame diemensions for grayscale handling
The AVFrame values are closer to the AVFrame bitmap changed instead of
the AVCodecContext values, so this should be more robust

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

Conflicts:

	libavcodec/h264_slice.c
2015-08-20 14:29:11 +02:00
Michael Niedermayer
402f832984 avdevice/lavfi: do not rescale AV_NOPTS_VALUE in lavfi_read_packet()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 913685f55208efd78bfc34d82b261bd449e69774)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:11 +02:00
Simon Thelen
d768242152 libavutil/channel_layout: Correctly return layout when channel specification ends with a trailing 'c'.
Return layout when FF_API_GET_CHANNEL_LAYOUT_COMPAT is set even if the
layout itself is not in the deprecated style.

Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 83307a32eb0c9f0843f655c44bb65e3e999153f8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:11 +02:00
Michael Niedermayer
84cf741861 avcodec/jpeg2000dec: Check that coords match before applying ICT
This avoid potential out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:11 +02:00
Michael Niedermayer
8fc8b3eebe avformat/ffmdec: Check ffio_set_buf_size() return value
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dc55477a64cefebf8dcc611f026be71382814ae2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:11 +02:00
Michael Niedermayer
5709ac5c42 avcodec/adpcm: Check for overreads
See: vlc ticket 14649
Reported-by: carl
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3c803ed9cb23e5a8d76b6c31d8a8c71cac27e769)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:11 +02:00
Michael Niedermayer
4121c1db15 avcodec/alsdec: Check for overread
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c2657633187e325a439e3297fd9ccd0522ab2e39)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:11 +02:00
Michael Niedermayer
0081afeaa7 avcodec/atrac3plusdec: consume only as many bytes as available
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6b6ae7c3ead5dee786a4aea929820076a7c82da4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:11 +02:00
Michael Niedermayer
df2258f18d swresample/swresample: Cleanup on init failure.
This avoids leaks if the user doest call swr_close() after a failed init

Found-by: James Almer <jamrial@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c3f87f7545d42520921bc448b9fbd7324c574e49)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:11 +02:00
Michael Niedermayer
8498cf60b2 Revert "avformat/rtpenc: check av_packet_get_side_data() return, fix null ptr dereference"
This was simply wrong

Found-by: Martin Storsjö
This reverts commit 5d8e4f6da03c0342157e6ac7fab1a8ac3a87a8b0.
(cherry picked from commit 3e34b7498f14c04baadde1700a6f73a7e9e86fa6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:11 +02:00
Michael Niedermayer
3943086656 avformat/mxfenc: Accept MXF D-10 with 49.999840 Mbit/sec
This is the maximum rate possible based on the frame size limit of MXF D-10

Previous version reviewed by tim nicholson <nichot20@yahoo.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d7a762553c6f6c422adb6632354bcc4ff577b701)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:11 +02:00
Ganesh Ajjanagadde
35ab85884b swresample/dither: check memory allocation
check memory allocation in swri_get_dither()

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:29:11 +02:00
Michael Niedermayer
f141ac2d70 Merge commit 'c49b88b93bca53c04f18d78c27dbf1dc6daea909' into release/2.4
* commit 'c49b88b93bca53c04f18d78c27dbf1dc6daea909':
  opusdec: properly handle mismatching configurations in multichannel streams

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-20 14:20:26 +02:00
Michael Niedermayer
e0f859e8fe Merge commit '859ce02c9815b492da627d3098548b4f69bbc80e' into release/2.4
* commit '859ce02c9815b492da627d3098548b4f69bbc80e':
  h263: Always check both dimensions

Conflicts:
	libavcodec/ituh263dec.c

See: 62006b539ddda23594febf0fcb2f21c03de60457
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-20 14:14:53 +02:00
Michael Niedermayer
7da1e8a0d8 Merge commit 'aa3ec219e1a5cc0e96ddec6ea83312ec780448f5' into release/2.4
* commit 'aa3ec219e1a5cc0e96ddec6ea83312ec780448f5':
  imc: add required padding for GetBitContext buffer

Conflicts:
	libavcodec/imc.c

See: 7444cf9a9c0b8b2bba8198af2823521c654a48f4
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-20 14:11:30 +02:00
Michael Niedermayer
8b0a063ba9 Merge commit 'a9f108bd78e842a47ade2f7c8b22a1764d01d4e6' into release/2.4
* commit 'a9f108bd78e842a47ade2f7c8b22a1764d01d4e6':
  ac3_parser: add required padding for GetBitContext buffer

See: fccd85b9f30525f88692f53134eba41f1f2d90db
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-20 14:07:53 +02:00
Michael Niedermayer
80b1cc31b8 Merge commit '02477323b92aacdabe0a2d129eeb0c15fbd1ec9e' into release/2.4
* commit '02477323b92aacdabe0a2d129eeb0c15fbd1ec9e':
  aac_parser: add required padding for GetBitContext buffer

See: fccd85b9f30525f88692f53134eba41f1f2d90db
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-20 14:07:20 +02:00
Anton Khirnov
c49b88b93b opusdec: properly handle mismatching configurations in multichannel streams
The substreams can have different resampling delays, so an additional
level of buffering is needed to synchronize them.

Bug-Id: 876
2015-08-01 20:54:11 +02:00
Michael Niedermayer
dfc147d24f MAINTAINERS: Remove myself as leader
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f2c58931e629343f7d68258cc2b2d62c5f501ba5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-31 18:35:31 +02:00
Luca Barbato
859ce02c98 h263: Always check both dimensions
CC: libav-stable@libav.org
Found-By: ago@gentoo.org
2015-07-22 13:05:35 +02:00
Janne Grunau
aa3ec219e1 imc: add required padding for GetBitContext buffer
Fixes stack buffer overflow errors detected by address sanitizer in
fate-imc.

CC: libav-stable@libav.org
2015-07-08 23:37:51 +02:00
Janne Grunau
a9f108bd78 ac3_parser: add required padding for GetBitContext buffer
Fixes stack buffer overflow errors detected by address sanitizer in
various fate tests.

CC: libav-stable@libav.org
2015-07-08 23:37:51 +02:00
Janne Grunau
02477323b9 aac_parser: add required padding for GetBitContext buffer
Fixes stack buffer overflow errors detected by address sanitizer in
various fate tests.

CC: libav-stable@libav.org
2015-07-08 23:37:51 +02:00
Michael Niedermayer
d9655621b3 avformat/swfdec: Do not error out on pixel format changes
Instead print an error and continue

Fixes Ticket4702

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6a1204a1a46674084b1e6b92562f81aaab7aac69)
2015-07-08 12:46:58 +02:00
Paul B Mahol
1a4cb3b29c avcodec/exr: fix crash caused by merge
Various header informations need to be reset when decoding next frame.
Regression since: 95582b5c

Fixes ticket #4597.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit a03b69478b7f1c0c31e53acb0cf392917c0f967a)
2015-06-19 11:25:52 +02:00
Michael Niedermayer
ff02eeafd8 avcodec/x86/h264_weight: handle weight1=128
Fix ticket4596

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e1009665759d4a3938dd2dd07b7e84d8bc9c5290)
2015-06-19 11:25:38 +02:00
Michael Niedermayer
bd28de1b4d avcodec/hevc_ps: Only discard overread VPS if a previous is available
Fixes Ticket4621

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 57078e4d255a06246fef27846073f5ffb312b5dc)
2015-06-19 11:25:23 +02:00
Michael Niedermayer
57d094e3e3 avformat/mov: Mark avio context of decompressed atoms as seekable
Fixes Ticket4329

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8ce564ea280b61d21eebf8a2fd741f792ce81638)
2015-06-19 11:25:06 +02:00
Michael Niedermayer
65d61a4bbb avfilter/x86/vf_hqdn3d: Fix register types
Fixes Ticket4301

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 52fc3e372f8ed4de5735abed1f7f7569fe37b023)
2015-06-19 11:24:32 +02:00
Andreas Cadhalpun
1047c286fa libopenjpegenc: add NULL check for img before accessing it
If opj_image_create fails to allocate an image it returns NULL, which
causes a segmentation fault at 'img->x0 = 0'.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
n2.4.10
2015-06-03 03:22:17 +02:00
Michael Niedermayer
bf6ba4a032 swresample: Check the return value of resampler->init()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 02915602d9313aa4b108342a3081244b9d2422bf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-03 01:31:20 +02:00
Michael Niedermayer
c6f343d7c4 Update for 2.4.10
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-02 01:12:40 +02:00
Andreas Cadhalpun
c646ee3da7 diracdec: check if reference could not be allocated
s->ref_pics[i] is later used as ref argument of interpolate_refplane,
where it is dereferenced.

If it is NULL, it causes a segmentation fault.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 23:25:22 +02:00
Andreas Cadhalpun
68c11b6654 diracdec: avoid overflow of bytes*8 in decode_lowdelay
If bytes is large enough, bytes*8 can overflow and become negative.

In that case 'bufsize -= bytes*8' causes bufsize to increase instead of
decrease.

This leads to a segmentation fault.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 23:25:22 +02:00
Andreas Cadhalpun
10429a5284 diracdec: prevent overflow in data_unit_size check
buf_idx + data_unit_size can overflow, causing the '> buf_size' check to
wrongly fail.

This causes a segmentation fault.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 23:25:22 +02:00
Michael Niedermayer
f9f1c50b41 avformat/matroskadec: Use tracks[k]->stream instead of s->streams[k]
The later is not correct

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 23:25:22 +02:00