Commit Graph

80898 Commits

Author SHA1 Message Date
Andreas Cadhalpun
72f1701c92 cavsdec: unref frame before referencing again
This fixes asserts (from commit 13aae8) in av_frame_ref and
av_frame_move_ref.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 1966ea012f)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-27 00:28:03 +01:00
Andreas Cadhalpun
d77684b853 dcstr: fix division by zero
Also check for possible overflows.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit b0a043f51b)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-27 00:28:03 +01:00
Andreas Cadhalpun
2c52b74980 aiff: check block_align in aiff_read_packet
It can be unset in avcodec_parameters_from_context and a value of 0
causes SIGFPE crashes.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 93c39db5f1)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-27 00:28:03 +01:00
Andreas Cadhalpun
13f032abbb rsd: limit number of channels
Negative values don't make sense and too large values can cause
overflows. For AV_CODEC_ID_ADPCM_THP this leads to a too small extradata
buffer being allocated, causing out-of-bounds writes.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit ee5f0f1d35)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-27 00:28:02 +01:00
Andreas Cadhalpun
d69dc10466 avformat: prevent triggering request_probe assert in ff_read_packet
If probe_codec is called with pkt == NULL, it sets probe_packets to 0
and request_probe to -1.
However, request_probe can change when calling s->iformat->read_packet
and thus a probe_packets value of 0 doesn't guarantee a request_probe
value of -1.
In that case calling probe_codec again is necessary to prevent
triggering the assert.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit a5b4476a60)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-27 00:28:02 +01:00
Andreas Cadhalpun
d4f64a0f54 westwood_aud: prevent division by zero
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit bc7e128a6e)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-27 00:28:02 +01:00
Andreas Cadhalpun
b3991ccd11 astdec: fix division by zero
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9959a52b14)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-27 00:28:02 +01:00
Andreas Cadhalpun
230c04e3f6 aiffdec: fix division by zero
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit c143a9c96f)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-27 00:27:56 +01:00
James Almer
c3f97bf544 avcodec/avpacket: fix leak on realloc in av_packet_add_side_data()
If realloc fails, the pointer is overwritten and the previously allocated
buffer is leaked, which goes against the expected behavior of keeping the
packet unchanged in case of error.

Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>

(cherry picked from commit 574929d8b6)
2016-11-19 20:24:44 -03:00
Michael Niedermayer
2a5c41e3e4 Chagelog: update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
n3.1.5
2016-10-22 01:37:37 +02:00
Michael Niedermayer
9e6586ceb2 avformat/mxfdec: Check size to avoid integer overflow in mxf_read_utf16_string()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fecb3e82a4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-21 20:26:00 +02:00
Michael Niedermayer
6456a7416e avcodec/mpegvideo_enc: Clear mmx state in ff_mpv_reallocate_putbitbuffer()
This function must be called from the mb or slice encoding loop and MMX state may not
be clean there

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 03ec6b780c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-21 19:33:04 +02:00
Michael Niedermayer
de487cb765 avcodec/utils: Clear MMX state before returning from avcodec_default_execute*()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4f96f9d111)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-21 19:33:04 +02:00
Michael Niedermayer
2fece989f8 doc/examples/demuxing_decoding: Drop AVFrame->pts use
This code is not correct for git master

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2bd9956454)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-21 19:33:04 +02:00
Andreas Cadhalpun
a2d3e7392d Changelog: update for recent commits
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-17 18:13:44 +02:00
Andreas Cadhalpun
d391719be1 libopenjpegenc: fix out-of-bounds reads when filling the edges
The calculation of width/height should round up, not round down to
prevent setting width or height to 0.

Also image->comps[compno].w is unsigned (at least in openjpeg2), so the
calculation could silently wrap around without the explicit cast to int.

Reviewed-by: Michael Bradshaw <mjbshaw@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 56706ac0d5)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-17 17:21:35 +02:00
Andreas Cadhalpun
a22155dacd libopenjpegenc: stop reusing image data buffer for openjpeg 2
openjpeg 2 sets the data pointers of the image components to NULL,
causing segfaults if the image is reused.

Reviewed-by: Michael Bradshaw <mjbshaw@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 69c8505f3b)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-17 17:21:30 +02:00
Andreas Cadhalpun
1a43626fdf configure: fix detection of libopenjpeg
Use check_lib2 to test the header together with the function. This is
necessary, because '-DOPJ_STATIC' changes what the included header does.

Also add '-DOPJ_STATIC' to CPPFLAGS, so that it isn't necessary to
hardcode this in libavcodec/libopenjpeg{dec,enc}.c.

Finally, check for non-static openjpeg 2.1, too.

Reviewed-by: Michael Bradshaw <mjbshaw@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 7a65aef00d)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-17 17:21:22 +02:00
Michael Niedermayer
675258764d Update for 3.1.5
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-17 04:43:22 +02:00
Moritz Barsnick
6109c10b81 doc: fix various typos and grammar errors
Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 99d68d462f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-11 17:02:27 +02:00
Michael Niedermayer
08eef74a39 avformat/utils: Update codec_id before using it in the parser init
Fixes assertion failure

Fixes: input.avi

Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 987690799d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-10 00:59:51 +02:00
Moritz Barsnick
7fefd77668 cmdutils: fix typos
Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3e5d27d7a7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-09 20:14:22 +02:00
Moritz Barsnick
f12c0da09b lavfi: fix typos
Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f4e4bde1f4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-09 20:14:01 +02:00
Moritz Barsnick
30c80e81d2 lavc: fix typos
Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3305f71025)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-09 20:13:48 +02:00
Moritz Barsnick
fc36e692c4 tools: fix grammar error
Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f71c98ee12)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-09 20:13:29 +02:00
Hendrik Leppkes
263add4462 ffmpeg: remove unused and errorneous AVFrame timestamp check
Decoders have previously not used AVFrame.pts, and with the upcoming
deprecation of pkt_pts (in favor of pts), this would lead to an errorneous
interpration of timestamps.

