1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00
Commit Graph

75252 Commits

Author SHA1 Message Date
Andreas Cadhalpun
e3d7796336 vorbisdec: reject channel mapping with less than two channels
It causes the angle channel number to equal the magnitude channel
number, which makes the stream undecodable according to the
specification.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit b4b13848de)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-27 23:45:44 +01:00
Andreas Cadhalpun
667a23a032 ffmdec: reset packet_end in case of failure
This fixes segmentation faults caused by passing a packet_ptr of NULL to
memcpy.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 40eb2531b2)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-27 23:45:44 +01:00
Paul B Mahol
7b0fb4fdf7 avformat/ipmovie: put video decoding_map_size into packet and use it in decoder
The size of decoding map can differ from one calculated
internally, producing artifacts while decoding video.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit c293ef258c)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-27 23:28:49 +01:00
Paul B Mahol
40ebeee3fc avformat/brstm: fix overflow
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 3441fef0f8)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-27 23:28:43 +01:00
James Almer
b8fa3ff95d avcodec/wavpackenc: print channel count in av_log call
Fixes a warning with -Wformat-extra-args
(cherry picked from commit 17e7fdf61a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:53:58 +01:00
James Almer
063928910f configure: bump copyright year to 2016
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 78129978f0)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 16:26:06 +01:00
Michael Niedermayer
e303ca3ac9 Update for 2.8.5
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 16:25:51 +01:00
Michael Niedermayer
28f89bc439 avformat/hls: Even stricter URL checks
This fixes a null pointer dereference at least

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cfda1bea4c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 15:49:35 +01:00
Michael Niedermayer
23b903aaf4 avformat/hls: More strict url checks
No case is known where these are needed

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6ba42b6482)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 14:17:28 +01:00
Michael Niedermayer
4676e20a9d avcodec/pngenc: Fix mixed up linesizes
Fixes out of array accesses
Fixes: 0cf176e6d3ab9fe924f39738e513f547/asan_generic_4a54aa_3431_aaa28be1cb32e307a9890cad06f84fba.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8f4c3e4b92)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:41 +01:00
Michael Niedermayer
0c5a71fece avcodec/pngenc: Replace memcpy by av_image_copy()
Fixes out of array access
Fixes: 0cf176e6d3ab9fe924f39738e513f547/asan_generic_4a54aa_3431_aaa28be1cb32e307a9890cad06f84fba.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7ec9c5ce8a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:41 +01:00
Michael Niedermayer
07da25548f swscale/vscale: Check that 2 tap filters are bilinear before using bilinear code
Fixes: out of array reads
Fixes: 07e8b9c5d348ccdf7add0f37de20cf6c/asan_heap-oob_27e8df7_6849_e56653f768070ec8cb52f587048444c2.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit eb7802afef)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:41 +01:00
Michael Niedermayer
be9b89314f swscale: Move VScalerContext into vscale.c
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7b6e6895f2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:41 +01:00
Michael Niedermayer
cdac68fbab swscale/utils: Detect and skip unneeded sws_setColorspaceDetails() calls
This avoids running various table inits unnecessarily

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cc538e9dbd)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:41 +01:00
Michael Niedermayer
1fd9556062 swscale/yuv2rgb: Increase YUV2RGB table headroom
This makes SWS more robust
Fixes: 07650a772d98aa63b0fed6370dc89037/asan_heap-oob_27ddeaf_2657_2c81ff264dee5d9712cb3251fb9c3bbb.264
Fixes: out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8f3a9a8c27)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
c781a1e14b swscale/yuv2rgb: Factor YUVRGB_TABLE_LUMA_HEADROOM out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5e5f82a287)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Maxim Andreev
b7d54d6e07 avformat/hls: forbid all protocols except http(s) & file
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7145e80b4f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
90c2256ee5 avformat/aviobuf: Fix end check in put_str16()
Fixes out of array read
Fixes: 03c406ec9530e594a074ce2979f8a1f0/asan_heap-oob_7dec26_4664_37c52495b2870a2eaac65f53958e76c1.flac

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 115fb6d03e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
f459afdd72 avformat/asfenc: Check pts
Fixes integer overflow
Fixes: 0063df8be3aaa30dd6d76f59c8f818c8/signal_sigsegv_7b7b59_3634_bf418b6822bbfa68734411d96b667be3.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7c0b84d899)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
d408261b65 avcodec/mpeg4video: Check time_incr
Fixes assertion failure
Fixes out of memory access

Fixes: test_casex.ivf

Found-by: Tyson Smith <twsmith@mozilla.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7c97946d61)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
d7f7586c3f avcodec/wavpackenc: Check the number of channels
They are stored in a byte, thus more than 255 is not possible

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 59c915a403)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
f05e0e76d6 avcodec/wavpackenc: Headers are per channel
Fixes: 1b8b83a53bfa751f01b1daa65a4758db/signal_sigabrt_7ffff6ae7cb7_7488_403f71d1a2565b598d01b6cb110fac8f.aiff
Fixes: assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 26757b0279)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
e5567f2f69 avcodec/aacdec_template: Check id_map
Fixes index out of bounds error
Fixes: aac_index_out_of_bounds.wmv

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 590863876d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
b8382a1fae avcodec/dvdec: Fix "left shift of negative value -254"
Fixes: dvdec_left_shift.avi

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 93ac72a98d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
9cad208223 avcodec/g2meet: Check for ff_els_decode_bit() failure in epic_decode_run_length()
Fixes invalid shift
Fixes: g2m_left_shift_2.wmv

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 030c7f0309)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
34e06ce309 avcodec/mjpegdec: Fix negative shift
Fixes: mjpeg_left_shift.avi

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d86d7b2486)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
df4ee166f1 avcodec/mss2: Check for repeat overflow
Fixes: mss2_left_shift.wmv

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e273dade78)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
cb4ba7456a avformat: Add integer fps from 31 to 60 to get_std_framerate()
Fixes Ticket 5106

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2039b3e751)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
d79b6dd9f9 avformat/ivfenc: fix division by zero
Fixes Ticket 5115

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5c8467a07c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
36861557a7 avcodec/mpegvideo_enc: Clip bits_per_raw_sample within valid range
Fixes out of array read
Fixes: test_case-mdc.264 (b47be15a120979f5a1a945c938cbef33)

