Commit Graph

67085 Commits

Author SHA1 Message Date
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 3ef5702926)

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

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

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

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 05c57ba2f4)

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

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 913685f552)

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 83307a32eb)

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 12ba1b2b4d)

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

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 3c803ed9cb)

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

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

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

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 5d8e4f6da0.
(cherry picked from commit 3e34b7498f)

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

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 196b885a5f)

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: 62006b539d
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: 7444cf9a9c
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: fccd85b9f3
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: fccd85b9f3
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 f2c58931e6)

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 6a1204a1a4)
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 a03b69478b)
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 e100966575)
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 57078e4d25)
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 8ce564ea28)
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 52fc3e372f)
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 1577526b47)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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 02915602d9)

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

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 9e66b39aa8)

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 984f50deb2)

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 5d309d3091)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 23:25:22 +02:00
Andreas Cadhalpun
84cc40cbe1 matroskadec: check s->streams[k] before using it
This fixes a segmentation fault.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 23:25:22 +02:00
Michael Niedermayer
43bfe0ada5 avcodec/ffv1dec: Check chroma shift parameters
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d43cd6b08e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 23:25:21 +02:00
Andreas Cadhalpun
25b56dfa5c matroskadec: use uint64_t instead of int for index_scale
index_scale is set to matroska->time_scale of type uint64_t.

When index_scale is int, the assignment can overflow and e.g. result
in index_scale = 0. This causes a floating point exception due to the
division by index_scale.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 23:25:21 +02:00
Michael Niedermayer
3126d6ee02 avcodec/wavpack: Check L/R values before use to avoid harmless integer overflow and undefined behavior in fate
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 042260cde4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 23:25:21 +02:00
Andreas Cadhalpun
35a0d4801f nutdec: fix illegal count check in decode_main_header
The existing check has two problems:
 1) i + count can overflow, so that the check '< 256' returns true.
 2) In the (i == 'N') case occurs a j-- so that the loop runs once more.

This can trigger the assertion 'nut->header_len[0] == 0' or cause
segmentation faults or infinite hangs.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 23:25:21 +02:00
Andreas Cadhalpun
e0ef1b8c0b nutdec: check for negative frame rate in decode_info_header
A negative frame rate triggers an av_assert2 in av_rescale_rnd.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 23:25:21 +02:00
Michael Niedermayer
723d2b0c5b ffmpeg: remove incorrect network deinit
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e2877bdf38)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 23:25:21 +02:00
Maneesh Gupta
5260ba3e16 OpenCL: Avoid potential buffer overflow in cmdutils_opencl.c
The opt_opencl_bench function copied the device name using strcpy without checking if the source string was larger.
This patch fixes this by replacing the strcpy with av_strlcpy, with the string copy size capped to the destination buffer size.

Signed-off-by: Maneesh Gupta <maneesh.gupta@amd.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cf234552b8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 23:25:21 +02:00
Andreas Cadhalpun
427cf443ab apedec: set s->samples only when init_frame_decoder succeeded
Otherwise range_start_decoding is not necessarily run and thus
ctx->rc.range still 0 in range_dec_normalize leading to an infinite
loop.

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

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