(cherry picked from commit 04a3577263)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-07 16:11:54 +02:00
Shivraj Patil
d2566b124a Support for MIPS cpu P6600
Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6803a298f4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-06 21:30:53 +02:00
Shivraj Patil
d89979e86b avutil/mips/generic_macros_msa: rename macro variable which causes segfault for mips r6
Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c1cc13cd2a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-06 21:27:24 +02:00
Michael Niedermayer
c2ea706282 Changelog: update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
n3.1.4
2016-10-01 02:51:42 +02:00
Michael Niedermayer
622ccbd8ab avformat/avidec: Check nb_streams in read_gab2_sub()
Fixes null pointer dereference
Fixes: 1/null_point.avi

Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2679ad4773)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-01 02:50:54 +02:00
Michael Niedermayer
c8c5f66b42 avformat/avidec: Remove ancient assert
This assert can with crafted files fail, a warning is already printed
for this case.

Fixes assertion failure
Fixes:1/assert.avi

Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 14bac7e00d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-01 02:50:54 +02:00
James Almer
bc6174d4af Changelog: update after the last few commits
Signed-off-by: James Almer <jamrial@gmail.com>
2016-09-28 17:42:41 -03:00
James Almer
2303cea5be avfilter/vf_colorspace: fix range for output colorspace option
Rreviewed-by: BBB
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit e4bfc9ecf7)
2016-09-28 17:40:10 -03:00
Matthieu Bouron
d0590d9349 lavc/mediacodecdec_h264: fix SODB escaping
Fixes escaping of consecutive 0x00, 0x00, 0x0{0-3} sequences.

(cherry picked from commit f574012d5f)
2016-09-28 16:22:24 +02:00
Timo Rothenpieler
e60a00e0cc avcodec/nvenc: fix const options for hevc gpu setting 2016-09-28 16:10:49 +02:00
Michael Niedermayer
e6351504dc Update for 3.1.4
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 14:23:25 +02:00
Michael Niedermayer
8834e080c2 avformat/avidec: Fix memleak with dv in avi
Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b98dafe045)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 14:23:07 +02:00
Sasi Inguva
39dc26f0c1 lavc/movtextdec.c: Avoid infinite loop on invalid data.
Signed-off-by: Sasi Inguva <isasi@google.com>
(cherry picked from commit 7e9e1b7070)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 14:23:07 +02:00
Michael Niedermayer
496267f8e9 avcodec/ansi: Check dimensions
Fixes: 1.avi

Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 69449da436)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 14:23:07 +02:00
Michael Niedermayer
9d738e6968 avcodec/cavsdsp: use av_clip_uint8() for idct
Fixes out of array read
Fixes: 1.swf

Found-by: 连一汉 <lianyihan@360.cn>
Tested-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0e318f110b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 14:23:07 +02:00
Michael Niedermayer
77c9c35093 avformat/movenc: Check packet in mov_write_single_packet() too
Fixes assertion failure

Found-by: durandal117
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2834313933)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 14:23:06 +02:00
Michael Niedermayer
03f996d183 avformat/movenc: Factor check_pkt() out
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit deabcd2c05)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 14:23:06 +02:00
Xinzheng Zhang
c68ce48260 avformat/utils: fix timebase error in avformat_seek_file()
When there is only one stream and stream_index has not specified,
The ts has been transferd by the timebase of stream0 without modifying the stream_index
In this condation it cause seek failure.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ecc04b4f2f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 14:23:06 +02:00
Michael Niedermayer
ac8ac46641 avcodec/g726: Add missing ADDB output mask
Fixes: 1.poc
Fixes out of array read

Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a5af1240fc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 14:23:06 +02:00
Michael Niedermayer
c2087fc48b avcodec/avpacket: clear side_data_elems
Fixes null pointer dereference

Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5e1bf9d8c0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 14:23:06 +02:00
Michael Niedermayer
21a9797737 avformat/movenc: Check first DTS similar to dts difference
Fixes assertion failure
Fixes: b84b53855a0b74560e64c6f45f505a13/signal_sigabrt_7ffff6ae7c37_3837_ef4e243ea5b4fa8d0becf4afe9166604.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 68f4c2163e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 14:23:06 +02:00
Michael Niedermayer
65c10f0f5c avcodec/ccaption_dec: Use simple array instead of AVBuffer
This is simpler and fixes an out of array read, fixing it with AVBuffers
would be more complex

Fixes: e00d9e6e50e5495cc93fea41147b97bb/asan_heap-oob_12dcdbb_8798_b32a97ea722dd37bb5066812cc674552.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 752e6dfa3e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 14:23:06 +02:00
Michael Niedermayer
ed1c6f701a avcodec/svq3: Reintroduce slice_type
Fixes out of array read
Fixes: 1642cd3962249d6aaf0eec2836023fb6/signal_sigsegv_2557a72_2995_04efaf2ff57a052f609a3b4a2ea4e622.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2d3099ad8e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 14:23:06 +02:00
Sergey Volk
7a3dc2f7b6 avformat/mov: Fix potential integer overflow in mov_read_keys
Actual allocation size is computed as (count + 1)*sizeof(meta_keys), so
we need to check that (count + 1) won't cause overflow.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 347cb14b7c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-27 13:42:11 +02:00
Michael Niedermayer
e91b7852df swscale/swscale_unscaled: Try to fix Rgb16ToPlanarRgb16Wrapper() with slices
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e57d99dd4e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-27 13:42:11 +02:00