Found-by: Tyson Smith <twsmith@mozilla.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 13f266b50c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Thomas Mundt
3fb97a01ce avfilter/vf_scale: set proper out frame color range
Prevents that following scalers in the filter chain will do unintentional color range conversions.
Fixes Ticket #5096

Signed-off-by: Thomas Mundt <loudmax@yahoo.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 73ce8162f3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
6457cd17be avcodec/motion_est: Fix mv_penalty table size
Fixes out of array read

Found-by: Tyson Smith <twsmith@mozilla.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5b4da8a38a)

Conflicts:

	libavcodec/motion_est.h
2016-01-15 12:30:40 +01:00
Michael Niedermayer
aee9aa9216 avcodec/h264_slice: Fix integer overflow in implicit weight computation
Fixes mozilla bug 1230423

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7cc01c2572)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
14c63dc9b0 swscale/utils: Use normal bilinear scaler if fast cannot be used due to tiny dimensions
Fixes Ticket4960

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1edf129cbc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
709abc74f5 avcodec/put_bits: Always check buffer end before writing
This causes a overall slowdown of 0.1 % (tested with mpeg4 single thread encoding of matrixbench at QP=3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cccb0ffccc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Andreas Cadhalpun
83c0df90b0 mjpegdec: extend check for incompatible values of s->rgb and s->ls
This can happen if s->ls changes from 0 to 1, but picture allocation is
skipped due to s->interlaced.

In that case ff_jpegls_decode_picture could be called even though the
s->picture_ptr frame has the wrong pixel format and thus a wrong
linesize, which results in a too small zero buffer being allocated.

This fixes an out-of-bounds read in ls_decode_line.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 7ea2db6eaf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
0a6324fe93 swscale/utils: Fix intermediate format for cascaded alpha downscaling
Fixes Ticket4926

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b83d8be6bf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
Michael Niedermayer
2f65366c11 avformat/mov: Update handbrake_version threshold for full mp3 parsing
Fixes: Endangered\ Species\ 1x01\ Collecting\ Merl.mp4

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d3b6a9abac)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
James Almer
3e3aa25afa x86/float_dsp: zero extend offset from ff_scalarproduct_float_sse
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit dc79824deb)
2016-01-08 14:02:27 -03:00
Paul B Mahol
6a1bf98b3a avfilter/vf_zoompan: do not free frame we pushed to lavfi
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 8bcd1997ea)

Fixes ticket #5113.
2016-01-02 21:21:43 +01:00
Andreas Cadhalpun
79f407b79a nuv: sanitize negative fps rate
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f6830cf5ba)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 13:39:45 +01:00
Andreas Cadhalpun
174ec7d744 nutdec: reject negative value_len in read_sm_data
If it is negative, it can cause the byte position to move backwards in
avio_skip, which in turn makes sm_size negative and thus size larger
than the size of the packet buffer, causing invalid writes in avio_read.

Also fix potential overflow of avio_tell(bc) + value_len.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit ce10f572c1)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 13:39:41 +01:00
Andreas Cadhalpun
778c8de40f xwddec: prevent overflow of lsize * avctx->height
This is used to check if the input buffer is large enough, so if this
overflows it can cause a false negative leading to a segmentation fault
in bytestream2_get_bufferu.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9d38f06d05)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 13:39:37 +01:00
Andreas Cadhalpun
38f8c80901 nutdec: only copy the header if it exists
Fixes ubsan runtime error: null pointer passed as argument 2, which is
declared to never be null

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9f82506c79)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 13:39:33 +01:00
Andreas Cadhalpun
945ae04fab exr: fix out of bounds read in get_code
This macro unconditionally used out[-1], which causes an out of bounds
read, if out is the very beginning of the buffer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 90b99a8107)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 13:39:29 +01:00
Andreas Cadhalpun
6d7b4dbcb4 on2avc: limit number of bits to 30 in get_egolomb
More don't fit into the integer output.

Also use get_bits_long, since get_bits only supports reading up to 25
bits, while get_bits_long supports the full integer range.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 4d5c3b02e9)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 13:39:24 +01:00
Michael Niedermayer
644179e0d4 Update Changelog
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-20 02:58:41 +01:00
Andreas Cadhalpun
9be3441c31 rawdec: only exempt BIT0 with need_copy from buffer sanity check
Otherwise the too samll buffer is directly used in the frame, causing
segmentation faults, when trying to use the frame.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-20 02:58:21 +01:00
Andreas Cadhalpun
63ecbb82fc mlvdec: check that index_entries exist
This fixes NULL pointer dereferencing.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-20 02:42:13 +01:00
Michael Niedermayer
bdc6ba4604 avcodec/mpeg4videodec: also for empty partitioned slices
Fixes assertion failure
Fixes: id_acf3e47f864e1ee4c7b86c0653e0ff31e5bde56e.m4v

Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 70f13abb4f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-19 23:54:47 +01:00