Compare commits

...

1020 Commits

Author SHA1 Message Date
Paul B Mahol
c7fe604cf1 doc/utils: fix typo for min() description
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit bdf474bcff)
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2016-03-02 16:46:34 -08:00
Michael Niedermayer
ef23c40d43 swscale/x86/rgb2rgb_template: Fallback to mmx in interleaveBytes() if the alignment is insufficient for SSE*
This also as a sideeffect fixes the non aligned case

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a066ff89bc)
2015-12-15 11:21:17 +01:00
Michael Niedermayer
442e7c910a swscale/x86/rgb2rgb_template: Do not crash on misaligend stride
Fixes Ticket5013

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 80bfce35cc)
2015-12-15 11:21:16 +01:00
Michael Niedermayer
a9e4be1cdf avcodec/ffv1dec: Clear quant_table_count if its invalid
Fixes deallocation of corrupted pointer
Fixes: 343dfbe142a38b521ed069dc4ea7c03b/signal_sigsegv_421427_4074_ffb11959610278cd40dbc153464aa254.avi
No releases affected

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

Fixes ticket #5052.
2015-12-06 14:14:49 +01:00
Michael Niedermayer
8a6a619cbe avcodec/ffv1dec: Print an error if the quant table count is invalid
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a8b254e436)
2015-12-06 14:14:43 +01:00
Michael Niedermayer
1aa1f4bbf4 avcodec/ffv1dec: Check for 0 quant tables
Fixes assertion failure
Fixes: 07ec1fc3c1cbf2d3edcd7d9b52ca156c/asan_heap-oob_13624c5_491_ecd4720a03e697ba750b235690656c8f.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5745cf799a)
2015-12-06 14:14:41 +01:00
Andrey Utkin
ed4c595edd doc/filters/drawtext: fix centering example
Signed-off-by: Andrey Utkin <andrey.od.utkin@gmail.com>
Signed-off-by: Lou Logan <lou@lrcd.com>
(cherry picked from commit 648b26acc5)
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2015-12-01 17:33:44 -08:00
Ronald S. Bultje
beaf2728ce videodsp: don't overread edges in vfix3 emu_edge.
Fixes trac ticket 3226. Also see Andreas' analysis in
https://bugs.debian.org/801745, which was very helpful.
(cherry picked from commit 52f84d82bd)
2015-10-25 01:36:56 +02:00
Michael Niedermayer
3ae3708246 avcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size check
Fixes Ticket4778

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2bb54b82b5)
2015-10-09 22:54:33 +02:00
Michael Niedermayer
57e284dac6 avformat/oggenc: Check segments_count for headers too
Fixes infinite loop and segfault in ogg_buffer_data()
Fixes Ticket4806

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 81a8701eb5)
2015-10-09 22:54:21 +02:00
Michael Niedermayer
8daf13a173 avformat/avidec: Workaround broken initial frame
Fixes Ticket4851

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3e2ef00394)
2015-10-09 22:54:04 +02:00
Ronald S. Bultje
96f52e22f0 hevc: fix wpp threading deadlock.
Fixes ticket 4258.
(cherry picked from commit 74e4948235)
2015-10-09 22:53:29 +02:00
Michael Niedermayer
fd7e170507 avcodec/ffv1: seperate slice_count from max_slice_count
Fix segfault with too large slice_count
Fixes Ticket4879

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

Conflicts:
	libavcodec/ffv1enc.c
	libavcodec/ffv1.c
(cherry picked from commit ef6d6f8906)
2015-10-09 22:53:10 +02:00
wm4
288f52a64a avcodec/mp3: fix skipping zeros
Commits 43bc5cf9 and c5371f77 add code for skipping initial zeros in mp3
packets. This code forgot to report to the user that data was skipped at
all.

Since audio codecs allow partial packet decoding, the user application
has to rely on the return value. It will remove the data reported as
consumed by the decoder, and feed it to the decoder again. This resulted
in the mp3 frame after the zero region to be decoded over and over
again, until the zero region was finally skipped by the application.

Fix this by including the amount of skipped bytes to the number of
consumed bytes returned by the decode call.

Fixes trac ticket #4890.
(cherry picked from commit cb1da9fb8d)
2015-10-09 22:52:58 +02:00
Michael Niedermayer
ac7d47dd70 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:32 +02:00
Michael Niedermayer
b61ee9f03f 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:51:01 +02:00
Michael Niedermayer
59a1e0cba0 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:38:25 +02:00
Michael Niedermayer
85d0c7355b 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:38:02 +02:00
Michael Niedermayer
051cd7dc5f Update for 2.2.16
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 22:10:52 +02:00
Michael Niedermayer
cea2106fb2 avcodec/h264_slice: More complete cleanup in h264_slice_header_init()
Fixes null pointer dereference
Fixes Ticket3873

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

Conflicts:

	libavcodec/h264_slice.c
2015-06-17 21:50:09 +02:00
Andreas Cadhalpun
c9c5bd8c89 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-17 21:50:09 +02:00
Andreas Cadhalpun
b946f849bb 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-17 21:50:09 +02:00
Andreas Cadhalpun
a64102e25f 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-17 21:50:09 +02:00
Michael Niedermayer
4f0d1af68a 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-17 21:50:09 +02:00
Andreas Cadhalpun
7d9725187d 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-17 21:50:09 +02:00
Michael Niedermayer
80cd5abf7f 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-17 21:50:09 +02:00
Andreas Cadhalpun
1f5eeed43b 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-17 21:50:09 +02:00
Michael Niedermayer
45ea5ba068 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-17 21:50:09 +02:00
Andreas Cadhalpun
ffdd93fe79 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 7c24ca1bda)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:09 +02:00
Andreas Cadhalpun
b548a6208e 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-17 21:50:09 +02:00
Michael Niedermayer
02b434044c 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-17 21:50:09 +02:00
Maneesh Gupta
25daf27484 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-17 21:50:09 +02:00
Andreas Cadhalpun
d9ff9b8ab0 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-17 21:50:09 +02:00
Michael Niedermayer
fe8a763bc7 tests/fate-run: do not attempt to parse tiny_psnrs output if it failed
This avoids confusing syntax errors with awk later

Likely fixes awk errors at:
http://buildd.debian-ports.org/status/fetch.php?pkg=ffmpeg&arch=sparc64&ver=7%3A2.6.2-1&stamp=1428928967

Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Thanks-to: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> for the link
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c0d847e457)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:09 +02:00
Vittorio Giovara
cd5a832b0a lavf: Reset global flag on deinit
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32da94fa7f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:09 +02:00
Andreas Cadhalpun
940b9484dc bink: check vst->index_entries before using it
This fixes a NULL pointer dereference if vst->duration is 0.

The problem was introduced in commit 0588acaf.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:09 +02:00
Andreas Cadhalpun
e96e0e1333 mpeg4videodec: only allow a positive length
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b3408ae4c6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:09 +02:00
Michael Niedermayer
f494b906e3 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-06-17 21:50:08 +02:00
Michael Niedermayer
249021eb23 avcodec/bitstream: Assert that there is enough space left in avpriv_copy_bits()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 291ad5cc9c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
2b499b6940 avcodec/put_bits: Assert that there is enough space left in skip_put_bytes()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8f5ffed183)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
4f09968865 avcodec/mpegvideo_enc: Update the buffer size as more slices are merged
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 561d3a57aa)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
9d6d4eb425 avcodec/put_bits: Update size_in_bits in set_put_bits_buffer_size()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e4c2ec879b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Andreas Cadhalpun
dfd1d48730 nutdec: abort if EOF is reached in decode_info_header/read_sm_data
These loops can take a lot of time if count is very large.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Andreas Cadhalpun
4d625f270a nutdec: stop skipping bytes at EOF
This can unnecessarily waste a lot of time.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Andreas Cadhalpun
9414358f15 nutdec: fix infinite resync loops
nut->last_syncpoint_pos doesn't necessarily change between resync
attempts, so find_any_startcode can return the same startcode again.

Thus remember where the last resync happened and don't try to resync
before that.

This can't be done locally in nut_read_packet, because this wouldn't
prevent infinite resync loops, where after the resync a packet is
returned and while reading a following packet the resync happens again.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
fe1e6b919d avformat/nutdec: Check X in 2nd branch of index reading
Prevents read of uninitialized variable

Based on patch by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ebb0ca3d70)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
8cfc0fdb23 avformat/nutdec: Fix recovery when immedeately after seeking a failure happens
Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b3496b4a33)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
6ad3654670 avformat/nutdec: Return error on EOF from get_str()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6bbb2f8f4d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
c8676f9daf avcodec/golomb: get_ur_golomb_jpegls: Fix reading huge k values
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c720b9ce98)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
9cee1c4ac7 avcodec/hevc: Fix typo in num_entry_point_offsets check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3051e7fa71)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
ed6d7696db avcodec/libtheoraenc: Check for av_malloc failure
Fixes CID1257799

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
0122e38cb1 avcodec/dcadec: Check active_bands
Fixes CID1297594 part2

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
3edb74db3b avcodec/dcadec: Check scale table index
Fixes CID1297594 part 1

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

Conflicts:

	libavcodec/dcadec.c
2015-06-17 21:50:08 +02:00
Michael Niedermayer
3344a28787 avcodec/sonic: More completely check sample_rate_index and channels
Fixes CID1271783

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
3a43c712ae avcodec/sonic: check memory allocations
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c131a9fead)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
49a759fb3f avcodec/smvjpegdec: check avcodec_decode_video2() return code
Fixes CID1271810

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
47db54cef6 avcodec/shorten: More complete pred_order check
Fixes CID1239055

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
16af12a807 avcodec/shorten: Check skip_bytes()
Fixes CID1210526

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:08 +02:00
Michael Niedermayer
9f885733d6 avcodec/shorten: Fix code depending on signed overflow behavior
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2d15588124)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
cd489b8f64 avcodec/proresdec2: Reset slice_count on deallocation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c4c6aea397)

Conflicts:

	libavcodec/proresdec2.c
2015-06-17 21:50:07 +02:00
Michael Niedermayer
f8f24d5dbd ffmpeg_opt: Fix -timestamp parsing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 107e4da476)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
b259c7e891 avcodec/dcadec: Check subsubframes
Fixes: CID1239152

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
d919438904 avcodec/dcadec: Check nchans
Fixes CID1239110

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
wm4
f06168f7dc hevc: make avcodec_decode_video2() fail if get_format() fails
Personally, I need the decoder to back out if get_format() returns no
usable pixel format. This didn't work because the error code was not
propagated down the call chain. This in turn happened because the
variable declaration removed in this patch shadowed the variable, whose
value is returned at the end of the function. Consequently, failures of
decode_nal_unit() were ignored in this place.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
e52d66c647 avcodec/cavsdec: Check esc_code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 139e1c8009)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
05a3a3e5b0 avcodec/mpeg4audio: add some padding/alignment to MAX_PCE_SIZE
This avoids potential accesses over the end

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Rainer Hochecker
02c51e0564 swr: fix alignment issue caused by 8ch sse functions
Fix crash when doing 8 ch conversion from apps compiled with MSVS
Thanks to Ronald for giving this hint:
https://ffmpeg.org/pipermail/ffmpeg-devel/2015-May/173049.html

Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit adb7372f74)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
611791e77e avcodec/mjpegdec: fix len computation in ff_mjpeg_decode_dqt()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 81cf910856)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
046439d608 avcodec/jpeg2000dec: fix boolean operator
Fixes CID1271791 #7-6

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
003b006c85 avcodec/hevc_ps: Explicitly check num_tile_* for negative values
This fixes nothing but maybe helps coverity which does not see that this is failing later

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
a2e183aa05 avcodec/hevc_ps: Check vps_num_hrd_parameters
Fix CID1239052 part2

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
87d2c6105d avcodec/hevc: Check num_entry_point_offsets
Fixes CID1239099 part 2

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
eed8ccd9eb avcodec/hevc: Check offset_len
Fixes CID1239099 part 1

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
6d6acef9fb avcodec/hevc_sei: Check num_sps_ids_minus1 value
Fixes CID1271794

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
e1b98555b9 avcodec/vqavideo: Check chunk size
Fixes CID1239154

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Andreas Cadhalpun
14d69655b7 aacdec: don't return frames without data
Since commit 676a395a aac->frame->data is not necessarily allocated at
the end of aac_decode_frame_int if avctx->channels is 0.

In this case a bogus frame without any data, but non-zero nb_samples is
returned.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
06fda5bef3 avformat/hevc: Check num_negative_pics and num_positive_pics
Fixes CID1238994

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
55a9a37359 avformat/hevc: Check cpb_cnt_minus1
Fixes CID1239014

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:07 +02:00
Michael Niedermayer
ed578c91bf avformat/matroskadec: Cleanup error handling for bz2 & zlib
Fixes CID703652

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

Conflicts:

	libavformat/matroskadec.c
2015-06-17 21:50:06 +02:00
Michael Niedermayer
3062689f37 avformat/nutdec: Fix use of uinitialized value
Fixes CID1041175

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:06 +02:00
Michael Niedermayer
b8060bc217 avformat/rtpenc_jpeg: Check remaining buffer size for SOS
Fixes CID1238818

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:06 +02:00
Michael Niedermayer
0452e3e41c avformat/rtpdec_xiph: Check upper bound on len in xiph_handle_packet()
Larger packets are not supported and would cause problems later

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:06 +02:00
Michael Niedermayer
6bb62d64d2 tools/graph2dot: use larger data types than int for array/string sizes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit acf4925f44)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:06 +02:00
Michael Niedermayer
404db2b99e avformat/subtitles: Use size_t for len
string length could theoretically be larger than int

Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a633928d47)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:06 +02:00
Michael Niedermayer
17ad9778a9 avformat/url: Use size_t for len from strlen()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 95efc65129)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:06 +02:00
Michael Niedermayer
f76b54fba7 avutil/avstring: Use size_t in av_strlcatf()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ae4eea8be4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:06 +02:00
Michael Niedermayer
d27b9d3bd1 avformat/vorbiscomment: Check entry length in ff_vorbiscomment_write()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eca38864a6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:06 +02:00
Michael Niedermayer
0b6c8bb26c avutil/dict: Use size_t for appending strings
the string length is not constrained to INT_MAX

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

Conflicts:

	libavutil/dict.c
2015-06-17 21:50:06 +02:00
Michael Niedermayer
9f9af1dd04 libavutil/mem: use size_t for the length in av_strdup()
the string length is not constrained to INT_MAX

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:06 +02:00
Andreas Cadhalpun
3a0c421b56 aacsbr: break infinite loop in sbr_hf_calc_npatches
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 584cc1ade1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:06 +02:00
Andreas Cadhalpun
d291535912 diracdec: check that block length is valid
In init_planes p->xblen and p->yblen are set to:
            p->xblen = s->plane[0].xblen >> s->chroma_x_shift;
            p->yblen = s->plane[0].yblen >> s->chroma_y_shift;

These are later used as block_w and block_h arguments of
s->vdsp.emulated_edge_mc. If one of them is 0 it triggers an av_assert2
in emulated_edge_mc:
    av_assert2(start_x < end_x && block_w > 0);
    av_assert2(start_y < end_y && block_h > 0);

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 21:50:06 +02:00
wm4
539603e877 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 dc87758775)

Conflicts:

	libavformat/aviobuf.c
2015-06-17 21:50:06 +02:00
Andreas Cadhalpun
f87d76e659 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 58995f647b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-16 16:36:15 +02:00
Andreas Cadhalpun
fabb394a2d 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 6fdbaa2b7f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-16 16:32:41 +02:00
Andreas Cadhalpun
ebf0a8fbda 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 b18eac7ff2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-16 16:30:40 +02:00
Andreas Cadhalpun
de8e63ca82 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-06-16 16:21:03 +02:00
Michael Niedermayer
8bb21c0310 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-06-12 15:52:29 +02:00
Deliang Fu
557aa4c6b3 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-06-11 02:42:33 +02:00
Andreas Cadhalpun
d6bde7be5f 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-06-10 12:23:24 +02:00
Michael Niedermayer
4a5a6fe6ba 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-06-10 00:56:41 +02:00
Simon Thelen
b2d7a08405 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-06-09 22:56:52 +02:00
Michael Niedermayer
4348a241ed avcodec/x86/h264_weight: handle weight1=128
Fix ticket4596

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-09 11:45:15 +02:00
Michael Niedermayer
4cb077793d 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-06-09 01:04:21 +02:00
Michael Niedermayer
78ef1be8e1 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-06-07 15:24:03 +02:00
Michael Niedermayer
57c99f8fe4 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-06-04 23:27:11 +02:00
Michael Niedermayer
c03c2f23b2 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-06-04 23:27:11 +02:00
Michael Niedermayer
eb021638a1 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-06-04 23:27:11 +02:00
Michael Niedermayer
b97fb80db9 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)

Conflicts:

	libswresample/swresample.c
2015-06-04 23:27:11 +02:00
Michael Niedermayer
41e3d5bc3a 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-06-03 22:46:49 +02:00
Michael Niedermayer
f33adf1b53 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-06-03 12:25:55 +02:00
Ganesh Ajjanagadde
0fee46e2db 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-06-03 12:00:42 +02:00
Andreas Cadhalpun
b71657324d 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:19 +02:00
Michael Niedermayer
47936e1a5c 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:21 +02:00
Michael Niedermayer
9415ebfad6 Merge commit 'e863f4cd2a5ea05c74b8beb92e55d7ed10908d64' into release/2.2
* commit 'e863f4cd2a5ea05c74b8beb92e55d7ed10908d64':
  Update Changelog for 10.7

Conflicts:
	Changelog
	RELEASE

Not merged, as this isnt the changelog from between 2 ffmpeg versions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 14:45:08 +02:00
Michael Niedermayer
443b9a7d08 Merge commit '964fef3f3ced60e67831549df223bc177e1537c9' into release/2.2
* commit '964fef3f3ced60e67831549df223bc177e1537c9':
  h264: Make sure reinit failures mark the context as not initialized

See: e8714f6f93
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 13:56:18 +02:00
Michael Niedermayer
43863fb135 Merge commit '48c7fe5b5834a197f10a6eb56cbe7cda8ee32407' into release/2.2
* commit '48c7fe5b5834a197f10a6eb56cbe7cda8ee32407':
  msrle: Use FFABS to determine the frame size in msrle_decode_pal4

Conflicts:
	libavcodec/msrledec.c

See: f7e1367f58
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 13:32:48 +02:00
Michael Niedermayer
2fb00a22dd Merge commit '60852532ba0971c4d253b755a3596e0a004a8bd9' into release/2.2
* commit '60852532ba0971c4d253b755a3596e0a004a8bd9':
  x86: cavs: Remove an unneeded scratch buffer

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 13:31:44 +02:00
Michael Niedermayer
107615e0c5 Merge commit '9eba675e549c48860601a4018df7756b57623e93' into release/2.2
* commit '9eba675e549c48860601a4018df7756b57623e93':
  configure: Disable i686 for i586 and lower CPUs

See: cdb3eee7c4
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 13:29:46 +02:00
Mikulas Patocka
7c9870d3f7 configure: Fix miscompilation for i586
If the CPU is 386, 486 or pentium, we must not use cmov in inline
assembler.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 13:29:34 +02:00
Michael Niedermayer
1eb719a3dc Merge commit '5e886756ee687be5840867d3810991efe17a66c3' into release/2.2
* commit '5e886756ee687be5840867d3810991efe17a66c3':
  mjpegenc: Fix JFIF header byte ordering

Conflicts:
	libavcodec/mjpegenc.c

See: b19313218c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 13:17:49 +02:00
Michael Niedermayer
eaf674ef04 Merge commit 'c34d1099db6f9bc49f30eb3141f87c42b01a3714' into release/2.2
* commit 'c34d1099db6f9bc49f30eb3141f87c42b01a3714':
  nut: Make sure to clean up on read_header failure

Conflicts:
	libavformat/nutdec.c

See: 361702660d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 13:12:29 +02:00
Andreas Cadhalpun
b216e8b02b nutdec: fix memleaks on error in nut_read_header
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 361702660d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 13:12:10 +02:00
Michael Niedermayer
48648f5168 Merge commit 'f29cf578923d2d4d2cf891dfc0c7ac45c641a5b7' into release/2.2
* commit 'f29cf578923d2d4d2cf891dfc0c7ac45c641a5b7':
  png: Set the color range as full range

Conflicts:
	libavcodec/pngdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 13:11:18 +02:00
Michael Niedermayer
3bedd0d232 Merge commit '0654518597e6ee2947e4a81c26f03f9aec7ef656' into release/2.2
* commit '0654518597e6ee2947e4a81c26f03f9aec7ef656':
  avi: Validate sample_size

Conflicts:
	libavformat/avidec.c

See: ca234639ac
See: c7369f3a4b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 13:03:52 +02:00
Michael Niedermayer
7666ecbbcb avformat/avidec: print a warning for negative sample_size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c7369f3a4b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 13:03:39 +02:00
Andreas Cadhalpun
0658aef53a avidec: avoid infinite loop due to negative ast->sample_size
If max in clean_index is set to a negative ast->sample_size, the
following loop never ends:
        while (max < 1024)
            max += max;

Thus set ast->sample_size to 0 if it would otherwise be negative.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 13:03:36 +02:00
Michael Niedermayer
fb2f96d9ef Merge commit '3bebca9634f05ea5da7624e3a3f35ec95341e250' into release/2.2
* commit '3bebca9634f05ea5da7624e3a3f35ec95341e250':
  nut: Check chapter creation in decode_info_header

Conflicts:
	libavformat/nutdec.c

See: 3ff1af2b0d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 13:00:48 +02:00
Andreas Cadhalpun
6dfb78d6f1 nutdec: check chapter creation in decode_info_header
This fixes a segmentation fault when accessing the metadata.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 13:00:39 +02:00
Michael Niedermayer
c9b9561614 Merge commit '1dcb68c02a55648facb82c0b2b6a1eb3dc18f988' into release/2.2
* commit '1dcb68c02a55648facb82c0b2b6a1eb3dc18f988':
  alac: Reject rice_limit 0 if compression is used

Conflicts:
	libavcodec/alac.c

See: 4b657a1b1e
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:59:57 +02:00
Andreas Cadhalpun
6443db085a alac: reject rice_limit 0 if compression is used
If rice_limit is 0, k can be 0 in decode_scalar, which calls show_bits(gb, k).

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:56:24 +02:00
Michael Niedermayer
f84672c09a Merge commit '9726f3007196a9c3589c4f09a81c0d75e1d97f2c' into release/2.2
* commit '9726f3007196a9c3589c4f09a81c0d75e1d97f2c':
  ape: Support _0000 files with nblock smaller than 64

Conflicts:
	libavcodec/apedec.c

See: 699341d647
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:50:04 +02:00
Andreas Cadhalpun
bb519be5e6 apedec: prevent out of array writes in decode_array_0000
s->decoded_buffer is allocated with a min_size of:
    2 * FFALIGN(blockstodecode, 8) * sizeof(*s->decoded_buffer)

Then it is assigned to s->decoded[0] (and s->decoded_buffer + FFALIGN(blockstodecode, 8)
to s->decoded[1]) and passed as out buffer to decode_array_0000.

In this function 64 elements of the out buffer are written
unconditionally and outside the array if blockstodecode is too small.

This causes memory corruption, leading to segmentation faults or other
crashes.

Thus change decode_array_0000 to write at most blockstodecode elements
of the out buffer.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:49:54 +02:00
Michael Niedermayer
ed393622b2 Merge commit '296d70f58517d6702bfda32178c1e395bca9665e' into release/2.2
* commit '296d70f58517d6702bfda32178c1e395bca9665e':
  mux: Do not leave stale side data pointers in ff_interleave_add_packet()

Conflicts:
	libavformat/mux.c

See: bfb3ed1a9d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:48:52 +02:00
Michael Niedermayer
3db9966152 avformat/mux: Dont leave stale side data pointers in ff_interleave_add_packet()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bfb3ed1a9d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:48:38 +02:00
Michael Niedermayer
e348564030 Merge commit 'e3c4eb87e4d9650d76f6d8d790a9b749b325e973' into release/2.2
* commit 'e3c4eb87e4d9650d76f6d8d790a9b749b325e973':
  avpacket: Check for and return errors in ff_interleave_add_packet()

Conflicts:
	libavformat/audiointerleave.c
	libavformat/internal.h
	libavformat/mux.c

See: 4d7c71c364
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:47:00 +02:00
Michael Niedermayer
c0d6afa3e6 avformat/mpegts: Also parse the FMC descriptor if the codec has not been identified yet
Fixes Detecting AAC with such descriptor if the parts needed for detection
are later in the stream

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

Conflicts:

	libavformat/mpegts.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:40:30 +02:00
Michael Niedermayer
0ca612a765 avformat/mpegts: reset last_version on seeking
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6397814926)

Conflicts:

	libavformat/mpegts.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:38:14 +02:00
Michael Niedermayer
f30a57f5af Merge commit 'feedde4d8702d554a7f46de824a887fe4d75a714' into release/2.2
* commit 'feedde4d8702d554a7f46de824a887fe4d75a714':
  mpegts: Update the PSI/SI table only if the version change

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:34:54 +02:00
Michael Niedermayer
194bd16cfa Merge commit '4c4cc9b27b69a86e405fd7612aa0a62f3b62b027' into release/2.2
* commit '4c4cc9b27b69a86e405fd7612aa0a62f3b62b027':
  rtsp: Make sure we don't write too many transport entries into a fixed-size array

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:27:33 +02:00
Michael Niedermayer
ae6429e633 Merge commit '1f1686615c20982a68b2d8db3ff109834a260d27' into release/2.2
* commit '1f1686615c20982a68b2d8db3ff109834a260d27':
  rtpenc_jpeg: Handle case of picture dimensions not dividing by 8

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:27:07 +02:00
Michael Niedermayer
a1323ec179 Merge commit '8b9d0f5d3aceb67d472d190db53a21177fea9275' into release/2.2
* commit '8b9d0f5d3aceb67d472d190db53a21177fea9275':
  mov: Fix little endian audio detection

Conflicts:
	libavformat/mov.c

See: d2549ba9df
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:26:05 +02:00
Michael Niedermayer
62355b25ad Merge commit '987a8f8514e07aba8136d491949d0b8d6bb183f9' into release/2.2
* commit '987a8f8514e07aba8136d491949d0b8d6bb183f9':
  x86: Put COPY3_IF_LT under HAVE_6REGS

Conflicts:
	libavcodec/x86/mathops.h

See: b38910c979
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:02:53 +02:00
Carl Eugen Hoyos
8580977e30 Fix compilation with !HAVE_6REGS.
Can be tested with:
$ ./configure --cc='cc -m32' --disable-optimizations --enable-pic
(cherry picked from commit b38910c979)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 12:01:29 +02:00
Michael Niedermayer
d1423cf68f Merge commit 'c7a983762ab40bca4f85be64995d5398a4307aa5' into release/2.2
* commit 'c7a983762ab40bca4f85be64995d5398a4307aa5':
  roqvideoenc: set enc->avctx in roq_encode_init

See: e407615129
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 11:59:34 +02:00
Michael Niedermayer
3c536bee54 Merge commit '891ed1184e49bc7944311302d9ece01e87c188a8' into release/2.2
* commit '891ed1184e49bc7944311302d9ece01e87c188a8':
  libvpx: Fix mixed use of av_malloc() and av_reallocp()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 11:59:02 +02:00
Reinhard Tartler
e863f4cd2a Update Changelog for 10.7 2015-05-31 11:39:39 -04:00
Luca Barbato
964fef3f3c h264: Make sure reinit failures mark the context as not initialized
Bug-Id: CVE-2015-3417
CC: libav-stable@libav.org
(cherry picked from commit 3b69f245db)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/h264_slice.c
2015-05-31 11:35:35 -04:00
Luca Barbato
48c7fe5b58 msrle: Use FFABS to determine the frame size in msrle_decode_pal4
As done in msrle_decode_8_16_24_32.

Bug-Id: CVE-2015-3395
CC: libav-stable@libav.org
2015-05-31 11:23:54 -04:00
Michael Niedermayer
60852532ba x86: cavs: Remove an unneeded scratch buffer
Simplifies the code and makes it build on certain compilers
running out of registers on x86.

CC: libav-stable@libav.org
Reported-By: mudler
(cherry picked from commit e4610300de)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 4dc0fbb13c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:23:31 -04:00
Mikulas Patocka
9eba675e54 configure: Disable i686 for i586 and lower CPUs
(cherry picked from commit b37bfbfbe5)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:22:09 -04:00
Shiina Hideaki
5e886756ee mjpegenc: Fix JFIF header byte ordering
The header had a wrong version description.

Bug-Id: 808
Signed-off-by: Shiina Hideaki <shiina@yndrd.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
(cherry picked from commit 5549f693d2)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/mjpegenc_common.c
2015-05-31 11:21:44 -04:00
Luca Barbato
c34d1099db nut: Make sure to clean up on read_header failure
Based on Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> work.

CC: libav-stable@libav.org
(cherry picked from commit 1f64b018cb)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:19:45 -04:00
wm4
f29cf57892 png: Set the color range as full range
The format uses full range for the gray formats.

CC: libav-stable@libav.org
(cherry picked from commit 0f50c53cfb)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:19:32 -04:00
Andreas Cadhalpun
0654518597 avi: Validate sample_size
And either error out or set it to 0 if it is negative.

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit a55a706448)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:19:22 -04:00
Andreas Cadhalpun
3bebca9634 nut: Check chapter creation in decode_info_header
This fixes a segmentation fault when accessing the metadata.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

CC: libav-stable@libav.org
(cherry picked from commit 21b21aed79)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:19:11 -04:00
Andreas Cadhalpun
1dcb68c02a alac: Reject rice_limit 0 if compression is used
If in compression mode rice_limit = 0 leads to call
`show_bits(gb, k)` in `decode_scalar` with k = 0.

Request a sample in case it is valid and it should be accepted.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

CC: libav-stable@libav.org
(cherry picked from commit cb5324200c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:19:02 -04:00
Andreas Cadhalpun
9726f30071 ape: Support _0000 files with nblock smaller than 64
The decode_array_0000 assumed that 64 is the minimal block size
while it is not.

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit ac1660509e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:18:50 -04:00
Michael Niedermayer
296d70f585 mux: Do not leave stale side data pointers in ff_interleave_add_packet()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
(cherry picked from commit 386e80610d)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:18:03 -04:00
Nidhi Makhijani
e3c4eb87e4 avpacket: Check for and return errors in ff_interleave_add_packet()
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit 324ff59444)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:17:37 -04:00
John Högberg
feedde4d87 mpegts: Update the PSI/SI table only if the version change
If a PAT is finished while a PMT section filter is opened but
not yet finished, the PMT section filter is closed and all
the received data is discarded.

This is usually not an issue but some multiplexers (With very
quick PAT/PMT repetition settings) consistently emit a PMT
section start, then a PAT, and then the rest of the PMT,
causing the aforementioned behavior to result in no PMT being
finished.

In the most pathologic situation the stream information are lost
and the probe fallback miscategorizes subtitles as mp3 audio.

Avoid the issue through eliminating redundant PSI/SI table
updates by checking their version field, which is required by
the standard to be incremented on every change no matter how
minor.

CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 844201e35f)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavformat/mpegts.c
2015-05-31 11:14:03 -04:00
Martin Storsjö
4c4cc9b27b rtsp: Make sure we don't write too many transport entries into a fixed-size array
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit f77c9d7161)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:11:30 -04:00
Andrey Utkin
1f1686615c rtpenc_jpeg: Handle case of picture dimensions not dividing by 8
This fixes the calculation of the number of needed blocks to make
sure that ALL pixels are represented by the result.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 4415d0f3bb)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:11:13 -04:00
Vittorio Giovara
8b9d0f5d3a mov: Fix little endian audio detection
Set this field to TRUE if the audio component is to operate on
little-endian data, and FALSE otherwise.

However TRUE and FALSE are not defined. Since this flag is just a boolean,
interpret all values except for 0 as little endian.

Sample-Id: 64bit_FLOAT_Little_Endian.mov
(cherry picked from commit 8ae4d4e117)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:10:56 -04:00
Luca Barbato
987a8f8514 x86: Put COPY3_IF_LT under HAVE_6REGS
It uses 6 registers, unbreaks building on hardened x86 system.

Bug-Id: gentoo/541930
CC: libav-stable@libav.org
(cherry picked from commit 2af720fe5f)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:10:31 -04:00
Andreas Cadhalpun
c7a983762a 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.

CC:libav-stable@libav.org
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 9f6c36d961)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 11:10:00 -04:00
Vittorio Giovara
891ed1184e libvpx: Fix mixed use of av_malloc() and av_reallocp()
This buffer is resized when vpx_codec_get_cx_data() returns a
VPX_CODEC_STATS_PKT packet.

CC: libav-stable@libav.org
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
(cherry picked from commit 7244cefd6e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-05-31 10:57:50 -04:00
Carl Eugen Hoyos
4a620243b9 lavfi/fade: Do not overread input buffer.
(cherry picked from commit ab3ff19f08)
2015-05-17 12:49:28 +02:00
Clément Bœsch
1f3ca53b8a tests: drop bc dependency
We already have a dependency on awk and bc is sometimes not found in the
base system.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit a982c5d74f)

Conflicts:
	doc/platform.texi

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2015-05-14 03:49:11 +02:00
Michael Niedermayer
2a947c9382 Merge commit 'eaa9693fed36c29dfbac896946de31eb186ac5d0' into release/2.2
* commit 'eaa9693fed36c29dfbac896946de31eb186ac5d0':
  alsdec: only adapt order for positive max_order

See: 58d605ee9b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-06 17:11:25 +02:00
Andreas Cadhalpun
e93c46b3cc alsdec: only adapt order for positive max_order
For max_order = 0 the clipping range is invalid. (amin = 2, amax = 1)

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-06 17:10:54 +02:00
Michael Niedermayer
0756fa87bf Merge commit 'd36d3ae02ca7d535de2b26fa0b3ab44387d19b6a' into release/2.2
* commit 'd36d3ae02ca7d535de2b26fa0b3ab44387d19b6a':
  alsdec: check sample pointer range in revert_channel_correlation

Conflicts:
	libavcodec/alsdec.c

See: afc7748d1f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-06 17:10:12 +02:00
Andreas Cadhalpun
3a0a2c2586 alsdec: check sample pointer range in revert_channel_correlation
Also change the type of begin, end and smp to ptrdiff_t to make the
comparison well-defined.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit afc7748d1f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-06 17:09:41 +02:00
Andreas Cadhalpun
deb0f487bd alsdec: validate time diff index
If begin is smaller than t, the subtraction 'begin -= t' wraps around,
because begin is unsigned. The same applies for end < t.

This causes segmentation faults.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-06 17:09:33 +02:00
Michael Niedermayer
f0cfa5d98a avcodec/alsdec: Use av_mallocz_array() for chan_data to ensure the arrays never contain random data
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7e104647a3)

Conflicts:

	libavcodec/alsdec.c
2015-05-06 17:09:29 +02:00
Andreas Cadhalpun
f0bf5c538a 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-05-06 17:09:24 +02:00
Michael Niedermayer
36c5bb6a72 Merge commit 'b0b92ee04d1ee49a5d8b1aca718ea7d7d44932aa' into release/2.2
* commit 'b0b92ee04d1ee49a5d8b1aca718ea7d7d44932aa':
  aacpsy: correct calculation of minath in psy_3gpp_init

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-06 17:02:16 +02:00
Michael Niedermayer
74409bff4c Merge commit 'd0e66cb1c7cf2a9ef12963cdc6fd49a35599a9dd' into release/2.2
* commit 'd0e66cb1c7cf2a9ef12963cdc6fd49a35599a9dd':
  alsdec: limit avctx->bits_per_raw_sample to 32

See: 4c2b88678b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-06 17:01:46 +02:00
Andreas Cadhalpun
645bc99772 alsdec: limit avctx->bits_per_raw_sample to 32
avctx->bits_per_raw_sample is used in get_sbits_long, which only
supports up to 32 bits.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-06 17:01:34 +02:00
Michael Niedermayer
55376ef978 Merge commit '941972d9e9806e30f978e8fd033671fd30a80a07' into release/2.2
* commit '941972d9e9806e30f978e8fd033671fd30a80a07':
  aasc: return correct buffer size from aasc_decode_frame

See: 0be54ad280
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-06 16:50:29 +02:00
Michael Niedermayer
b34afd94ec Merge commit 'bac0850fbf870d4354d0f68840c0b1c9c1425c4a' into release/2.2
* commit 'bac0850fbf870d4354d0f68840c0b1c9c1425c4a':
  matroskadec: fix crash when parsing invalid mkv

Conflicts:
	libavformat/matroskadec.c

See: d9fe6b926c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-06 16:46:59 +02:00
Andreas Cadhalpun
eaa9693fed alsdec: only adapt order for positive max_order
For max_order = 0 the clipping range is invalid. (amin = 2, amax = 1)

CC: libav-stable@libav.org
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 60f1cc4a1f)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 378ee3bad5)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-05-05 21:59:22 +02:00
Andreas Cadhalpun
d36d3ae02c alsdec: check sample pointer range in revert_channel_correlation
Also change the type of begin, end and smp to ptrdiff_t to make the
comparison well-defined.

CC: libav-stable@libav.org
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 94bb1ce882)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 41a89cba60)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-05-05 21:59:19 +02:00
Andreas Cadhalpun
b0b92ee04d aacpsy: correct calculation of minath in psy_3gpp_init
The minimum of the ath(x, ATH_ADD) function depends on ATH_ADD.
This patch uses the first order approximation to determine it.

For ATH_ADD = 4 this results in the value at 3407.06812 (-5.24241638)
not the one at 3410 (-5.24237967).

CC: libav-stabl@libav.org
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 110f7f35fb)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 7b66cf5ce7)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-05-05 21:59:15 +02:00
Andreas Cadhalpun
d0e66cb1c7 alsdec: limit avctx->bits_per_raw_sample to 32
avctx->bits_per_raw_sample is used in get_sbits_long, which only
supports up to 32 bits.

CC: libav-stable@libav.org
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit e191aaca44)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 97010c74cb)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-05-05 21:59:11 +02:00
Andreas Cadhalpun
941972d9e9 aasc: return correct buffer size from aasc_decode_frame
CC: libav-stable@libav.org
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 8fc8024ea5)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 0d3a7dd264)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-05-05 21:59:07 +02:00
Thomas Guillem
bac0850fbf 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>
(cherry picked from commit 3e1c9da38b)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavformat/matroskadec.c
2015-04-18 17:06:07 +02:00
Michael Niedermayer
1c14b09caf 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-17 14:38:37 +02:00
Andreas Cadhalpun
a2908d49d1 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-16 23:33:53 +02:00
Andreas Cadhalpun
fc9514bf4d 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-16 20:36:36 +02:00
Andreas Cadhalpun
e863d17e62 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-16 19:35:06 +02:00
Andreas Cadhalpun
3757ef017c 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-16 19:04:00 +02:00
Michael Niedermayer
ef1d4873a0 Update for 2.2.15
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-16 16:17:18 +02:00
Andreas Cadhalpun
800d974cc4 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-16 16:03:24 +02:00
Michael Niedermayer
82d3dd44aa 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)

Conflicts:

	libavcodec/h264.c
2015-04-16 16:03:24 +02:00
Michael Niedermayer
684f86391d 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-16 16:03:24 +02:00
Michael Niedermayer
2b69da7b5a 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)

Conflicts:

	libavcodec/h264.c
2015-04-16 16:03:24 +02:00
Michael Niedermayer
0df90898f5 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)

Conflicts:

	libavcodec/h264_slice.c
2015-04-16 16:03:24 +02:00
Timothy Gu
67a4811c88 tests: Fix test name for pixfmts tests(cherry picked from commit e1ee0521a6)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-16 16:03:23 +02:00
James Almer
733cb1c6c5 doc: add aarch64 cpuflags to fftools documentation
Signed-off-by: James Almer <jamrial@gmail.com>
2015-04-11 19:54:24 -03:00
James Almer
57f271ce41 doc: add missing x86 cpuflags to fftools documentation
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 410c93cfd5)
2015-04-11 19:52:02 -03:00
Timothy Gu
83ac312c3c tests/fate.sh: report different status for different errors
The order of error codes will be useful in my future fateserver patches.

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cc0057a31c)
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2015-04-07 12:43:32 +02:00
Michael Niedermayer
8f026e2b38 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)

Conflicts:

	libavcodec/h264.c
2015-04-07 12:43:06 +02:00
Michael Niedermayer
3852b172e7 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)

Conflicts:

	libavcodec/h264_slice.c
2015-04-07 12:43:06 +02:00
Michael Niedermayer
e63f330a1c ffmpeg: Fix extradata allocation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4d02dfbde4)

Conflicts:

	ffmpeg.c
2015-04-07 12:43:06 +02:00
Michael Niedermayer
6496cbee69 avcodec/h264_refs: Do not set reference to things which dont exist
Fixes deadlock
Fixes Ticket4428
Fixes Ticket4429

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-07 12:43:06 +02:00
Michael Niedermayer
5b4e58ed4c avcodec/h264: Fail for invalid mixed IDR / non IDR frames in slice threading mode
Fixes Ticket4408

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-07 12:43:06 +02:00
Michael Niedermayer
c701506525 avutil/pca: Check for av_malloc* failures
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dadc43eee4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-07 12:43:05 +02:00
Michael Niedermayer
33877cd276 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-04-07 12:43:05 +02:00
Michael Niedermayer
691dbc628a 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-04-07 12:43:05 +02:00
Michael Niedermayer
58e055cb26 avcodec/hevc_ps: More complete window reset
Fixes out of array read
Fixes: signal_sigsegv_35bcf26_471_cov_2806540268_CAINIT_A_SHARP_4.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 57e5812198)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-07 12:43:05 +02:00
Anton Khirnov
fdb8a35b02 hevc: make the crop sizes unsigned
(cherry picked from commit c929659bdd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-07 12:43:05 +02:00
Michael Niedermayer
3ce32f6401 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-04-07 12:43:05 +02:00
Michael Niedermayer
0bcb669ecc 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-04-07 12:43:05 +02:00
James Almer
0b51e0baea 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:12:31 -03:00
Michael Niedermayer
bf0d2ee92c 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-14 21:59:49 +01:00
Michael Niedermayer
53239e50ed 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-14 21:58:28 +01:00
Michael Niedermayer
0746f5035e Update for FFmpeg 2.2.14
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:41:10 +01:00
Andreas Cadhalpun
88cc4a405a ffmdec: fix infinite loop at EOF
If EOF is reached, while skipping bytes, avio_tell(pb) won't change
anymore, resulting in an infinite loop.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Vittorio Giovara
5537faaf19 aic: Fix decoding files with odd dimensions
Normally the aic decoder finds the proper slice combination (multiple of
some number less than 32) but in case of odd width, it resorts to the
default values, which were actually swapped.
The number of slices is modified to account for such odd width cases.

CC: libav-stable@libav.org
(cherry picked from commit e878ec0d47)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Michael Niedermayer
d8a8b3948c avcodec/tiff: move bpp check to after "end:"
This ensures that all current and future code-pathes get bpp checked

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Andreas Cadhalpun
917ce36a20 doc: avoid the incorrect phrase 'allow to'
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 10fd7ff814)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Michael Niedermayer
2e5579bbb4 avcodec/utils: Align YUV411 by as much as the other YUV variants
Fixes out of array accesses
Fixes: ffmpeg_mjpeg_crash2.avi

Found-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Tested-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e3201c38d5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Ronald S. Bultje
2cde388aea vp9: fix segmentation map retention with threading enabled.
Fixes ticket 4359.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Ronald S. Bultje
77e8bd8ce6 vp9: ignore reference segmentation map if error_resilience flag is set.
Fixes ffvp9_fails_where_libvpx.succeeds.webm from ticket 3849.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Stefano Sabatini
6155d5d98b doc/protocols/tcp: fix units of listen_timeout option value, from microseconds to milliseconds
s->listen_timeout is passed to ff_listen_bind(), which accepts a timeout
value expressed in milliseconds.

The unit was incorrectly set in 1b4da43ce0.
(cherry picked from commit 6db20926c3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Steve Lhomme
7ed19bd337 fix VP9 packet decoder returning 0 instead of the used data size
See https://trac.videolan.org/vlc/ticket/14022#comment:6

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Andreas Cadhalpun
97fb0b2109 avformat/flvenc: check that the codec_tag fits in the available bits
flags is later written with avio_w8 and if it doesn't fit in one byte it
triggers an av_assert2.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Michael Niedermayer
e32e1e3a4f swscale/utils: clear formatConvBuffer on allocation
Fixes use of uninitialized memory
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Andreas Cadhalpun
4e11780b85 avformat/bit: only accept the g729 codec and 1 channel
Other codecs/channel numbers are not supported by this muxer.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Andreas Cadhalpun
3183c20781 avformat/bit: check that pkt->size is 10 in write_packet
Ohter packet sizes are not supported by this muxer.

This avoids a null pointer dereference of pkt->data.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Andreas Cadhalpun
3193f4d3f2 avformat/adxdec: check avctx->channels for invalid values
This avoids a null pointer dereference of pkt->data.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Dyami Caliri
265ad094a8 Fix buffer_size argument to init_put_bits() in multiple encoders.
Several encoders were multiplying the buffer size by 8, in order to get
a bit size. However, the buffer_size argument is for the byte size of
the buffer. We had experienced crashes encoding prores (Anatoliy) at
size 4096x4096.
(cherry picked from commit 50833c9f7b)

Conflicts:

	libavcodec/proresenc_kostya.c
2015-03-14 14:27:23 +01:00
James Cowgill
b9d09fb8c9 mips/acelp_filters: fix incorrect register constraint
Change register constraint on the v variable from = to +. This was causing GCC
to think that the v variable was never read and therefore not initialize it.

This fixes about 20 fate failures on mips64el.

Signed-off-by: James Cowgill <james410@cowgill.org.uk>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b9de1303a6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Michael Niedermayer
a3cd26aa33 avcodec/hevc_ps: Sanity checks for some log2_* values
log2 values which imply numeric overflow are not supported

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Michael Niedermayer
c803985132 avcodec/zmbv: Check len before reading in decode_frame()
Fixes out of array read
Fixes: asan_heap-oob_4d4eb0_3994_cov_3169972261_zmbv_15bit.avi

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Michael Niedermayer
ec7c1cd733 avcodec/h264: Only reinit quant tables if a new PPS is allowed
Fixes null pointer dereference
Fixes: signal_sigsegv_3042097_3007_cov_1741463594_non_monotone_timestamps1.mkv

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

Conflicts:

	libavcodec/h264_slice.c
2015-03-14 14:27:23 +01:00
Michael Niedermayer
c4d250abca avcodec/snowdec: Fix ref value check
Fixes integer overflow and out of array read.
Fixes: signal_sigsegv_24169e6_3445_cov_3778346427_snow_chroma_bug.avi

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Michael Niedermayer
d125abfa74 swscale/utils: More carefully merge and clear coefficients outside the input
Fixes out of array read
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Andreas Cadhalpun
e29761b1c8 avcodec/a64multienc: fix use of uninitialized values in to_meta_with_crop
Averaging over 2 pixels doesn't work correctly for the last pixel, because the
rest of the buffer is not initialized.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Michael Niedermayer
5c4dc00c3a avcodec/a64multienc: don't set incorrect packet size
This fixes invalid reads of the packet buffer in av_dup_packet

Based on patch by Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>

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

Conflicts:

	libavcodec/a64multienc.c
2015-03-14 14:27:23 +01:00
Andreas Cadhalpun
baa1738f99 avcodec/a64multienc: use av_frame_ref instead of copying the frame
This fixes freeing the frame buffer twice on cleanup leading to a crash.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:23 +01:00
Michael Niedermayer
1a396d1ee0 avcodec/x86/mlpdsp_init: Simplify mlp_filter_channel_x86()
Based on patch by Francisco Blas Izquierdo Riera
Commit message partly taken from carl

fixes a compilation
error in mlpdsp_init.c with -fstack-check and some gcc compilers (I
reproduced the issue with gcc 4.7.3) by simplifying the code.

See also https://bugs.gentoo.org/show_bug.cgi?id=471756

$ make libavcodec/x86/mlpdsp_init.o
libavcodec/x86/mlpdsp_init.c: In function ‘mlp_filter_channel_x86’:
libavcodec/x86/mlpdsp_init.c:142:5: error: can’t find a register in
class ‘GENERAL_REGS’ while reloading ‘asm’
libavcodec/x86/mlpdsp_init.c:142:5: error: ‘asm’ operand has impossible
constraints

4551 -> 4509 dezicycles

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 03f39fbb2a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:22 +01:00
Michael Niedermayer
2bb09b714a avformat/omadec: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0f55bc29d4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:22 +01:00
Michael Niedermayer
c5c39132b4 avformat/vqf: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb08687180)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:22 +01:00
Michael Niedermayer
c4b5b3309c avformat/mvdec: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 26c0cc154e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:22 +01:00
Michael Niedermayer
2ee4b48c9b avformat/gxf: Use 64bit for res to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 12987f8900)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:22 +01:00
Michael Niedermayer
1077380513 avformat/idcin: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d1923d15a3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:22 +01:00
Michael Niedermayer
a15ceebb6f avformat/asfdec: Use 64bit ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d4936d28a1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 14:27:22 +01:00
Andreas Cadhalpun
7a3ff7fb81 ffmdec: make sure the time base is valid
A negative time base can trigger assertions.

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

Conflicts:

	libavformat/ffmdec.c
(cherry picked from commit 9678ceb6976ca8194848b24535785a298521211f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 00:18:24 +01:00
Michael Niedermayer
e75bb490ca 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-11 00:18:22 +01:00
Michael Niedermayer
f8bb156fa1 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-11 00:18:22 +01:00
Andreas Cadhalpun
e407615129 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-11 00:18:22 +01:00
Michael Niedermayer
313492c0bd 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-11 00:18:22 +01:00
Andreas Cadhalpun
4f53eaaafa 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-11 00:18:22 +01:00
Michael Niedermayer
1177e047f1 Merge commit '8ae0d702a1ba1c3c8d88a29c181f8434f25bf53c' into release/2.2
* commit '8ae0d702a1ba1c3c8d88a29c181f8434f25bf53c':
  doc: More changelog updates for v10.6

Conflicts:
	Changelog

not merged

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 13:28:40 +01:00
Michael Niedermayer
66342aab73 Merge commit 'e032e647dd79e7748145792dfee0358eccb1982e' into release/2.2
* commit 'e032e647dd79e7748145792dfee0358eccb1982e':
  utvideodec: Handle slice_height being zero

See: 3881606240
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 13:28:01 +01:00
Michael Niedermayer
17b2ad6f43 Merge commit 'eb9041403d820634c45ed4ee98570246a252507a' into release/2.2
* commit 'eb9041403d820634c45ed4ee98570246a252507a':
  tiff: Check that there is no aliasing in pixel format selection

Conflicts:
	libavcodec/tiff.c

See: e1c0cfaa41
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 13:27:22 +01:00
Michael Niedermayer
19640e99df Merge commit '0051174c70810b66378cf8ea093eab01302f6049' into release/2.2
* commit '0051174c70810b66378cf8ea093eab01302f6049':
  rmenc: limit packet size

Conflicts:
	libavformat/rmenc.c

See: 08728f400b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 13:26:02 +01:00
Michael Niedermayer
4b70e6e6e5 Merge commit '61c966ef30129a0e4dba485242c039a895914d33' into release/2.2
* commit '61c966ef30129a0e4dba485242c039a895914d33':
  webp: validate the distance prefix code

See: c089e720c1
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 13:05:54 +01:00
Michael Niedermayer
1d9a93682d Merge commit '772f50c1f3e4a50ce3f35e31a6f0cd64e7cbe818' into release/2.2
* commit '772f50c1f3e4a50ce3f35e31a6f0cd64e7cbe818':
  rv10: check size of s->mb_width * s->mb_height

Conflicts:
	libavcodec/rv10enc.c

See: 2578a54618
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 13:05:04 +01:00
Michael Niedermayer
51c580102d Merge commit '0eb8786eac1f4a2132ad80dc49f90d5f81665c5c' into release/2.2
* commit '0eb8786eac1f4a2132ad80dc49f90d5f81665c5c':
  eamad: check for out of bounds read

Conflicts:
	libavcodec/eamad.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 13:00:10 +01:00
Andreas Cadhalpun
25b73ae265 avformat/rm: limit packet size
The chunk size is limited to 0xFFFF (written by avio_wb16), so make
sure that the packet size is not too large.

Such large frames need to be split into slices smaller than 64 kB, but
that is currently supported neither by the rv10/rv20 encoders nor the rm
muxer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>

See Ticket244

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:58:53 +01:00
Andreas Cadhalpun
b55be8b266 avcodec/webp: validate the distance prefix code
According to the WebP Lossless Bitstream Specification the highest
allowed value for a prefix code is 39.

If prefix_code is too large, the calculated extra_bits has an invalid
value and triggers an assertion in get_bits.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:58:39 +01:00
Andreas Cadhalpun
fc6a00d20d avcodec/rv10: check size of s->mb_width * s->mb_height
If it doesn't fit into 12 bits it triggers an assertion.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:58:34 +01:00
Andreas Cadhalpun
c0dc649e81 webp: ensure that each transform is only used once
According to the WebP Lossless Bitstream Specification
"each transform is allowed to be used only once".

If a transform is more than once this can lead to memory
corruption.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:58:15 +01:00
Michael Niedermayer
ce167a49ba Merge commit 'b2b359f12465c8445484be24278b324da8ebb0e1' into release/2.2
* commit 'b2b359f12465c8445484be24278b324da8ebb0e1':
  mdec: check for out of bounds read

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:50:05 +01:00
Michael Niedermayer
4e6f1df657 Merge commit '0ad8d751337efbbd61c0d78762448b043100b653' into release/2.2
* commit '0ad8d751337efbbd61c0d78762448b043100b653':
  configure: Properly fail when libcdio/cdparanoia is not found

Conflicts:
	configure

See: f514b5dff7
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:49:05 +01:00
Michael Niedermayer
bec350611e Merge commit '7fd11fbeeb41990427b475dc0d8800d2cf15a8c4' into release/2.2
* commit '7fd11fbeeb41990427b475dc0d8800d2cf15a8c4':
  arm: Suppress tags about used cpu arch and extensions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:48:18 +01:00
Michael Niedermayer
895ddf1a80 Merge commit '470fd8e64e292d2336b2b860437dcbc053ba9eec' into release/2.2
* commit '470fd8e64e292d2336b2b860437dcbc053ba9eec':
  Update Changelog for v10.6

Conflicts:
	Changelog

not merged

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:40:22 +01:00
Michael Niedermayer
e48f2847ab Merge commit 'f74f4a540151aacb38306f2e41a160c326be3d51' into release/2.2
* commit 'f74f4a540151aacb38306f2e41a160c326be3d51':
  Prepare for 10.6 Release

Conflicts:
	RELEASE

Not merged

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:38:44 +01:00
Michael Niedermayer
71c63e799f Merge commit 'c47cdf837c1b52681a84f434443e1f993757a5e9' into release/2.2
* commit 'c47cdf837c1b52681a84f434443e1f993757a5e9':
  img2dec: correctly use the parsed value from -start_number

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:35:20 +01:00
Michael Niedermayer
45eb2a0d49 Merge commit '91ef250713d04d675a16e5b030d7226baafe3f82' into release/2.2
* commit '91ef250713d04d675a16e5b030d7226baafe3f82':
  h264_cabac: Break infinite loops

Conflicts:
	libavcodec/h264_cabac.c

See: cdf0877bc3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:27:47 +01:00
Michael Niedermayer
019b4b0650 Merge commit '3670942fae7beb2bfde52557ee95eab5f536e624' into release/2.2
* commit '3670942fae7beb2bfde52557ee95eab5f536e624':
  h264: initialize H264Context.avctx in init_thread_copy

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:24:50 +01:00
Michael Niedermayer
e3654b25cf Merge commit 'fa4604d80580dde45bfce32ebe04a5c13c233895' into release/2.2
* commit 'fa4604d80580dde45bfce32ebe04a5c13c233895':
  h264: Do not share rbsp_buffer across threads

Conflicts:
	libavcodec/h264.c

See: ecbf838c7d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:24:04 +01:00
Michael Niedermayer
b837d5bf83 Merge commit '03fbb6ff3d28f639ea5a35aba3c6dca09c17225d' into release/2.2
* commit '03fbb6ff3d28f639ea5a35aba3c6dca09c17225d':
  h264: only ref cur_pic in update_thread_context if it is initialized

Conflicts:
	libavcodec/h264.c

See: 0fc01ae33c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:11:40 +01:00
Reinhard Tartler
8ae0d702a1 doc: More changelog updates for v10.6 2015-03-08 22:04:40 -04:00
Michael Niedermayer
e032e647dd utvideodec: Handle slice_height being zero
Fixes out of array accesses.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Bug-Id: CVE-2014-9604
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 0ce3a0f9d9)
(cherry picked from commit 3a417a86b3)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-03-08 22:04:40 -04:00
Anton Khirnov
eb9041403d tiff: Check that there is no aliasing in pixel format selection
Fixes possible issues with unexpected bpp/bppcount values.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Bug-Id: CVE-2014-8544
(cherry picked from commit ae5e1f3d66)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-03-08 22:04:40 -04:00
Andreas Cadhalpun
0051174c70 rmenc: limit packet size
The chunk size is limited to UINT16_MAX (written by avio_wb16), so make
sure that the packet size is not too large.

Such large frames need to be split into slices smaller than 64 kB, but
that is currently supported neither by the rv10/rv20 encoders nor the rm
muxer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-03-08 19:36:26 +00:00
Andreas Cadhalpun
61c966ef30 webp: validate the distance prefix code
According to the WebP Lossless Bitstream Specification the highest
allowed value for a prefix code is 39.

If prefix_code is too large, the calculated extra_bits has an invalid
value and triggers an assertion in get_bits.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-03-08 19:36:18 +00:00
Andreas Cadhalpun
772f50c1f3 rv10: check size of s->mb_width * s->mb_height
If it doesn't fit into 12 bits it triggers an assertion.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-03-08 19:36:12 +00:00
Federico Tomassetti
0eb8786eac eamad: check for out of bounds read
Bug-Id: CID 1257500
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-03-08 19:36:06 +00:00
Federico Tomassetti
b2b359f124 mdec: check for out of bounds read
Bug-Id: CID 1257501
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-03-08 19:35:56 +00:00
Vittorio Giovara
0ad8d75133 configure: Properly fail when libcdio/cdparanoia is not found 2015-03-08 19:35:48 +00:00
Martin Storsjö
7fd11fbeeb arm: Suppress tags about used cpu arch and extensions
When all the codepaths using manually set .arch/.fpu code is
behind runtime detection, the elf attributes should be suppressed.

This allows tools to know that the final built binary doesn't
strictly require these extensions.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit dcae2e32f7
and b77e335e44)
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-03-08 18:12:02 +02:00
Reinhard Tartler
470fd8e64e Update Changelog for v10.6 2015-03-08 11:20:46 -04:00
Reinhard Tartler
f74f4a5401 Prepare for 10.6 Release 2015-03-08 11:16:33 -04:00
Vittorio Giovara
c47cdf837c img2dec: correctly use the parsed value from -start_number
Previously the image sequence was always starting from the minimum
number rather than the requested one.

CC: libav-stable@libav.org
2015-02-22 23:56:00 +00:00
Michael Niedermayer
91ef250713 h264_cabac: Break infinite loops
This fixes out of array reads and/or infinite loops.

30 is the maximum number of bits that can be read into
coeff_abs below.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-22 23:55:53 +00:00
Anton Khirnov
3670942fae h264: initialize H264Context.avctx in init_thread_copy
This prevents using a wrong (first thread's) AVCodecContext if decoding
a frame in the first pass over all threads fails.

(cherry picked from commit a06b0b1295)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 2686dab45e)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-02-21 09:41:30 +01:00
Michael Niedermayer
fa4604d805 h264: Do not share rbsp_buffer across threads
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

CC: libav-stable@libav.org
(cherry picked from commit 61928b68dc)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 06d433366c)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-02-21 09:41:24 +01:00
Anton Khirnov
03fbb6ff3d h264: only ref cur_pic in update_thread_context if it is initialized
It may be empty if the previous thread's decode call did not contain a
valid frame.

(cherry picked from commit 0dea4c77cc)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 1dbfaa34e6)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavcodec/h264_slice.c
2015-02-21 09:40:43 +01:00
Michael Niedermayer
36cfee3adc Update for 2.2.13
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:50:54 +01:00
Michael Niedermayer
2dca276dcb avcodec/arm/videodsp_armv5te: Fix linking failure with "g++ -shared -D__STDC_CONSTANT_MACROS -o test.so ... libavcodec.a"
Tested-by: Andreas Haupt
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cab6302534)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:19 +01:00
Michael Niedermayer
0ee5f46fd1 avcodec/mjpegdec: Skip blocks which are outside the visible area
Fixes out of array accesses
Fixes: ffmpeg_mjpeg_crash.avi

Found-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 08509c8f86)

Conflicts:

	libavcodec/mjpegdec.c
2015-02-17 19:43:19 +01:00
Carl Eugen Hoyos
b1b69baa01 lavc/aarch64: Do not use the neon horizontal chroma loop filter for H.264 4:2:2.
(cherry picked from commit 4faea46bd9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:19 +01:00
Michael Niedermayer
f0526bc21e avcodec/h264_slice: ignore SAR changes in slices after the first
Fixes race condition and null pointer dereference
Fixes: signal_sigsegv_1472ac3_468_cov_2915641226_CABACI3_Sony_B.jsv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Conflicts:

	libavcodec/h264_slice.c
2015-02-17 19:43:19 +01:00
Michael Niedermayer
0afe061f28 avcodec/h264_slice: Check picture structure before setting the related fields
This might fix a hypothetical race condition

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Conflicts:

	libavcodec/h264_slice.c
2015-02-17 19:43:19 +01:00
Michael Niedermayer
e6093f5b85 avcodec/h264_slice: Do not change frame_num after the first slice
Fixes potential race condition
Fixes: signal_sigsegv_1472ac3_468_cov_2915641226_CABACI3_Sony_B.jsv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Conflicts:

	libavcodec/h264_slice.c
2015-02-17 19:43:19 +01:00
Michael Niedermayer
8323f09442 avutil/opt: Fix type used to access AV_OPT_TYPE_SAMPLE_FMT
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1750b45cdf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
68d83bc3a6 avutil/opt: Fix types used to access AV_OPT_TYPE_PIXEL_FMT
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a0640e6346)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
0c9d465e98 avcodec/h264: Be more strict on rejecting pps/sps changes
Fixes race condition
Fixes: signal_sigsegv_1472ac3_468_cov_2915641226_CABACI3_Sony_B.jsv

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

Conflicts:

	libavcodec/h264_slice.c
2015-02-17 19:43:18 +01:00
Michael Niedermayer
a3dca10470 avcodec/h264: Be more strict on rejecting pps_id changes
Fixes race condition
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 31cc9c04ca)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
eca1e3dcc8 avcodec/h264_ps: More completely check the bit depths
Fixes out of array read
Fixes: asan_static-oob_30328b6_719_cov_3325483287_H264_artifacts_motion.h264

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
7c3a3d47cf avformat/thp: Check av_get_packet() for failure not only for partial output
Fixes null pointer dereference
Fixes: signal_sigsegv_db2c1f_3108_cov_163322880_pikmin2_opening1_partial.thp

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
bd9c755b22 swscale/utils: Limit filter shifting so as not to read from prior the array
Fixes out of array read
Fixes: asan_heap-oob_1fb2f9b_3780_cov_3984375136_usf.mkv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
4c246c65bf avcodec/mjpegdec: Check number of components for JPEG-LS
Fixes out of array accesses
Fixes: asan_heap-oob_1c1a4ea_1242_cov_2274415971_TESTcmyk.jpg

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

Conflicts:

	libavcodec/mjpegdec.c
2015-02-17 19:43:18 +01:00
Michael Niedermayer
b0d3873085 avcodec/mjpegdec: Check escape sequence validity
Fixes assertion failure
Fixes: asan_heap-oob_1c1a4ea_1242_cov_2274415971_TESTcmyk.jpg

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
b902eab45a avformat/mpc8: Use uint64_t in *_get_v() to avoid undefined behavior
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 05e1619529)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
wm4
79d86b844f avformat/mpc8: fix broken pointer math
This could overflow and crash at least on 32 bit systems.

Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b737a2c528)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
wm4
3d8c51d699 avformat/mpc8: fix hang with fuzzed file
This can lead to an endless loop by seeking back a few bytes after each
attempted chunk read. Assuming negative sizes are always invalid, this
is easy to fix. Other code in this demuxer treats negative sizes as
invalid as well.

Fixes ticket #4262.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
wm4
c7dc73a6c3 avformat/tta: fix crash with corrupted files
av_add_index_entry() can fail, for example because the parameters are
invalid, or because memory allocation fails. Check this; it can actually
happen with corrupted files.

The second hunk is just for robustness. Just in case functions like
ff_reduce_index() remove entries. (Not sure if this can actually
happen.)

Fixes ticket #4294.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6a0cd529a3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
4f2299b6b5 avcodec/mpegvideo_enc: Fix number suffixes in rc_buffer_size calculation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4531e2c489)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
004cdd8b15 avcodec/h264_cabac: use int instead of long for mbb_xy
The mb address fits in int

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
cd5c78c804 avformat/omadec: fix number suffix
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f1f7f5903a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
ab17d11310 avformat/smacker: Fix number suffix
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 465f3705b1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
d0ed336d8a avformat/matroskadec: Fix number suffixes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fc3cdb00d0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
56e07e4caf avcodec/dxtory: Use LL instead of L number suffix
This is probably unneeded and normal int would be fine, but its
safer to use LL and this isnt speed relevant

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
e61a7c9b45 swresample/dither: Cleanup number suffixes
The <<31 case needs LL

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
56976346d9 avformat/utils: Fix number suffixes in tb_unreliable()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4b15bba2ae)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
e5b878b37f Merge commit 'a9602c6cfbe6fa06ff97ad01c0ffa9ad5ccff30f' into release/2.2
* commit 'a9602c6cfbe6fa06ff97ad01c0ffa9ad5ccff30f':
  matroskadec: Fix read-after-free in matroska_read_seek()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:29:50 +01:00
Clément Bœsch
d5b20daeb0 avcodec/gif: fix off by one in column offsetting finding
(cherry picked from commit f9240ec01a)
2015-02-16 18:20:08 +01:00
Xiaohan Wang
a9602c6cfb matroskadec: Fix read-after-free in matroska_read_seek()
In matroska_read_seek(), |tracks| is assigned at the begining of the
function. However, functions like matroska_parse_cues() could reallocate
the tracks and invalidate |tracks|.

This assigns |tracks| only before using it, so that it will not get
invalidated elsewhere.

Bug-Id: chromium/427266
2015-01-27 14:35:24 +00:00
Michael Niedermayer
86a01362c0 Update for FFmpeg 2.2.12
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:39:09 +01:00
Michael Niedermayer
9789612689 Makefile: add dependencies which require ffversion.h
Without this ffversion.h could sometimes be built too late

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
3769601fb6 Add FFMPEG_VERSION into the binary libs
This simplifies identifying from which revision a binary of a lib came from

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

Conflicts:

	libavdevice/avdevice.c
	libswresample/swresample.c
2015-01-20 03:27:17 +01:00
Michael Niedermayer
2528468e20 avcodec/indeo3: ensure offsets are non negative
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 368642361f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
f1d59a207f avcodec/h264: Check *log2_weight_denom
Fixes undefined behavior
Fixes: signal_sigsegv_14768d2_2248_cov_3629497219_h264_h264___pi_20070614T182942.h264
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 61296d41e2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
85b2396265 avcodec/hevc_ps: Check diff_cu_qp_delta_depth
Fixes undefined behavior
Fixes: asan_static-oob_17aa046_582_cov_1577759978_DBLK_G_VIXS_1.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3281fa8925)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
25dc978bb1 avcodec/h264: Clear delayed_pic on deallocation
Fixes use of freed memory

Fixes: case5_av_frame_copy_props.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e8714f6f93)

Conflicts:

	libavcodec/h264.c
2015-01-20 03:27:17 +01:00
Michael Niedermayer
13838647ca avcodec/hevc: clear filter_slice_edges() on allocation
This avoids use of uninitialized memory
Fixes: asan_static-oob_17aa046_582_cov_212287884_DBLK_G_VIXS_1.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8aa8d12554)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
133dc77da9 avcodec/dcadec: Check that the added xch channel isnt already there
Fixes null pointer dereference
Fixes: signal_sigsegv_369609d_623_cov_2008234281_ES_6.1_16bit.dts
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7d593495e4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
9ce4686bfe avcodec/indeo3: use signed variables to avoid underflow
Fixes out of array read
Fixes: signal_sigsegv_1b0a4da_1865_cov_2167818389_computer_anger.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3305acdc92)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
50e04b3f3c avcodec/h264: make the first field of H264Context an AVClass
Fixes use of freed memory
Fixes: asan_heap-uaf_3660f67_757_cov_1257014655_Hi422FR1_SONY_A.jsv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f3b5b139ad)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
226727f08f swscale: increase yuv2rgb table headroom
Fixes out of array access
Fixes: case2_bad_read_yuv2rgbx32.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
b8021620e2 avformat/mov: fix integer overflow of size
Fixes: case1_call_stack_overflow.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
a0f4f12b62 avformat/mov: check atom nesting depth
Fixes call stack overflow
Fixes: case1_call_stack_overflow.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit caa7a3914f)

Conflicts:

	libavformat/isom.h

Conflicts:

	libavformat/isom.h
2015-01-20 03:27:17 +01:00
Michael Niedermayer
c351cd720a avcodec/utvideodec: Fix handling of slice_height=0
Fixes out of array accesses
Fixes: asan_heap-oob_25bcd7e_3783_cov_3553517262_utvideo_rgba_median.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3881606240)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
7279be7c75 avcodec/vmdvideo: Check len before using it in method 3
Fixes out of array access
Fixes: asan_heap-oob_4d23ba_91_cov_3853393937_128.vmd

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
f5fd937fc5 avformat/flvdec: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 91ea466551)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
de43442391 avformat/hdsenc: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 16d763fa45)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
3b9cb8d7d8 configure: create the tests directory like the doc directory
This fixes an issue where the tests directory is not created for out of tree
builds before its needed

Tested-by: Dave Yeo <daveryeo@telus.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e631872f13)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
wm4
b9510b3274 lavu/frame: fix malloc error path in av_frame_copy_props()
The error path frees all side data, but forgets to reset the side data
count. This can blow up later in av_frame_unref() and free_side_data().

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
30099bf0f0 avformat/utils: Do not update programs streams from program-less streams in update_wrap_reference()
Fixes Ticket3686

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Michael Niedermayer
f2fde86dae avformat/aviobuf: Check that avio_seek() target is non negative
Fixes out of array access

Suggested-by: Andrew Scherkus <scherkus@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ed86dbd05d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:16 +01:00
Rob Sykes
a40e6a214e swresample/soxr_resample: fix error handling
Fixes CID1257659

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:16 +01:00
Michael Niedermayer
3e8b73e65b avformat/rmdec: Check for overflow in ff_rm_read_mdpr_codecdata()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 03abf55f25)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-18 00:27:55 +01:00
Michael Niedermayer
8babbdc9b1 avcodec/flac_parser: fix handling EOF if no headers are found
Fixes assertion failure
Fixes Ticket4269

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-17 02:13:00 +01:00
Michael Niedermayer
e91df69cf2 avfilter/vf_framepack: Check and update frame_rate
The frame_rate update was missing leaving the output frame rate
wrong.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-16 22:12:33 +01:00
Michael Niedermayer
855ae45c5a avdevice: Use av_format_get_control_message_cb()
This is required as the location of this field could change and is
specified in libavformat not avdevice

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-16 03:01:30 +01:00
wm4
b1959b1719 qpeg: avoid pointless invalid memcpy()
If refdata was NULL, the memcpy() ended up copying the same memory
block onto itself, which is not only pointless, but also undefined
behavior.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-13 23:42:16 +01:00
Michael Niedermayer
ecae610207 avcodec/hevc: Fix handling of skipped_bytes() reallocation failures
Fixes CID1260704

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-13 23:42:14 +01:00
Michael Niedermayer
33a67961c8 avformat/movenc: workaround bug in "PathScale EKOPath(tm) Compiler Suite Version 4.0.12.1"
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7824dc5150)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-10 05:02:23 +01:00
wm4
fc1fed62d9 vp9: fix parser return values in error case
The parser must always set the out_size and out_data pointers. The API
seems to require it, and the common code in parser.c also relies on it.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 15:47:09 +01:00
Michael Niedermayer
0684cd5d8c ffmpeg: Clear error message array at init.
This avoids printing uninitialized bytes if no error message is set

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-08 23:10:52 +01:00
wm4
a4a87a7efd avcodec/dvdsubdec: fix accessing dangling pointers
dvdsub_decode() can call append_to_cached_buf() 2 times, the second time
with ctx->buf as argument. If the second append_to_cached_buf() reallocs
ctx->buf, the argument will be a pointer to the previous, freed block.
This can cause invalid reads at least with some fuzzed files - and
possibly with valid files.

Since packets can apparently not be larger than 64K (even if packets are
combined), just use a fixed size buffer. It will be allocated as part of
the DVDSubContext, and although some memory is "wasted", it's relatively
minimal by modern standards and should be acceptable.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-08 18:04:33 +01:00
wm4
b76dc8b5b8 avcodec/dvdsubdec: error on bitmaps with size 0
Attemtping to decode them could lead to invalid writes with some fuzzed
samples.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-08 02:11:21 +01:00
James Almer
6e2204b152 configure: bump year
Happy new year!
(cherry picked from commit b8db25a333)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 20:40:50 +01:00
Michael Niedermayer
81bdaacb65 avformat/mov: Fix mixed declaration and statement warning
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit db27f50e06)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 20:37:53 +01:00
Michael Niedermayer
3e3193f03c cmdutils: Use 64bit for file size/offset related variable in cmdutils_read_file()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 369b4cd412)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 16:10:43 +01:00
Michael Niedermayer
3b17c1e13e avformat/utils: Clear pointer in ff_alloc_extradata() to avoid leaving a stale pointer in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bbfca8e84b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 16:10:42 +01:00
Michael Niedermayer
8abe459ac6 avformat/matroskadec: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6e70e4aca5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 16:09:30 +01:00
Paul B Mahol
bebe3d35f3 lavfi: check av_strdup() return value
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 145a84717b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 16:08:27 +01:00
Dale Curtis
7c270a5e3b mov: Fix negative size calculation in mov_read_default().
The previous code assumed if an atom was marked with a 64-bit
size extension, it actually had that data available. The new
code verfies there's enough data in the atom for this to be
done.

Failure to verify causes total_size > atom.size which will
result in negative size calculations later on.

Found-by: Paul Mehta <paul@paulmehta.com>
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3ebd76a9c5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 05:49:03 +01:00
Michael Niedermayer
20a03d5c93 avformat/mov: fix integer overflow in mov_read_udta_string()
Found-by: Paul Mehta <paul@paulmehta.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3859868c75)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 05:49:02 +01:00
Dale Curtis
57710c3646 mov: Avoid overflow with mov_metadata_raw()
The code previously added 1 to len without checking its size,
resulting in an overflow which can corrupt value[-1] -- which
may be used to store unaligned ptr information for certain
allocators.

Found-by: Paul Mehta <paul@paulmehta.com>
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 04:20:49 +01:00
wm4
0d481efb7b avcodec/dvdsubdec: fix out of bounds accesses
The code blindly trusted buffer offsets read from the file in the RLE
decoder. Explicitly check the offset. Also error out on other RLE
decoding errors.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-05 05:13:18 +01:00
Michael Niedermayer
92a36a4e78 avfilter/vf_sab: fix filtering tiny images
Fixes out of array reads

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-05 05:12:32 +01:00
Michael Niedermayer
ef33242c2a avformat/flvdec: Increase string array size
Fixes parsing httphostheader of Scarlatti\,\ Pieter-Jan\ Belder\ -\ Sonata\ K113\ in\ A\ major\ -\ Alle.flv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-01 18:37:51 +01:00
Michael Niedermayer
1c983ee2c1 avformat/flvdec: do not inject dts=0 metadata packets which failed to be parsed into a new data stream
Such data streams (which then contain no other packets except the faulty one)
confuse some user applications, like VLC
Works around vlcticket 12389

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

Conflicts:

	libavformat/flvdec.c
2015-01-01 18:37:50 +01:00
Michael Niedermayer
a6d59978a0 avformat/cdxl: Fix integer overflow of image_size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3eb5cbe0c5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-31 22:39:29 +01:00
Michael Niedermayer
e9ddf726aa avformat/segment: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 68fa549230)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-25 13:05:01 +01:00
Michael Niedermayer
c52c9f534e Merge commit 'f249e9889155599ee3ad0172832d38f68b0c625d' into release/2.2
* commit 'f249e9889155599ee3ad0172832d38f68b0c625d':
  smc: fix the bounds check

Conflicts:
	libavcodec/smc.c

See: c727401aa9
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 13:15:36 +01:00
Michael Niedermayer
0d31a01d3a Merge commit '92888e9ed4ea4e761ae953bbe28c85cc658abc8f' into release/2.2
* commit '92888e9ed4ea4e761ae953bbe28c85cc658abc8f':
  gifdec: refactor interleave end handling

Conflicts:
	libavcodec/gifdec.c

See: 8f1457864b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 13:14:48 +01:00
Michael Niedermayer
475d68e0f5 Merge commit '3f10a779b465fd22d3aec1b744ca8544bc2da970' into release/2.2
* commit '3f10a779b465fd22d3aec1b744ca8544bc2da970':
  mmvideo: check frame dimensions

See: 8b0e96e1f2
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 13:01:22 +01:00
Michael Niedermayer
7fd20799d7 Merge commit '8f238dd9bdd9eba569fcaa564a07fbdd89412a14' into release/2.2
* commit '8f238dd9bdd9eba569fcaa564a07fbdd89412a14':
  jvdec: check frame dimensions

See: 105654e376
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 13:00:40 +01:00
Michael Niedermayer
bf00132a14 Merge commit 'da4f5d9d77882bee568266d764b95b51f81b7871' into release/2.2
* commit 'da4f5d9d77882bee568266d764b95b51f81b7871':
  mjpegdec: check for pixel format changes

Conflicts:
	libavcodec/mjpegdec.c

See: 5c378d6a6d
See: a2f680c7bc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 12:59:41 +01:00
Michael Niedermayer
ede5946b70 Merge commit '931f5b235112f1c2a09dead36f0a228061d23942' into release/2.2
* commit '931f5b235112f1c2a09dead36f0a228061d23942':
  mov: avoid a memleak when multiple stss boxes are present

Conflicts:
	libavformat/mov.c

See: 5ab882d728
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 12:36:00 +01:00
Michael Niedermayer
3cd2c33d36 Merge commit 'e7fdd6aa0d11c3e144988d7090f972224799e07f' into release/2.2
* commit 'e7fdd6aa0d11c3e144988d7090f972224799e07f':
  avconv: Use the mpeg12 private option scan_offset

Conflicts:
	ffmpeg_opt.c

See: e479013ae4
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 12:33:51 +01:00
Clément Bœsch
c494be6411 avformat/mov: strengthen some table allocations
(cherry picked from commit 5ab882d728)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 12:32:39 +01:00
Michael Niedermayer
2d855c94b6 avformat/mov: Fix memleaks for duplicate STCO/CO64/STSC atoms
Also see [FFmpeg-devel] [PATCH] avformat/mov: strengthen some table allocations
which contains more fixes but is unfinished

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 12:32:37 +01:00
Michael Niedermayer
f249e98891 smc: fix the bounds check
Fixes invalid writes when there are more blocks in a run than total
remaining blocks.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8548
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit d423dd72be)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 58dc526ebf)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:53:40 +01:00
Michael Niedermayer
92888e9ed4 gifdec: refactor interleave end handling
Fixes invalid writes with very small image heights.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8547
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 0b39ac6f54)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit eac49477aa)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:53:37 +01:00
Anton Khirnov
3f10a779b4 mmvideo: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 2.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8543
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 17ba719d9b)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 69a930b988)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:53:35 +01:00
Anton Khirnov
8f238dd9bd jvdec: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 8.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8542
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 88626e5af8)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 55788572ea)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:53:32 +01:00
Anton Khirnov
da4f5d9d77 mjpegdec: check for pixel format changes
Fixes possible invalid memory access.

Based on code by Michael Niedermayer <michaelni@gmx.at>

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8541
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 809c3023b6)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit aa7a19b417)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:53:28 +01:00
Anton Khirnov
931f5b2351 mov: avoid a memleak when multiple stss boxes are present
CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 64f7575fbd)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 577f1feb3f)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:53:24 +01:00
Clément Bœsch
b807e987f1 avformat/rsd: make tag_buf string larger
av_get_codec_tag_string() uses more that 1 char for unprintable characters.

(cherry picked from commit edbbb11488)
2014-12-19 18:03:00 -03:00
Julien Ramseier
e7fdd6aa0d avconv: Use the mpeg12 private option scan_offset
Introduced in aed7900704

Bug-Id: debian/773055
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit fd665f7f48)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 864c0c50eb)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-14 20:26:37 +01:00
Michael Niedermayer
9f09bfe681 Update for 2.2.11
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:27:19 +01:00
Michael Niedermayer
7390c2629d avcodec/motion_est: use 2x8x8 for interlaced qpel
Fixes out of array read
Fixes Ticket4121

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Stypa
3d9860f68a fix Makefile objects for pulseaudio support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb58c771ad)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
4fde30ba9d avcodec/hevc_ps: Check num_long_term_ref_pics_sps
Fixes out of array access
Fixes: signal_sigsegv_35bd0f0_1182_cov_791726764_STRUCT_B_Samsung_4.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ea38e5a6b7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
a06432b6c3 avcodec/rawdec: Check the return code of avpicture_get_size()
Fixes out of array access
Fixes: asan_heap-oob_22388d0_3435_cov_3297128910_small_roll5_FlashCine1.cine
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1d3a3b9f89)

Conflicts:

	libavcodec/rawdec.c
2014-12-08 19:08:30 +01:00
Michael Niedermayer
d7470271c7 avcodec/pngdec: Check IHDR/IDAT order
Fixes out of array access
Fixes: asan_heap-oob_20a6c26_2690_cov_3434532168_mail.png
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 79ceaf827b)

Conflicts:

	libavcodec/pngdec.c
2014-12-08 19:08:30 +01:00
Michael Niedermayer
d41010b895 avcodec/flacdec: Call ff_flacdsp_init() unconditionally
Fixes out of array access
Fixes: signal_sigsegv_324b135_3398_cov_246853371_short.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e5c01ccdf5)

Conflicts:

	libavcodec/flacdec.c
2014-12-08 19:08:30 +01:00
Michael Niedermayer
a63941eec2 avcodec/utils: Check that the data is complete in avpriv_bprint_to_extradata()
Fixes out of array read
Fixes: asan_heap-oob_4d2250_814_cov_2745172097_JACOsub_capability_tester.jss
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3d5d95db3f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
5d6f8bab02 avcodec/mjpegdec: Fix context fields becoming inconsistent
Fixes out of array access
Fixes: asan_heap-oob_1ca4f85_2760_cov_144449187_miss_congeniality_pegasus_ljpg.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0eecf40935)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
de7671e4c4 swscale/x86/rgb2rgb_template: handle the first 2 lines with C in rgb24toyv12_*()
This avoids out of array accesses
Should fix Ticket3451

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
217f781adc avformat/hlsenc: Free context after hls_append_segment
Fixes reading uninitialized memory

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

Conflicts:

	libavformat/hlsenc.c
(cherry picked from commit 0ac22f043bee2f1c4daf5e1044b014326325d929)

Conflicts:

	libavformat/hlsenc.c
(cherry picked from commit 134d3e1c0331462ea94c78a5e13a63b20d283653)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Lukasz Marek
9440079216 lavu/opt: fix av_opt_get function
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
(cherry picked from commit 173d51c982)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
d054ec868d avcodec/wmaprodec: Fix integer overflow in sfb_offsets initialization
Fixes out of array read
Fixes: asan_heap-oob_2aec5b0_1828_classical_22_16_2_16000_v3c_0_exclusive_0_29.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5dcb99033d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
4d8b82160d avcodec/utvideodec: fix assumtation that slice_height >= 1
Fixes out of array read
Fixes: asan_heap-oob_2573085_3783_utvideo_rgba_median.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7656c4c6e6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
84fdfcab99 avcodec/options_table fix min of audio channels and sample rate
Found-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 206c98f303)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Carl Eugen Hoyos
cd01611d7b lavc/utils: Make pix_fmt desc pointer const.
Fixes an "initialization discards qualifiers from pointer target type" warning.
(cherry picked from commit f05855414e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
8b8d794800 avcodec/h264_slice: Clear table pointers to avoid stale pointers
Might fix Ticket3889

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

Conflicts:

	libavcodec/h264_slice.c
2014-12-08 19:08:30 +01:00
wm4
9a02be3122 avformat/matroskadec: fix handling of recursive SeekHead elements
When matroska_execute_seekhead() is called, it goes through the list of
seekhead entries and attempts to read elements not read yet. When doing
this, the parser can find further SeekHead elements, and will extend the
matroska->seekhead list. This can lead to a (practically) infinite loop
with certain broken files. (Maybe it can happen even with valid files.
The demuxer doesn't seem to check correctly whether an element has
already been read.)

Fix this by ignoring elements that were added to the seekhead field
during executing seekhead entries.

This does not fix the possible situation when multiple SeekHead elements
after the file header (i.e. occur after the "before_pos" file position)
point to the same elements. These elements will probably be parsed
multiple times, likely leading to bugs.

Fixes ticket #4162.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-07 23:04:33 +01:00
Michael Niedermayer
223ae2467e swscale/x86/rgb2rgb_template: fix crash with tiny size and nv12 output
Fixes Ticket4151

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-03 20:39:03 +01:00
Michael Niedermayer
9e65065080 avformat/rmdec: Check codec_data_size
Fixes infinite loop
Fixes Ticket4154

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-03 20:07:56 +01:00
Michael Niedermayer
5111c78eab Merge commit 'd1c2f86b21b96c27fac200209f52c98dcb2b3194' into release/2.2
* commit 'd1c2f86b21b96c27fac200209f52c98dcb2b3194':
  Replace lena.pnm

Conflicts:
	tests/Makefile
	tests/ref/seek/vsynth2-ffv1
	tests/ref/seek/vsynth2-flv
	tests/ref/seek/vsynth2-h261
	tests/ref/seek/vsynth2-h263
	tests/ref/seek/vsynth2-h263p
	tests/ref/seek/vsynth2-ljpeg
	tests/ref/seek/vsynth2-mjpeg
	tests/ref/seek/vsynth2-mpeg1
	tests/ref/seek/vsynth2-mpeg1b
	tests/ref/seek/vsynth2-mpeg2-422
	tests/ref/seek/vsynth2-mpeg2-idct-int
	tests/ref/seek/vsynth2-mpeg2-ilace
	tests/ref/seek/vsynth2-mpeg2-ivlc-qprd
	tests/ref/seek/vsynth2-mpeg2-thread
	tests/ref/seek/vsynth2-mpeg2-thread-ivlc
	tests/ref/seek/vsynth2-mpeg4
	tests/ref/seek/vsynth2-mpeg4-adap
	tests/ref/seek/vsynth2-mpeg4-error
	tests/ref/seek/vsynth2-mpeg4-nr
	tests/ref/seek/vsynth2-mpeg4-qpel
	tests/ref/seek/vsynth2-mpeg4-qprd
	tests/ref/seek/vsynth2-mpeg4-rc
	tests/ref/seek/vsynth2-mpeg4-thread
	tests/ref/seek/vsynth2-msmpeg4
	tests/ref/seek/vsynth2-msmpeg4v2
	tests/ref/seek/vsynth2-rv10
	tests/ref/seek/vsynth2-rv20
	tests/ref/seek/vsynth2-svq1
	tests/ref/seek/vsynth2-wmv1
	tests/ref/seek/vsynth2-wmv2
	tests/ref/vsynth/vsynth2-cljr
	tests/ref/vsynth/vsynth2-dnxhd-1080i
	tests/ref/vsynth/vsynth2-dnxhd-720p
	tests/ref/vsynth/vsynth2-dnxhd-720p-10bit
	tests/ref/vsynth/vsynth2-dnxhd-720p-rd
	tests/ref/vsynth/vsynth2-dv
	tests/ref/vsynth/vsynth2-dv-411
	tests/ref/vsynth/vsynth2-dv-50
	tests/ref/vsynth/vsynth2-ffv1
	tests/ref/vsynth/vsynth2-ffvhuff
	tests/ref/vsynth/vsynth2-flashsv
	tests/ref/vsynth/vsynth2-flv
	tests/ref/vsynth/vsynth2-h261
	tests/ref/vsynth/vsynth2-h263
	tests/ref/vsynth/vsynth2-h263-obmc
	tests/ref/vsynth/vsynth2-h263p
	tests/ref/vsynth/vsynth2-huffyuv
	tests/ref/vsynth/vsynth2-jpegls
	tests/ref/vsynth/vsynth2-ljpeg
	tests/ref/vsynth/vsynth2-mjpeg
	tests/ref/vsynth/vsynth2-mpeg1
	tests/ref/vsynth/vsynth2-mpeg1b
	tests/ref/vsynth/vsynth2-mpeg2
	tests/ref/vsynth/vsynth2-mpeg2-422
	tests/ref/vsynth/vsynth2-mpeg2-ilace
	tests/ref/vsynth/vsynth2-mpeg2-thread
	tests/ref/vsynth/vsynth2-mpeg2-thread-ivlc
	tests/ref/vsynth/vsynth2-mpeg4
	tests/ref/vsynth/vsynth2-mpeg4-adap
	tests/ref/vsynth/vsynth2-mpeg4-error
	tests/ref/vsynth/vsynth2-mpeg4-nr
	tests/ref/vsynth/vsynth2-mpeg4-qpel
	tests/ref/vsynth/vsynth2-mpeg4-qprd
	tests/ref/vsynth/vsynth2-mpeg4-rc
	tests/ref/vsynth/vsynth2-mpeg4-thread
	tests/ref/vsynth/vsynth2-msmpeg4
	tests/ref/vsynth/vsynth2-msmpeg4v2
	tests/ref/vsynth/vsynth2-prores
	tests/ref/vsynth/vsynth2-qtrle
	tests/ref/vsynth/vsynth2-rgb
	tests/ref/vsynth/vsynth2-rv10
	tests/ref/vsynth/vsynth2-rv20
	tests/ref/vsynth/vsynth2-svq1
	tests/ref/vsynth/vsynth2-wmv1
	tests/ref/vsynth/vsynth2-wmv2
	tests/ref/vsynth/vsynth2-yuv

See: c4abee734d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 14:46:51 +01:00
Andreas Cadhalpun
394d3c937a Remove non-free tests/lena.pnm and adapt FATE tests to depend on lena.pnm in the SAMPLES directory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c4abee734d)

Conflicts:

	tests/fate/vcodec.mak

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 14:17:39 +01:00
Michael Niedermayer
afcd152b97 Merge commit '2bcd8f22f2fae253d87b11a5c9f8805d79253180' into release/2.2
* commit '2bcd8f22f2fae253d87b11a5c9f8805d79253180':
  Treat all '*.pnm' files as non-text file

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 14:14:39 +01:00
Michael Niedermayer
dad7beaceb avutil/buffer_internal: leave the buffer pool entries volatile
Theres no reason to remove the volatile keyword in a release branch

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:50:46 +01:00
Michael Niedermayer
93360af0d7 avutil/buffer: use the old atomics based code for the release branch
the old code worked fine for a long time and was not affected by
the bug the new code fixes and the new is not widely tested yet.
This can be reverted once the code received more testing in
master

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:50:29 +01:00
Michael Niedermayer
4ed83378bf Merge commit 'c790e31ae46d4304af893d04806ec9e3bff5ae28' into release/2.2
* commit 'c790e31ae46d4304af893d04806ec9e3bff5ae28':
  lavu: fix memory leaks by using a mutex instead of atomics

Conflicts:
	libavutil/buffer.c

The atomics code is left in place as a fallback for synchronization in the
absence of p/w32 threads. Our ABI did not requires applications to
only use threads (and matching ones) to what libavutil was build with
Our code also was not affected by the leak this change fixes, though
no question the atomics based implementation is not pretty at all.
First and foremost the code must work, being pretty comes after that.

If this causes problems, for example when libavutil is used by multiple
applications each using a different kind of threading system then the
default possibly has to be changed to the uglier atomics.

See: cea3a63ba3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:48:18 +01:00
Dave Yeo
1579f14632 libavutil/threads.h: correct an include to be local
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32eadfe453)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:37:37 +01:00
Dave Yeo
7394e53f30 libavutil/thread.h: Support OS/2 threads
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 090a7801a8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:37:32 +01:00
Michael Niedermayer
9bbed55b10 Merge commit '7fe5d0a78df537542732aa7bd45962f7505255d0' into release/2.2
* commit '7fe5d0a78df537542732aa7bd45962f7505255d0':
  lavu: add wrappers for the pthreads mutex API

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:36:31 +01:00
Michael Niedermayer
9181faab68 Merge commit '871d99ef77336069e5a8ece947c8160d9bc4d5ea' into release/2.2
* commit '871d99ef77336069e5a8ece947c8160d9bc4d5ea':
  mp3enc: fix a triggerable assert

Conflicts:
	libavformat/mp3enc.c

No change, the faulty assert was not in FFmpeg

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:14:06 +01:00
Reinhard Tartler
d1c2f86b21 Replace lena.pnm
The new reference.pnm is a freely licensed replacement. The photo has
been taken by Reinhard Tartler on August 28 2014, and is licensed under
the expat license as stated at http://www.jclark.com/xml/copying.txt

(cherry picked from commit e38231007e19e5f27b0e77e72bcd26fb3d76edfb)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-12-01 17:43:32 -08:00
Reinhard Tartler
2bcd8f22f2 Treat all '*.pnm' files as non-text file
This convinces the pre-receive hook to not consider all *.pnm files as
text files to reduce the patch sizes and avoids triggering whitespace
checks,

Contains a correction by Janne Grunau <janne-libav@jannau.net>

(cherry picked from commit b877814e09b9f25308ec205cf48bb9554b33e95c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-12-01 17:36:05 -08:00
wm4
c790e31ae4 lavu: fix memory leaks by using a mutex instead of atomics
The buffer pool has to atomically add and remove entries from the linked
list of available buffers. This was done by removing the entire list
with a CAS operation, working on it, and then setting it back again
(using a retry-loop in case another thread was doing the same thing).

This could effectively cause memory leaks: while a thread was working on
the buffer list, other threads would allocate new buffers, increasing
the pool's total size. There was no real leak, but since these extra
buffers were not needed, but not free'd either (except when the buffer
pool was destroyed), this had the same effects as a real leak. For some
reason, growth was exponential, and could easily kill the process due
to OOM in real-world uses.

Fix this by using a mutex to protect the list operations. The fancy
way atomics remove the whole list to work on it is not needed anymore,
which also avoids the situation which was causing the leak.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit fbd6c97f9c)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 517ce1d09b)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 13:45:36 +01:00
Anton Khirnov
7fe5d0a78d lavu: add wrappers for the pthreads mutex API
Also add no-op fallbacks when threading is disabled.

This helps keeping the code clean if Libav is compiled for targets
without threading. Since we assume that no threads of any kind are used
in such configurations, doing nothing is ok by definition.

Based on a patch by wm4 <nfxjfg@googlemail.com>.

(cherry picked from commit 2443e522f0)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 46a17d886b)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 13:45:28 +01:00
Michael Niedermayer
bf219a564c avformat/avidec: fix handling dv in avi
Fixes Ticket4086

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f0ae0354d3)
2014-11-21 10:01:31 +01:00
Anton Khirnov
871d99ef77 mp3enc: fix a triggerable assert
We have to check against the number of bytes actually needed, not the
theoretical maximum size.

(cherry picked from commit 12700b0219)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-15 08:46:48 +01:00
Michael Niedermayer
418e9a6113 Revert "v4l2: setting device parameters early"
This reverts commit b1ad931233.

Fixes Ticket #3517

Requested-by: Giorgio Vazzana <mywing81@gmail.com>
Merged-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6f21fb7932)

Conflicts:
	libavdevice/v4l2.c
2014-11-08 14:27:14 +01:00
Michael Niedermayer
e25e0903ab avcodec/mpegaudio_parser: fix off by 1 error in bitrate calculation
Fixes Ticket3918

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 817663897e)
2014-11-06 01:10:12 +01:00
Michael Niedermayer
969aee07e6 avcodec/h264_parser: rewrite the parse_nal_units() loop logic based on h264.c
Fixes Ticket4011

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

Conflicts:

	libavcodec/h264_parser.c
2014-11-01 18:27:12 +01:00
Michael Niedermayer
76587eea64 avcodec/h264: simplify find_start_code()
this also uses avpriv_find_start_code(), though no speed change is expected as
the area searched is generally small

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

Conflicts:

	libavcodec/h264.h
2014-11-01 18:26:22 +01:00
Michael Niedermayer
667fe8c75b Move get_avc_nalsize() and find_start_code() to h264.h
This allows sharing them with the h264 parser

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

Conflicts:

	libavcodec/h264.c
	libavcodec/h264.h
2014-11-01 18:25:47 +01:00
Michael Niedermayer
64624c5678 avformat/matroskadec: do not trust the default duration to be the real 1/timebase if its less than 5fps
Fixes Ticket3980

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be695ee389)
2014-11-01 16:12:52 +01:00
Michael Niedermayer
114e4b970e avformat/mp3dec: Improve seeking frame sync code
Fixes Ticket3884

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1b5ccae0f2)
2014-11-01 16:12:52 +01:00
Michael Niedermayer
c9659dfd29 avformat/mpeg: increase score for short mpeg-ps by 1
Fixes Ticket 3855

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

Conflicts:
	libavformat/mpeg.c
2014-11-01 16:12:52 +01:00
Michael Niedermayer
41ee9a4495 update for 2.2.10
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 16:01:28 +01:00
Michael Niedermayer
e812a089f5 avcodec/svq3: Dont memcpy AVFrame
This avoids out of array accesses

Fixes: asan_heap-uaf_21f42e4_9_asan_heap-uaf_21f42e4_278_gl2.mov

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:51:16 +01:00
Michael Niedermayer
9b8b35910f avcodec/svq1dec: zero terminate embedded message before printing
Fixes out of array access
Fixes: asan_stack-oob_49b1e5_10_009.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e91ba2efa9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
f00ec3307b avcodec/cook: check that the subpacket sizes fit in block_align
Fixes out of array read
Fixes: asan_heap-oob_fb5c50_19_018.rmvb
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 10e32618ac)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
f6499563c3 avcodec/g2meet: check tile dimensions to avoid integer overflow
Fixes out of array access
Fixes: asan_heap-oob_12a55d3_30_029.wmv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32e666c354)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
16a4aef345 avcodec/utils: Align dimensions by at least their chroma sub-sampling factors.
Fixes: out of array accesses
Fixes: asan_heap-oob_112c6b3_13_012.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit df74811cd5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
6352153811 avcodec/dnxhddec: treat pix_fmt like width/height
Fixes out of array accesses
Fixes: asan_heap-oob_22c9a39_16_015.mxf
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f3c0e0bf6f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
557e8bd589 avcodec/dxa: check dimensions
Fixes out of array access
Fixes: asan_heap-oob_11222fb_21_020.dxa
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e70312dfc2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
45361d8aa3 avcodec/dirac_arith: fix integer overflow
Fixes: asan_heap-oob_1078676_9_008.drc
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 39680cacee)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
81e1b5f5fe avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y
Fixes very long but finite loop
Fixes: asan_heap-oob_107866c_42_041.drc
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5145d22b88)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
6505eb45bc avcodec/diracdec: Use 64bit in calculation of codeblock coordinates
Fixes integer overflow
Fixes out of array read
Fixes: asan_heap-oob_107866c_42_041.drc
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 526886e606)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
17f0581e0d postproc: fix qp count
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0b7e5d0d75)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
13b7962aae postproc/postprocess: fix quant store for fq mode
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 941aaa39e8)

Conflicts:

	tests/ref/fate/filter-pp3
2014-11-01 15:40:38 +01:00
Christophe Gisquet
aa40f11b81 utvideoenc: properly set slice height/last line
Mimic decoder and obey sampling.

Does not affect fate tests for utvideo.
Fixes ticket #3949.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
3bb4c3e74d Merge commit '72ed4166a64714952777fb028b546a52e5b4e2c2' into release/2.2
* commit '72ed4166a64714952777fb028b546a52e5b4e2c2':
  resample: Avoid off-by-1 errors in PTS calcs.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:26:51 +01:00
Michael Niedermayer
7ac50d846c Merge commit '787a6156a2d887bb1d65c1233a94a61741e7af7c' into release/2.2
* commit '787a6156a2d887bb1d65c1233a94a61741e7af7c':
  imc: fix order of operations in coefficients read

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:26:20 +01:00
Michael Niedermayer
0f4c03cd63 Merge commit '0989a120f1dec400c54fcb54670cb84bba36d99b' into release/2.2
* commit '0989a120f1dec400c54fcb54670cb84bba36d99b':
  mpeg12: Always invoke the get_format() callback

Conflicts:
	libavcodec/mpeg12dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:25:42 +01:00
Michael Niedermayer
2d1d053c5d Merge commit 'c7caed88a03567e8777a606f4bd42f093c6b302c' into release/2.2
* commit 'c7caed88a03567e8777a606f4bd42f093c6b302c':
  h264: Always invoke the get_format() callback

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:08:51 +01:00
Timothy B. Terriberry
72ed4166a6 resample: Avoid off-by-1 errors in PTS calcs.
The rounding used in the PTS calculations in filter_frame() does
not actually match the number of samples output by the resampler.
This leads to off-by-1 errors in the timestamps indicating gaps and
underruns, even when the input timestamps are all contiguous.

Bug-Id: 753

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 6cbbf0592f)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit ca8c62d187)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-18 05:15:48 +02:00
Vittorio Giovara
787a6156a2 imc: fix order of operations in coefficients read
Reported-by: Ruoyu <liangry@ucweb.com>
2014-10-15 14:54:20 +01:00
Michael Niedermayer
b05d355040 Update for 2.2.9
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-06 03:47:59 +02:00
James Almer
f253fa9552 x86/synth_filter: add missing HAVE_YASM guard
Should fix compilation failures with --disable-yasm on some compilers

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

Conflicts:

	libavcodec/x86/dcadsp_init.c
2014-10-06 01:50:01 +02:00
Michael Niedermayer
a28c276b8d swresample/swresample: fix sample drop loop end condition
Fixes Ticket3985

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-06 01:31:18 +02:00
Michael Niedermayer
26da47a09b avcodec/h264: Check mode before considering mixed mode intra prediction
Fixes out of array read
Fixes: asan_heap-oob_e476fc_2_asan_heap-oob_1333ec6_61_CAMACI3_Sony_C.jsv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:22:09 +02:00
Michael Niedermayer
23fdcd3b0a avformat/mpegts: Check desc_len / get8() return code
Fixes out of array read
Fixes: signal_sigsegv_844d59_10_signal_sigsegv_a17bb7_366_mpegts_mpeg2video_mp2_dvbsub_topfield.rec

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:22:08 +02:00
Michael Niedermayer
653329dfcb avcodec/vorbisdec: Fix off by 1 error in ptns_to_read
Fixes read of uninitialized memory
Fixes: asan_heap-uaf_18dac2b_9_asan_heap-uaf_22eb375_208_beta3_test_small.ogg

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:22:08 +02:00
Michael Niedermayer
b0964918d8 avcodec/smc: fix off by 1 error
Fixes out of array access
Fixes: asan_heap-oob_1685bf0_5_asan_heap-oob_1f35116_430_smc.mov

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
d8fda618d0 avcodec/qpeg: fix off by 1 error in MV bounds check
Fixes out of array access
Fixes: asan_heap-oob_153760f_4_asan_heap-oob_1d7a4cf_164_VWbig6.avi

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
43881c7732 avcodec/gifdec: factorize interleave end handling out
also change it to a loop
Fixes out of array access
Fixes: asan_heap-oob_ca5410_8_asan_heap-oob_ca5410_97_ID_LSD_Size_Less_Then_Data_Inter_3.gif

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
42bdcebf33 avcodec/cinepak: fix integer underflow
Fixes out of array access
Fixes: asan_heap-oob_4da0ba_6_asan_heap-oob_4da0ba_241_cvid_crash.avi

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
d1e71ecbb0 avcodec/pngdec: Calculate MPNG bytewidth more defensively
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e830902934)

Conflicts:

	libavcodec/pngdec.c
2014-10-05 14:20:32 +02:00
Michael Niedermayer
64be1a45eb avcodec/pngdec: Check bits per pixel before setting monoblack pixel format
Fixes out of array accesses
Fixes: asan_heap-oob_14dbfcf_4_asan_heap-oob_1ce5767_179_add_method_small.png

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
f8bd98ae4d avcodec/tiff: more completely check bpp/bppcount
Fixes pixel format selection
Fixes out of array accesses
Fixes: asan_heap-oob_1766029_6_asan_heap-oob_20aa045_332_cov_1823216757_m2-d1d366d7965db766c19a66c7a2ccbb6b.tif

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
f2c6e2c3b4 avcodec/mmvideo: Bounds check 2nd line of HHV Intra blocks
Fixes out of array access
Fixes: asan_heap-oob_4da4f3_8_asan_heap-oob_4da4f3_419_scene1a.mm

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
8acfae6901 avcodec/h263dec: Fix decoding messenger.h263
Fixes http://samples.mplayerhq.hu/V-codecs/h263/h263-raw/messenger.h263
Fixes regression since b239f3f6

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

Conflicts:

	libavcodec/h263dec.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
e5ccd894d1 avcodec/utils: Add case for jv to avcodec_align_dimensions2()
Fixes out of array accesses
Fixes: asan_heap-oob_12304aa_8_asan_heap-oob_4da4f3_300_intro.jv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
6287107eae avcodec/mjpegdec: check bits per pixel for changes similar to dimensions
Fixes out of array accesses
Fixes: asan_heap-oob_16668e9_2_asan_heap-oob_16668e9_346_miss_congeniality_pegasus_mjpg.avi

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
53330b30fd avcodec/jpeglsdec: Check run value more completely in ls_decode_line()
previously it could have been by 1 too large
Fixes out of array access
Fixes: asan_heap-oob_12240f5_1_asan_heap-oob_12240f5_448_t8c1e3.jls
Fixes: asan_heap-oob_12240f5_1_asan_heap-oob_12240f5_448_t8nde0.jls
Fixes: asan_heap-oob_12240fa_1_asan_heap-oob_12240fa_448_t16e3.jls

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Reimar Döffinger
9726c1a5f8 configure: add noexecstack to linker options if supported.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit b7082d953f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
f1dd343007 avcodec/ac3enc_template: fix out of array read
Found-by: Andreas Cadhalpun
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d85ebea3f3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
lvqcl
be894938c4 avutil/x86/cpu: fix cpuid sub-leaf selection
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e58fc44649)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Philip DeCamp
fe0fd3de22 libavutil/opt: fix av_opt_set_channel_layout() to access correct memory address
Signed-off-by: Philip DeCamp <decamp@mit.edu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 857fc0a71f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Benoit Fouet
fe12b3a7a6 avformat/riffenc: Filter out "BottomUp" in ff_put_bmp_header()
Fixes Ticket1304

Commit message and extradata size bugfix by commiter
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6843b9dc78)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Pascal Massimino
a1605af9b5 avcodec/webp: fix default palette color 0xff000000 -> 0x00000000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e5b3112996)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Gianluigi Tiesi
b0937dd61d avcodec/libilbc: support for latest git of libilbc
in the latest git commits of libilbc developers removed WebRtc_xxx typedefs

This commit uses int types instead,
it's safe to apply also for previous versions since
WebRtc_Word16 was always a typedef of int16_t and
WebRtc_UWord16 a typedef of uint16_t

Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 59af5383c1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:31 +02:00
Michael Niedermayer
ac0dea5dd7 Merge commit 'f13f5a7d4b6c57a11c63ba5e4f972f0bff5f306a' into release/2.2
* commit 'f13f5a7d4b6c57a11c63ba5e4f972f0bff5f306a':
  Add some bug references to the changelog

Conflicts:
	Changelog

no changes as this does not match FFmpeg releases

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 13:48:33 +02:00
Rémi Denis-Courmont
0989a120f1 mpeg12: Always invoke the get_format() callback
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-09-27 15:49:06 +02:00
Rémi Denis-Courmont
c7caed88a0 h264: Always invoke the get_format() callback
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-09-27 15:49:06 +02:00
Michael Niedermayer
5df02760dd update for 2.2.8
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-21 01:18:16 +02:00
Michael Niedermayer
014dee89d0 avcodec: fix aac/ac3 parser bitstream buffer size
Buffers containing copies of the AAC and AC3 header bits were not padded
before parsing, violating init_get_bits() buffer padding requirement,
leading to potential buffer read overflows.
This change adds FF_INPUT_BUFFER_PADDING_SIZE bytes to the bit buffer
for parsing the header in each of aac_parser.c and ac3_parser.c.

Based on patch by: Matt Wolenetz <wolenetz@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fccd85b9f3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Christophe Gisquet
da1a8191c5 wavpackenc: proper buffer allocation
The allocation didn't account for headers, that can be easily 79 bytes.
As a result, buffers allocated for a few samples (e.g. 5 in the original
bug) could be undersized.

Fixed ticket #2881.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2ba58bec20)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Christophe Gisquet
dd9b24a488 wavpack: report if there is no bits left
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 11a39bdf53)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
James Almer
16b5df17ea x86/dsputil: add emms to ff_scalarproduct_int16_mmxext()
Also undo the changes to ra144enc.c from previous commits.
Should fix ticket #3429

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

Conflicts:

	libavcodec/ra144enc.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Pascal Massimino
99af97ea11 libavcodec/webp: treat out-of-bound palette index as translucent black
See https://code.google.com/p/webp/issues/detail?id=206
for a description of the problem/fix.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

This patch makes the decoder follow the recommendation of the spec.
There is some disagreement (see "[FFmpeg-devel] [PATCH]: libavcodec/webp")
about what would be best to be written in the spec, so in case the spec
is changed again, this potentially would need to be amended or reverted
(cherry picked from commit 4fd21d58a7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
6c66ea5e73 avcodec/x86/vp9lpf: Always include x86util.asm
Fixes executable stack

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
252356cf06 tools/crypto_bench: fix build when AV_READ_TIME is unavailable
Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4a99134f1a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
56fb830c30 avformat/m4vdec: Check for non startcode 00 00 00 sequences in probe
Fixes miss detection of PCM as m4v
Fixes Ticket 3928

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
d19b55649c avcodec/mpegvideo: Set err on failure in ff_mpv_common_frame_size_change()
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cfce6f7efd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
fd6230e8f0 avcodec/mpegvideo: check that the context is initialized in ff_mpv_common_frame_size_change()
The function otherwise would initialize the context without setting context_initialized
alternatively we could set context_initialized

Fixes valgrind anomalies related to ticket 3928

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
9406d3c910 avcodec/mpegvideo: Use "goto fail" for all error paths in ff_mpv_common_frame_size_change()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2762323c37)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
9e1ce9a8ee avcodec/h264: Allow partial escaping
Fixes Ticket3923

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
b4d2888ce8 avformat/swfdec: Do not change the pixel format
This is currently not supported
Fixes part of Ticket 3539

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
b3f30cb6d6 avformat/swfdec: Use side data to communicate w/h changes to the decoder
Fixes reading from freed data
Fixes part of Ticket3539

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1c55d0ff32)

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:32 +02:00
Mika Raento
0484d7ad7e segment: don't access outside seg->frames array
Fixes wrong number of segments output and undefined memory access.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:32 +02:00
Mark Harris
85b829bff9 doc/filters.texi: fix filter name in examples
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1b3a98f137)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:32 +02:00
wm4
f1685bd31a oggdec: fix invalid free on error
The read_packet callback passes a pointer to a stack-allocated AVPacket.
Attempting to free it with av_free() makes no sense.

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

Conflicts:

	libavformat/oggdec.c
2014-09-20 18:40:32 +02:00
Michael Niedermayer
8d10d6e127 avcodec/snow: check coeffs for validity
Fixes deadlock
Fixes integer overflow
Fixes Ticket 3892

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:32 +02:00
Michael Niedermayer
f93f739eca avcodec/utils: add GBRP16 to avcodec_align_dimensions2()
Fixes Ticket3869

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 17:46:41 +02:00
Michael Niedermayer
1a6218954a avcodec/proresenc_kostya: allocate 1 slice more to avoid triggering the reallocation warning when the used space is actually less than the allocated
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f0e51be8d0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 17:46:41 +02:00
Michael Niedermayer
1f8e0f7e06 avcodec/proresenc_kostya: set initial max_slice_size based on frame_size_upper_bound
If the initial max_slice_size is 0 then reallocation is disabled for the first
slice.

Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 76a8cb9d7b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 17:46:41 +02:00
Michael Niedermayer
6dd718e416 Merge commit 'd14696c99ccac12a052ce10e70859ffc0293ed6a' into release/2.2
* commit 'd14696c99ccac12a052ce10e70859ffc0293ed6a':
  apetag: Fix APE tag size check

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 17:42:05 +02:00
Michael Niedermayer
1aab060996 Merge commit 'd0af7d5745f3e228293633faa9e57994f3308c31' into release/2.2
* commit 'd0af7d5745f3e228293633faa9e57994f3308c31':
  Update Changelog for v10.5
  Prepare for 10.5 release

Conflicts:
	Changelog
	RELEASE

no change as FFmpeg releases dont match this

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:49:12 +02:00
Michael Niedermayer
3bc5aa65bb Merge commit '40c7613ecf2f3f7565309f9780183228605c3684' into release/2.2
* commit '40c7613ecf2f3f7565309f9780183228605c3684':
  doc: Fix syntax and logical errors in avconv stream combination example

Conflicts:
	doc/ffmpeg.texi

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:48:28 +02:00
Michael Niedermayer
da1dfea076 Merge commit '1a7d1793d6d2de4201c2d9fc7056e7c9e202c5fe' into release/2.2
* commit '1a7d1793d6d2de4201c2d9fc7056e7c9e202c5fe':
  license: Mention that vf_interlace is GPL, not LGPL

Conflicts:
	LICENSE

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:46:53 +02:00
Michael Niedermayer
e940d15a98 Merge commit '9fcc632249be3080836a3afce25b3092939743ac' into release/2.2
* commit '9fcc632249be3080836a3afce25b3092939743ac':
  pulse: Add a wallclock option to be compatible with other other captures

Conflicts:
	libavdevice/pulse_audio_dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:40:54 +02:00
Michael Niedermayer
481118615c ffmpeg_opt: reduce diff to libav in opt_target() by 16 lines
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7a67ab5cba)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:29:47 +02:00
Michael Niedermayer
4b6e46c427 Merge commit 'f7395926f204051af9ad459a6d876b96ee6179ee' into release/2.2
* commit 'f7395926f204051af9ad459a6d876b96ee6179ee':
  avconv: fix parsing the AVOptions for -target

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:29:23 +02:00
Michael Niedermayer
516ba41f05 Merge commit '7bc37641e3e6c24d472ae06fcbecaba4c863829b' into release/2.2
* commit '7bc37641e3e6c24d472ae06fcbecaba4c863829b':
  avconv: fix the muxrate values for -target

Conflicts:
	ffmpeg_opt.c

No change, as ffmpegs muxrate is in bits/sec

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:28:57 +02:00
Michael Niedermayer
1a642b7217 Merge commit '3ac0638d573fc483ba6be3444858b26711c5d67d' into release/2.2
* commit '3ac0638d573fc483ba6be3444858b26711c5d67d':
  mpegenc: limit the maximum muxrate

Conflicts:
	libavformat/mpegenc.c

See: 28d35dbe9f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:27:55 +02:00
Michael Niedermayer
58b5b062b8 Merge commit '051ac5c0f51c119b33a57f3e137d7344eb1c2b26' into release/2.2
* commit '051ac5c0f51c119b33a57f3e137d7344eb1c2b26':
  mpegvideo: Use the current_picture pts

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:26:15 +02:00
Diego Biurrun
f13f5a7d4b Add some bug references to the changelog 2014-09-17 07:18:39 -07:00
Katerina Barone-Adesi
d14696c99c apetag: Fix APE tag size check
The size variable is (correctly) unsigned, but is passed to several functions
which take signed parameters, such as avio_read, sometimes after having
numbers added to it. So ensure that size remains within the bounds that
these functions can handle.

(cherry picked from commit b45ab61b24)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-17 07:18:39 -07:00
Diego Biurrun
d0af7d5745 Update Changelog for v10.5 2014-09-10 13:24:18 -07:00
Diego Biurrun
f2abf8df7a Prepare for 10.5 release 2014-09-10 13:24:13 -07:00
Diego Biurrun
40c7613ecf doc: Fix syntax and logical errors in avconv stream combination example
Bug-Id: 661
CC: libav-stable@libav.org
(cherry picked from commit 775a0b04f0)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-10 12:02:24 -07:00
Diego Biurrun
1a7d1793d6 license: Mention that vf_interlace is GPL, not LGPL
(cherry picked from commit 9e8bbe7d4d)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-28 10:52:55 -07:00
Luca Barbato
9fcc632249 pulse: Add a wallclock option to be compatible with other other captures
alsa and x11grab use av_gettime() to report timestamps.

Have it on by default.

Bug-Id: 647
(cherry picked from commit 424b929b5c)
(cherry picked from commit 404731bd20)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-28 12:09:53 +02:00
Anton Khirnov
f7395926f2 avconv: fix parsing the AVOptions for -target
CC: libav-stable@libav.org
(cherry picked from commit f5245a9c62)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-27 06:31:05 +00:00
Anton Khirnov
7bc37641e3 avconv: fix the muxrate values for -target
The mpegenc private option values are in 50-byte units.

CC: libav-stable@libav.org
(cherry picked from commit 1688eef253)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-27 06:31:02 +00:00
Anton Khirnov
3ac0638d57 mpegenc: limit the maximum muxrate
It is written to the file as a 22-bit value.

CC: libav-stable@libav.org
(cherry picked from commit 75bbaf2493)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavformat/mpegenc.c
2014-08-27 06:30:52 +00:00
Michael Niedermayer
051ac5c0f5 mpegvideo: Use the current_picture pts
The picture slot can be recycled by select_input_picture and
only current_picture is populated with the valid pts.

Unbreak timestamps when in cbr mode.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 1c7b71a5bd)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavcodec/mpegvideo_enc.c
2014-08-26 06:33:07 +00:00
Michael Niedermayer
5ac46a0969 Merge commit '37e2d574ddcedc25e32bd963737b033354543789' into release/2.2
* commit '37e2d574ddcedc25e32bd963737b033354543789':
  setpts: Add missing inttypes.h #include for PRId64

Conflicts:
	libavfilter/setpts.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 03:15:51 +02:00
Michael Niedermayer
8b55f67e3e Merge commit 'f25f5f8c62ec7728ee7f5dcc8f1abd0dc6235735' into release/2.2
* commit 'f25f5f8c62ec7728ee7f5dcc8f1abd0dc6235735':
  proresenc: Properly account for alpha plane

Conflicts:
	libavcodec/proresenc_kostya.c

See: 1578986a0d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 03:04:37 +02:00
Michael Niedermayer
bb1d75e6c5 Merge commit 'a437298de55c6a6a4f06b12335b3891bf4459082' into release/2.2
* commit 'a437298de55c6a6a4f06b12335b3891bf4459082':
  proresenc: Realloc if buffer is too small

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:58:21 +02:00
Michael Niedermayer
459a84ada3 Merge commit 'e912b0777b24133df27836b6c529faa89af588dc' into release/2.2
* commit 'e912b0777b24133df27836b6c529faa89af588dc':
  proresenc: Report buffer overflow

Conflicts:
	libavcodec/proresenc_kostya.c

See: 1ad1723c24
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:48:24 +02:00
Michael Niedermayer
35fe089dd9 Merge commit 'b3f48a5044fd04539337e91d28022207c9d3b9e8' into release/2.2
* commit 'b3f48a5044fd04539337e91d28022207c9d3b9e8':
  proresenc: Remove unneeded parameters from encode_alpha_plane()

Conflicts:
	libavcodec/proresenc_kostya.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:45:00 +02:00
Michael Niedermayer
9e6d8c309f Merge commit 'ee9e966296d74ca3836be5b5adc839cfc73d8c98' into release/2.2
* commit 'ee9e966296d74ca3836be5b5adc839cfc73d8c98':
  Update Changelog for v10.4
  Prepare for 10.4 Release

Conflicts:
	Changelog
	RELEASE

Not merged as these dont apply to FFmpeg

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:43:40 +02:00
Michael Niedermayer
afbaf6b367 Merge commit '7788297a59656ececd84f602292bfeb79f7eedd7' into release/2.2
* commit '7788297a59656ececd84f602292bfeb79f7eedd7':
  mpegts: Do not try to write a PMT larger than SECTION_SIZE

Conflicts:
	libavformat/mpegtsenc.c

See: 842b6c14bc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:32:04 +02:00
Michael Niedermayer
f1da6691a4 Merge commit '23376ae2f0247ff659724b6a5313639db0c991ad' into release/2.2
* commit '23376ae2f0247ff659724b6a5313639db0c991ad':
  mpegts: Define the section length with a constant

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:17:42 +02:00
Michael Niedermayer
5b1a953960 Merge commit '8231764784a405f546e9c427a6de22d3f4de5c35' into release/2.2
* commit '8231764784a405f546e9c427a6de22d3f4de5c35':
  ffv1dec: check that global parameters do not change in version 0/1

Conflicts:
	libavcodec/ffv1dec.c

See: b05cd1ea7e
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:16:10 +02:00
Diego Biurrun
37e2d574dd setpts: Add missing inttypes.h #include for PRId64
Also convert a debug av_log() to av_dlog().

(cherry picked from commit a89dd9a72c6e9c3111d6f34d9b08cd624fe76358)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-20 10:07:09 -07:00
Christophe Gisquet
f25f5f8c62 proresenc: Properly account for alpha plane
The packet buffer allocation considers the alpha channel as DCT-coded,
while it is actually run-coded and thus requires a larger buffer.

CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 41e1354c10)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-18 19:03:37 +02:00
Christophe Gisquet
a437298de5 proresenc: Realloc if buffer is too small
The buffer allocation may be incorrect (e.g. with an alpha plane),
and currently causes the buffer to be set to NULL by init_put_bits,
causing a crash later on.

So, detect that situation, and if detected, reallocate the buffer
and ask for a sample that shows the problem.

CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 45ce880a9b)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-18 19:03:34 +02:00
Christophe Gisquet
e912b0777b proresenc: Report buffer overflow
If the allocated size, despite best efforts, is too small, exit
with the appropriate error.

CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 58b68e4fde)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-18 19:03:30 +02:00
Christophe Gisquet
b3f48a5044 proresenc: Remove unneeded parameters from encode_alpha_plane()
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit b16699f2da)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-18 19:03:22 +02:00
Reinhard Tartler
ee9e966296 Update Changelog for v10.4 2014-08-17 10:23:20 -04:00
Reinhard Tartler
493a92313f Prepare for 10.4 Release 2014-08-17 10:20:00 -04:00
Christophe Gisquet
1578986a0d proresenc_kostya: properly account for alpha
The packet buffer allocation considered as dct-coded, while it is
actually run-coded and thus requires a larger buffer.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-14 15:44:59 +02:00
Luca Barbato
7788297a59 mpegts: Do not try to write a PMT larger than SECTION_SIZE
Prevent out of array writes.

Similar to what Michael Niedermayer did to address the same issue.

Bug-Id: CVE-2014-2263
CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit e8049af132)

Conflicts:
	libavformat/mpegtsenc.c
2014-08-13 13:57:47 -07:00
Luca Barbato
23376ae2f0 mpegts: Define the section length with a constant
The specification says the value is expressed in 10 bits including
the 4-byte CRC.

(cherry picked from commit 89616408e3)
Signed-off-by: Diego Biurrun <diego@biurrun.de>

Conflicts:
	libavformat/mpegtsenc.c
2014-08-13 13:53:20 -07:00
Michael Niedermayer
8231764784 ffv1dec: check that global parameters do not change in version 0/1
Such changes are neither allowed nor supported

Found-by: ami_stuff
Bug-Id: CVE-2013-7020
CC: libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit da7d839a0d)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-12 10:34:09 +00:00
Michael Niedermayer
49fa398858 Changelog: add entry for proresenc 2014-08-12 05:18:21 +02:00
Christophe Gisquet
1ad1723c24 proresenc_kostya: report buffer overflow
If the allocated size, despite best efforts, is too small, exit
with the appropriate error.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 02:40:23 +02:00
Christophe Gisquet
7740b111dd proresenc_kostya: remove unneeded parameters
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bf10f09bcc)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 02:40:19 +02:00
Michael Niedermayer
c0ad5f9333 Update for 2.2.7
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 20:16:12 +02:00
Michael Niedermayer
bb7f236c7f avcodec/snow: fix null pointer dereference in cleanup after allocation failure
Fixes: snowf.avi
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9a162146ca)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 19:07:11 +02:00
Michael Niedermayer
0397d43405 avcodec/iff: check pixfmt for rgb8 / rgbn
Fixes out of array access

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3539d6c63a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 19:07:11 +02:00
Michael Niedermayer
ffc66ac0d6 avutil/cpu: add aarch64 entries to 2nd table
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit efc4fe9d74)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 19:07:11 +02:00
Michael Niedermayer
588e7226ed ffmpeg_opt: Use av_guess_codec() instead of AVOutputFormat->*codec
Fixes part of ticket2236

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:59:43 +02:00
Michael Niedermayer
0dc5868f14 Merge commit '67134ad31f1f3bc1515eae129e4368401f7c3342' into release/2.2
* commit '67134ad31f1f3bc1515eae129e4368401f7c3342':
  h264: fix interpretation of interleaved stereo modes

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:51:29 +02:00
Michael Niedermayer
723512ac71 avcodec/svq1dec: Fix multiple bugs from "svq1: do not modify the input packet"
Add padding, clear size, use the correct pointer.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:50:29 +02:00
Michael Niedermayer
963514ea1a Merge commit 'd513c6a0ee582d22b6e793286774abbde01f6680' into release/2.2
* commit 'd513c6a0ee582d22b6e793286774abbde01f6680':
  svq1: do not modify the input packet

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:50:11 +02:00
Michael Niedermayer
c11b3010c2 Merge commit '18f48e05a22a73a389fb3ab4b3eaf78903bab5ef' into release/2.2
* commit '18f48e05a22a73a389fb3ab4b3eaf78903bab5ef':
  cdgraphics: do not return 0 from the decode function

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:49:37 +02:00
Michael Niedermayer
3301b248b0 Merge commit '5bf5a35fb5d452ea4b30cd7b853d92df6705d250' into release/2.2
* commit '5bf5a35fb5d452ea4b30cd7b853d92df6705d250':
  cdgraphics: switch to bytestream2

Conflicts:
	libavcodec/cdgraphics.c

See: ad002e1a13
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:41:07 +02:00
Michael Niedermayer
7b67ce9ade Merge commit '6598aaea1ad2cf82d40abb191ac26a5e4e5147ba' into release/2.2
* commit '6598aaea1ad2cf82d40abb191ac26a5e4e5147ba':
  jpeg2000: enable 4 component pixel formats

See: f0358dc1d3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:40:20 +02:00
Michael Niedermayer
90a1c5e95c Merge commit 'a5992a274ff5f6c4bec3445cb410da0adce8ef70' into release/2.2
* commit 'a5992a274ff5f6c4bec3445cb410da0adce8ef70':
  stereo3d: add missing include guards

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:38:27 +02:00
Michael Niedermayer
45a529d805 Merge commit 'aa943bd31fada23db5cb9611215656ab9ebe5b94' into release/2.2
* commit 'aa943bd31fada23db5cb9611215656ab9ebe5b94':
  huffyuvdec: check width size for yuv422p

Conflicts:
	libavcodec/huffyuvdec.c

See: 6abb9a901f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:02:36 +02:00
Michael Niedermayer
97cbad3d2c Merge commit 'bea14966e2a37019cb4e38420868c5bb0542d487' into release/2.2
* commit 'bea14966e2a37019cb4e38420868c5bb0542d487':
  mmvideo: check horizontal coordinate too

See: 8d3c99e825
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:01:44 +02:00
Michael Niedermayer
6419569a9d Merge commit '6be5a3c0451e8f199ef1da09961aa76c08c87afd' into release/2.2
* commit '6be5a3c0451e8f199ef1da09961aa76c08c87afd':
  wmalosslessdec: fix mclms_coeffs* array size

See: ec9578d54d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:01:05 +02:00
Felix Abecassis
67134ad31f h264: fix interpretation of interleaved stereo modes
Column and row frame packing arrangements were inverted.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-08-07 11:40:08 +01:00
Anton Khirnov
d513c6a0ee svq1: do not modify the input packet
The input data must remain constant, make a copy instead. This is in
theory a performance hit, but since I failed to find any samples
using this feature, this should not matter in practice.

Also, check the size of the header, avoiding invalid reads on truncated
data.

CC:libav-stable@libav.org
(cherry picked from commit 7b588bb691)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-06 19:05:34 +00:00
Anton Khirnov
18f48e05a2 cdgraphics: do not return 0 from the decode function
0 means no data consumed, so it can trigger an infinite loop in the
caller.

CC:libav-stable@libav.org
(cherry picked from commit c7d9b473e2)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-06 18:41:44 +00:00
Anton Khirnov
5bf5a35fb5 cdgraphics: switch to bytestream2
Fixes possible invalid memory accesses on corrupted data.

CC:libav-stable@libav.org
Bug-ID: CVE-2013-3674
(cherry picked from commit a1599f3f7e)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-06 18:41:42 +00:00
Vittorio Giovara
6598aaea1a jpeg2000: enable 4 component pixel formats
Bug-Id: 721
CC: libav-stable@libav.org
Sample-Id: 31230.mov
2014-08-06 12:44:35 +01:00
Vittorio Giovara
a5992a274f stereo3d: add missing include guards 2014-08-06 12:44:35 +01:00
Michael Niedermayer
1b99667005 Changelog: fix typo
Found-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 22:27:53 +02:00
Michael Niedermayer
1f4d779e87 version.sh: Print versions based on the last git tag for release branches
release branches are detected by checking if "git" is not in RELEASE
This changes "N-64706-g2f71aeb" to "n2.3-8-g2f71aeb"
for git master theres no change

This should improve the readability of lists of versions which come from
more than 1 release branch or master + release. fate.ffmpeg.org is
one possible example

Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ee606fd031)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 22:18:00 +02:00
Michael Niedermayer
f543d32455 remove VERSION file
it overrides what version.sh prints and thus makes its output
from release branches rather useless

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

Conflicts:

	VERSION
2014-08-05 22:16:42 +02:00
Michael Niedermayer
2cbdbc3670 update for 2.2.6
Changelog by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 22:07:12 +02:00
Michael Niedermayer
aa943bd31f huffyuvdec: check width size for yuv422p
Avoid out of array accesses.

CC: libav-stable@libav.org
Bug-Id: CVE-2013-0848
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit a7153444df)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 20:06:53 +00:00
Michael Niedermayer
bea14966e2 mmvideo: check horizontal coordinate too
Fixes out of array accesses.

Bug-Id: CVE-2013-3672
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 70cd3b8e65)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 19:21:40 +00:00
Michael Niedermayer
6be5a3c045 wmalosslessdec: fix mclms_coeffs* array size
Fixes corruption of context

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
Bug-Id: CVE-2014-2098
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 849b9d34c7)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 14:59:29 +00:00
Michael Niedermayer
119131fcbf ffserver: initialize pbuffer in prepare_sdp_description()
also check pbuffer before use

Found-by: CSA
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1d8d21b90a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:45:56 +02:00
Michael Niedermayer
c13e38bac7 avcodec/wavpackenc: Fix log2sample() result value
Found-by: CSA
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e706fe7640)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:45:56 +02:00
Michael Niedermayer
01c4fe7ee7 avformat/tee: flip assigment direction
Found-by: CSA
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2e6fdcb7f3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:45:56 +02:00
Michael Niedermayer
ad13a5c8fa avcodec/dvdsub_parser: print message if packet is smaller than the packet size field
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bcc898dd26)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Michael Niedermayer
ce248bf7ee avcodec/dvdsub_parser: Check buf_size before reading 32bit packet size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 81c1657a59)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Michael Niedermayer
8eaefbe1be avcodec/dvdsub_parser: never return 0 when the input isnt 0
Fixes a infinite loop
Fixes Ticket3804

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Michael Niedermayer
81d8bad786 avcodec/mpeg12dec: fix support for interlaced mpeg2 with missing last slice
Fixes Ticket3809

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Anshul Maheswhwari
0aee436728 v4l2enc: adding AVClass
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fcb11ec291)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Michael Niedermayer
cdaf9fb2a0 libavcodec/h264_parser: Increase parse_history, fix huge resolutions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0782fb6bcb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Benoit Fouet
cf41ff4889 h264_mp4toannexb_bsf: account for consecutive IDR pictures.
If there are consecutive IDR pictures, then SPS/PPS should be prepended
to all of them, not only the first one.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Chris \"Koying\" Browet
6120ad315b avcodec/h264_mp4toannexb_bsf: fix issue when sps/pps are already in the bistream
(cherry picked from commit ad91bf854b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Michael Niedermayer
2105f046f5 avformat/dv: implement fallback in dv_extract_pack()
Fixes Ticket2340
Fixes Ticket2341

Based-on mail from Dave Rice <dave@dericed.com>
Tested-by: Dave Rice <dave@dericed.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 88f038ac97)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
815d3225e3 avcodec/hevc: treat current_sps like sps_list
This simplifies the management of current_sps
Fixes Ticket3458

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
51dd23c448 avcodec/hevc_ps: prevent stale pointer in malloc failure case
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0fc2045d5f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
a4e1532ee7 avcodec/hevc_ps: do not loose all reference to pointers still in use
Fixes leaving a pointer to unreferenced memory
Fixes Ticket 3115

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Nicolas George
f7b147548e ffmpeg_filter: refuse to configure input without a decoder.
The decoder is necessary in order to filter frames.
This makes the error message clearer in this case:
currently, it will usually fail because the pixel or sample
format is not defined and is converted into "(null)"
(non-portable).

Enhance trac ticket #3779.
(cherry picked from commit 91244073fd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
f99b17bd32 avfilter/f_select: avoid double->int in debug output
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6f622e5fcb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
21f6b07a97 avfilter/f_select: Set var_values[VAR_KEY] correctly
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bcbfb95b0e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
c9f1456a41 avfilter/f_select: avoid using doubles for equals checks and casts to enums
This might silence some warnings.

Issue found from: a8d803a320
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 887d8d293f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
77b789b406 Merge commit '07015d9f913d63bdc4495e75f4603c586553796e' into release/2.2
* commit '07015d9f913d63bdc4495e75f4603c586553796e':
  Update Changelog for v10.3

Conflicts:
	Changelog

Not merged as it does not match our release

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:05:48 +02:00
Michael Niedermayer
9ed1aa0465 Merge commit '744b406ff3474e77543bcf86125a2f7bc7deaa18' into release/2.2
* commit '744b406ff3474e77543bcf86125a2f7bc7deaa18':
  huffyuv: Check and propagate function return values

Conflicts:
	libavcodec/huffyuvdec.c

See: f67a0d1152
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:04:01 +02:00
Michael Niedermayer
188ce941ec Merge commit '2273e5ed992661e0c4b37208e792e2253d5a0b5b' into release/2.2
* commit '2273e5ed992661e0c4b37208e792e2253d5a0b5b':
  h264: prevent theoretical infinite loop in SEI parsing

Conflicts:
	libavcodec/h264_sei.c

See: 9decfc17bb
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 03:55:15 +02:00
Michael Niedermayer
7fc9c7c35b Merge commit 'a1f7844a11010d8552c75424d1a831b37a0ae5d9' into release/2.2
* commit 'a1f7844a11010d8552c75424d1a831b37a0ae5d9':
  pgssubdec: Check RLE size before copying

See: c0d68be555
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 03:54:50 +02:00
Reinhard Tartler
07015d9f91 Update Changelog for v10.3 2014-08-03 21:30:46 -04:00
Diego Biurrun
744b406ff3 huffyuv: Check and propagate function return values
Bug-Id: CVE-2013-0868

inspired by a patch from Michael Niedermayer <michaelni@gmx.at>
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Diego Biurrun <diego@biurrun.de>

CC: libav-stable@libav.org
(cherry picked from commit d0393d79bc)
Signed-off-by: Diego Biurrun <diego@biurrun.de>

Conflicts:
	libavcodec/huffyuvdec.c
2014-08-03 15:53:38 -07:00
Vittorio Giovara
2273e5ed99 h264: prevent theoretical infinite loop in SEI parsing
Properly address CVE-2011-3946 and parse bitstream as described in the spec.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-08-01 13:15:07 +01:00
Michael Niedermayer
a1f7844a11 pgssubdec: Check RLE size before copying
Make sure the buffer size does not exceed the expected
RLE size.

Prevent an out of array bound write.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Bug-Id: CVE-2013-0852

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit d98e6c5d5d)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-01 01:04:13 -07:00
Michael Niedermayer
3ef8b4322c Merge commit 'd396987c303bdc4eea7d1a1ff6776475d9bbd9ea' into release/2.2
* commit 'd396987c303bdc4eea7d1a1ff6776475d9bbd9ea':
  fate: Add dependencies for dct/fft/mdct/rdft tests

Conflicts:
	libavcodec/fft-test.c
	tests/fate/fft.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:35:23 +02:00
Michael Niedermayer
9dc112e277 Merge commit 'b20a8ad619ac0e2631391b6311cc000de85d22bf' into release/2.2
* commit 'b20a8ad619ac0e2631391b6311cc000de85d22bf':
  video4linux2: Avoid a floating point exception

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:34:13 +02:00
Michael Niedermayer
75ff0e8c50 Merge commit '01a550bda29eb05fb230576e5223034974aa3396' into release/2.2
* commit '01a550bda29eb05fb230576e5223034974aa3396':
  vf_select: Drop a debug av_log with an unchecked double to enum conversion

Conflicts:
	libavfilter/f_select.c

See: 7994c1cd76
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:33:48 +02:00
Michael Niedermayer
f02221d651 Merge commit 'f6b3dce952d66f87883a50d90d6e98416ee397df' into release/2.2
* commit 'f6b3dce952d66f87883a50d90d6e98416ee397df':
  librtmp: Don't free the temp url at the end of rtmp_open

Conflicts:
	libavformat/librtmp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:32:53 +02:00
Michael Niedermayer
92c4973752 Merge commit 'b8e57113ecba5494d4bf47c29634392ea5fdb17b' into release/2.2
* commit 'b8e57113ecba5494d4bf47c29634392ea5fdb17b':
  arm: Avoid using the 'setend' instruction on ARMv7 and newer

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:18:14 +02:00
Michael Niedermayer
f4e0869560 Merge commit '407912d17870a53e8a8cc072f192cadf358bc155' into release/2.2
* commit '407912d17870a53e8a8cc072f192cadf358bc155':
  avplay: Handle pixel aspect ratio properly

See: 32fdfdfbda
See: 99b01e458c
See: 825ec16da9
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:14:33 +02:00
Michael Niedermayer
6135baa85b Merge commit '12bbd819cbdfdd2b41286c5ccabee7f5e5b6612a' into release/2.2
* commit '12bbd819cbdfdd2b41286c5ccabee7f5e5b6612a':
  Prepare for 10.3 Release

Conflicts:
	RELEASE

Not merged, as FFmpeg has different version numbers

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:13:20 +02:00
Michael Niedermayer
3573256037 Merge commit 'f9204ec56a4cf73843d1e5b8563d3584c2c05b47' into release/2.2
* commit 'f9204ec56a4cf73843d1e5b8563d3584c2c05b47':
  eamad: use the bytestream2 API instead of AV_RL

Conflicts:
	libavcodec/eamad.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 19:59:38 +02:00
Diego Biurrun
d396987c30 fate: Add dependencies for dct/fft/mdct/rdft tests
(cherry picked from commit 24f45c1622)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-07-30 10:12:17 -07:00
Bernhard Übelacker
b20a8ad619 video4linux2: Avoid a floating point exception
This avoids a segfault in avconv_opt.c:opt_target when trying to
determine the norm.

(cherry picked from commit dc71f19588)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-07-30 10:12:17 -07:00
Diego Biurrun
01a550bda2 vf_select: Drop a debug av_log with an unchecked double to enum conversion
CC: libav-stable@libav.org
(cherry picked from commit a8d803a320)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-07-30 10:12:17 -07:00
Martin Storsjö
f6b3dce952 librtmp: Don't free the temp url at the end of rtmp_open
librtmp can keep pointers to this string internally, and may
use them at shutdown as well.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 865461099e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavformat/librtmp.c
2014-07-27 10:14:33 -04:00
Martin Storsjö
b8e57113ec arm: Avoid using the 'setend' instruction on ARMv7 and newer
This instruction is deprecated on ARMv8, and it is serializing on
some ARMv7 cores as well [1].

[1] http://article.gmane.org/gmane.linux.ports.arm.kernel/339293

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 79fce1ec8a)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-07-27 10:14:33 -04:00
Martin Storsjö
407912d178 avplay: Handle pixel aspect ratio properly
This was broken (left half-implemented) in 354468fc12.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit cf280ed004)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-07-27 10:14:33 -04:00
Reinhard Tartler
12bbd819cb Prepare for 10.3 Release 2014-07-27 10:14:33 -04:00
Anton Khirnov
f9204ec56a eamad: use the bytestream2 API instead of AV_RL
This is safer and possibly fixes invalid reads on truncated data.
(cherry-picked from commit 541427ab4d)

CC:libav-stable@libav.org

Conflicts:
	libavcodec/eamad.c
2014-07-27 09:59:01 -04:00
Alessandro Ghedini
4ddac7199b vc1: Do not return an error when skipping b frames
This caused mpv (and possibly others) to fallback to software decoding after
seeking a VC1 stream.

Bug-Id: 667

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit cdf6eb5a97)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-23 10:42:35 +02:00
Michael Niedermayer
3e78f86891 Merge commit '68fd80ee1ca22c39b6ef4e6641b5b2e0d4d89a14' into release/2.2
* commit '68fd80ee1ca22c39b6ef4e6641b5b2e0d4d89a14':
  g2meet: allow size changes within original sizes

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-23 10:42:11 +02:00
Vittorio Giovara
68fd80ee1c g2meet: allow size changes within original sizes 2014-07-15 20:10:21 -04:00
James Almer
0edc799626 x86/scale: fix xmm register count for hscale*_sse2
xmm6 was being clobbered in ff_hscale8to{15,19}_8_sse2 on Win64

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-15 02:14:55 +02:00
Michael Niedermayer
3cf6135729 Update for FFmpeg 2.2.5
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-15 02:01:06 +02:00
Michael Niedermayer
160e91de89 ffmpeg: Use av_stream_get_parser() to avoid ABI issues
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8bbadc9b6e)

Conflicts:

	ffmpeg.c
2014-07-14 23:26:06 +02:00
Michael Niedermayer
9f8e3e6d12 avformat: add av_stream_get_parser() to access avformat AVParser
The AVStream.parser field is considered private and its location cannot be
preserved while preserving also ABI compatibility to libav, as libav added fields
before it.
Some tools like ffmpeg.c access this field though

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

Conflicts:

	RELEASE_NOTES
	doc/APIchanges
	libavformat/utils.c
	libavformat/version.h
2014-07-14 23:26:06 +02:00
Michael Niedermayer
9752ab6b9e avformat/utils: do not wait for packets from discarded streams for genpts
Fixes long loop
Fixes Ticket3208

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 23:26:06 +02:00
Michael Niedermayer
64e069efac avfilter/f_ebur128: Use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a97137e948)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 23:04:44 +02:00
Michael Niedermayer
e064cce972 avcodec/hevc: Use av_malloc(z)_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7faa7d3d42)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 23:04:44 +02:00
Michael Niedermayer
b8102ce56d cmdutils_opencl: Use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 80da227c66)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 23:04:44 +02:00
Michael Niedermayer
f38c42b913 avfilter/x86/vf_pullup: fix old typo
This makes C and MMX match, no change to fate as the differences where
apparently not sufficient to show up in fate

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 23:04:44 +02:00
Michael Niedermayer
a770a61e6d avfilter/vf_pullup: use ptrdiff_t as stride argument for dsp functions
This should avoid issues on x86_64

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 23:04:43 +02:00
Michael Niedermayer
b2111ad4df Merge commit '95e91aaf335dd9c26a9101c38d4926e5271e7e00' into release/2.2
* commit '95e91aaf335dd9c26a9101c38d4926e5271e7e00':
  af_compand: make sure request_frame always outputs at least one frame

See: 6b68e2a43b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:58:44 +02:00
Michael Niedermayer
7c81afdba5 Merge commit '40dd29653ab85812d21fa64e9a665ceb316701ad' into release/2.2
* commit '40dd29653ab85812d21fa64e9a665ceb316701ad':
  Prepare for 10.2 Release
  Update Changelog for v10.2

Conflicts:
	Changelog
	RELEASE

Not merged as these dont align with our releases

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:57:48 +02:00
Michael Niedermayer
65b839e43a Merge commit '564c023eba807b162527b17af40424de275fc795' into release/2.2
* commit '564c023eba807b162527b17af40424de275fc795':
  adpcm: Write the proper predictor in trellis mode in IMA QT

See: fa8f060b75
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:48:29 +02:00
Michael Niedermayer
d47e96090c Merge commit '771564945aa9aebe2f30192b925fcf4909225eca' into release/2.2
* commit '771564945aa9aebe2f30192b925fcf4909225eca':
  adpcm: Avoid reading out of bounds in the IMA QT trellis encoder

See: a32765c425
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:46:48 +02:00
Michael Niedermayer
0bbd46c690 Merge commit '16f7cbef5610a878317596134607d2a89da66ecf' into release/2.2
* commit '16f7cbef5610a878317596134607d2a89da66ecf':
  oggenc: Set the right AVOption size for the pref_duration option

See: 536baf6cc5
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:40:29 +02:00
Michael Niedermayer
5f1f1868b5 Merge commit '4ec1acc6e4f4d0bd28617bbb30ebfb779ce7df92' into release/2.2
* commit '4ec1acc6e4f4d0bd28617bbb30ebfb779ce7df92':
  avpacket: fix copying side data in av_packet_copy_props()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:39:25 +02:00
Michael Niedermayer
ebf381168a Merge commit '74f6df745a05d3d8b3dcfc28992c69a70ae87957' into release/2.2
* commit '74f6df745a05d3d8b3dcfc28992c69a70ae87957':
  jpeg2000: fix dereferencing invalid pointers during cleanup

Conflicts:
	libavcodec/jpeg2000.c

See: 09927f3eaa
See: 912ce9dd20
See: 9e477a3770
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:38:22 +02:00
Michael Niedermayer
0d90143972 Merge commit '46c477c2a14b04a63ab11d31003b48fab6146a96' into release/2.2
* commit '46c477c2a14b04a63ab11d31003b48fab6146a96':
  Check mp3 header before calling avpriv_mpegaudio_decode_header().

Conflicts:
	libavformat/mp3enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:26:06 +02:00
Michael Niedermayer
00049f193d Merge commit 'fcbcc561e0fdc95a7dd48b92db53846726aec27e' into release/2.2
* commit 'fcbcc561e0fdc95a7dd48b92db53846726aec27e':
  Check if an mp3 header is using a reserved sample rate.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:25:23 +02:00
Michael Niedermayer
d832020bd8 Merge commit '6d899d0206e91a3a74680b47ec06ef1dbc151c21' into release/2.2
* commit '6d899d0206e91a3a74680b47ec06ef1dbc151c21':
  lzo: Handle integer overflow

Conflicts:
	libavutil/lzo.c

This is basically not merging changes due to this being fixed differently
in FFmpeg

See: d6af26c55c
See: cf2b7c01f8

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:24:36 +02:00
Andrew Kelley
95e91aaf33 af_compand: make sure request_frame always outputs at least one frame
This fixes a segmentation fault because request_frame in fifo.c assumes
that the call to ff_request_frame will populate fifo->root.next.
Before, it was possible for request_frame in af_compand to not do this,
resulting in a null pointer access. Now, request_frame in af_compand
always will return at least one frame or an error, as per the API
specifications in avfilter.h for request_frame.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit d3cfd7aff8)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-07-08 17:40:07 +00:00
Reinhard Tartler
40dd29653a Prepare for 10.2 Release 2014-06-26 21:14:55 -04:00
Reinhard Tartler
52dd1a933e Update Changelog for v10.2 2014-06-26 21:11:20 -04:00
Martin Storsjö
564c023eba adpcm: Write the proper predictor in trellis mode in IMA QT
The actual predictor value, set by the trellis code, never
was written back into the variable that was written into
the block header. This was accidentally removed in b304244b.

This significantly improves the audio quality of the trellis
case, which was plain broken since b304244b.

Encoding IMA QT with trellis still actually gives a slightly
worse quality than without trellis, since the trellis encoder
doesn't use the exact same way of rounding as in
adpcm_ima_qt_compress_sample and adpcm_ima_qt_expand_nibble.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 0776e0ef6b)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:59:00 +02:00
Martin Storsjö
771564945a adpcm: Avoid reading out of bounds in the IMA QT trellis encoder
This was broken in 095be4fb - samples+ch (for the previous
non-planar case) equals &samples_p[ch][0]. The confusion
probably stemmed from the IMA WAV case where it originally
was &samples[avctx->channels + ch], which was correctly
changed into &samples_p[ch][1].

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 3d79d0c93e)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:58:46 +02:00
Martin Storsjö
16f7cbef56 oggenc: Set the right AVOption size for the pref_duration option
On big endian machines, the default value set via the faulty
AVOption ended up as 2^32 times too big.

This fixes the fate-lavf-ogg test which currently is broken on
big endian machines, broken since 3831362. Since that commit,
a final zero-sized packet is written to the ogg muxer in that test,
which caused different flushing behaviour on little and big endian
depending on whether the pref_duration option was handled as it
should or not.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 103243ca64)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:58:28 +02:00
Anton Khirnov
4ec1acc6e4 avpacket: fix copying side data in av_packet_copy_props()
Side data count is incremented by by calling av_packet_new_side_data()
in the following loop, setting it explicitly results in the resulting
value being twice what it should be.

CC: libav-stable@libav.org
(cherry picked from commit cdf58f0599)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:58:16 +02:00
Vittorio Giovara
74f6df745a jpeg2000: fix dereferencing invalid pointers during cleanup
CC: libav-stable@libav.org
Found-by: Laurent Butti <laurentb@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-06-26 12:37:36 +02:00
Justin Ruggles
46c477c2a1 Check mp3 header before calling avpriv_mpegaudio_decode_header().
As indicated in the function documentation, the header MUST be
checked prior to calling it because no consistency check is done
there.

CC:libav-stable@libav.org
(cherry picked from commit f2f2e7627f)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:37:16 +02:00
Justin Ruggles
fcbcc561e0 Check if an mp3 header is using a reserved sample rate.
Fixes an invalid read past the end of avpriv_mpa_freq_tab.
Fixes divide-by-zero due to sample_rate being set to 0.

Bug-Id: 705

CC:libav-stable@libav.org
(cherry picked from commit 44127546b0)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:36:55 +02:00
Luca Barbato
6d899d0206 lzo: Handle integer overflow
get_len can overflow for specially crafted payload.

Reported-By: Don A. Baley <donb@securitymouse.com>
CC: libav-stable@libav.org
(cherry picked from commit ccda51b14c)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-25 15:37:01 +02:00
Michael Niedermayer
e0a03d1f9c update for FFmpeg 2.2.4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
d07be523f5 avformat/mpc: attempt to allocate a packet that is not smaller than the data inside it
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 86a9370e2b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
e4cdde96b3 avformat/cavsvideodec: Fix probing when the file extension is avs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 52e563bb2f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
252a0ccb80 cavsdec: fix qp fixed slice handling
Fixes Ticket3400

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
dad0c9d686 avcodec/alsdec: Clear MPEG4AudioConfig so that no use of uninitialized memory is possible
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6e6bd5481c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
e173834af8 avformat/flvenc: Do not allow creating h263/mpeg4 in flv without unofficial format extensions being enabled.
Found-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 74760883fc)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
63e3a97815 avcodec/aic: fix quantization table permutation
Fixes Ticket3700

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
61796a8999 avutil/lzo: add asserts to be double sure against overflows
These asserts cannot fail since d6af26c55c

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:04:07 +02:00
Michael Niedermayer
7d9c059a35 avutil/lzo: Fix integer overflow
Embargoed-till: 2014-06-27 requested by researcher, but embargo broken by libav today (git and mailing list)

Fixes: LMS-2014-06-16-4
Found-by: "Don A. Bailey" <donb@securitymouse.com>
See: ccda51b14c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d6af26c55c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:04:05 +02:00
Carl Eugen Hoyos
52572ca1b3 Show duration for large asf files as written in the file header.
Fixes ticket #3428.
(cherry picked from commit e3fd263f0b)
2014-06-21 21:52:05 +02:00
Michael Niedermayer
220bbc44c2 Merge commit '6672f672d98cf4887e13321b6f67682cfd1273b4' into release/2.2
* commit '6672f672d98cf4887e13321b6f67682cfd1273b4':
  avconv: make -shortest work with streamcopy

Conflicts:
	ffmpeg.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-20 00:06:36 +02:00
Michael Niedermayer
f378636d90 avformat/mp3enc: drop redundant and uninitialized variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eccec20397)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-19 21:05:12 +02:00
Ronald S. Bultje
98f33430a2 vp9/x86: fix overwrite in ipred_vl_4x4_ssse3.
Fixes track ticket 3717.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 385a3420d1)
2014-06-12 08:52:24 +02:00
Anton Khirnov
6672f672d9 avconv: make -shortest work with streamcopy
CC: libav-stable@libav.org
(cherry picked from commit 48e5092133)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-06-12 08:34:40 +02:00
Martin Storsjö
3002e5976d adpcm: Write the proper predictor in trellis mode in IMA QT
The actual predictor value, set by the trellis code, never
was written back into the variable that was written into
the block header. This was accidentally removed in b304244b.

This significantly improves the audio quality of the trellis
case, which was plain broken since b304244b.

Encoding IMA QT with trellis still actually gives a slightly
worse quality than without trellis, since the trellis encoder
doesn't use the exact same way of rounding as in
adpcm_ima_qt_compress_sample and adpcm_ima_qt_expand_nibble.

Fixes part of Ticket3701

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

Conflicts:
	tests/ref/acodec/adpcm-ima_qt-trellis
2014-06-09 23:54:20 +02:00
Martin Storsjö
1e8ff7d21d adpcm: Fix trellis encoding of IMA QT
This was broken in 095be4fb - samples+ch (for the previous
non-planar case) equals &samples_p[ch][0]. The confusion
probably stemmed from the IMA WAV case where it originally
was &samples[avctx->channels + ch], which was correctly
changed into &samples_p[ch][1].

Fixes part of Ticket3701

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a32765c425)
2014-06-09 23:53:45 +02:00
Michael Niedermayer
dae6c19995 avcodec/mjpegdec: Improve intel jpeg flip heuristic
Fixes Ticket3698

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0545ef7116)
2014-06-09 23:51:24 +02:00
Michael Niedermayer
989adf5ee5 avcodec/h264: in the absence of recovery points, be more tolerant on accepting plain I frames
Fixes: Ticket3652
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 19c9d1e8e7)
2014-06-09 23:50:12 +02:00
Carl Eugen Hoyos
09d406eec8 avcodec/utvideodec: Increase vlc len
Fixes a regression since fb3e380 similar to ticket #2661,
reported by fluffrabbit at aol dot com.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 673716c54b)
2014-06-09 23:49:18 +02:00
Carl Eugen Hoyos
d1b62a9a07 Do not limit blocksize when reading PCM from aiff.
Fixes ticket #3695.
(cherry picked from commit 763e714442)
2014-06-09 23:48:10 +02:00
Michael Niedermayer
29c8fac3f7 avformat/avidec: allow rounding errors between scale/rate and timebase
Fixes Ticket3670

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 571ab8344a)
2014-06-09 23:47:35 +02:00
Michael Niedermayer
8c33d40a7b ffmpeg: prevent pts < dts to be passed through to the muxer on stream copy
Fixes Ticket3658

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 27856b2fe9)
2014-06-09 23:46:48 +02:00
Michael Niedermayer
f406bf3fa9 Update for 2.2.3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 23:08:27 +02:00
Michael Niedermayer
54bec22a6e avformat/h263dec/h263_probe: Check TR
Fixes missdetection of Misdetection_345.mp3
Fixes missdetection of Misdetection_421.mp3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cd20b93e2f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
e1b2c93a23 avformat/h263dec/h263_probe: Check PSC bit 9 and 13 in
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3ad21c50af)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
e529ff52a0 avformat/h263dec: shift data in state to make more bits available to probe
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 04b15a6055)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
fb7e76d1cf avcodec/svq3: Fix "incompatible pointer type" warnings
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 89d2fc62db)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
96047b3150 avformat/utils: Call ff_rfps_add_frame() only for video
This avoids some unneeded computations

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
2545defeac avformat/flvenc: fix assertion failure after 4h muxing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2e532aa82d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
2d97ad38ed avcodec/mss4: Fix () in MKVAL() macro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cf7ff0146c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
f6c628f029 avcodec/mss34dsp: fix () in SOP* macros
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6e720c5c81)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
3f743e3e4c avcodec/mlpdec: fix () in MSB_MASK() macro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fa160af08b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
f2dbd64bde avcodec/ivi_dsp: add some missing () to macros
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f276bf303c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
7bce659e18 avcodec/hevc: fix () in macros
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 70f671c39e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
cb9379065f avcodec/h264: fix () in macros
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit af62b42736)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:49 +02:00
Michael Niedermayer
4261778dbd avcodec/golomb-test: fix () in EXTEND() macro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 97e6b5ee3a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:49 +02:00
Michael Niedermayer
ba88a6e4e4 avcodec/aac: fix () in IS_CODEBOOK_UNSIGNED macro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fa915d4193)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:49 +02:00
Michael Niedermayer
e0407a7bf7 avcodec/libvorbisenc: dont add the duration to AV_NOPTS_VALUE
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 19e66c7232)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:49 +02:00
Michael Niedermayer
d575984dfc avutil/cpu: force mmx on selection of higher x86 SIMD features
Fixes various runtime failures with manually set flags that represent no
existing CPU

Fixes Ticket3653

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:49 +02:00
Michael Niedermayer
9ea1e82d68 avcodec/diracdec: move mc buffer allocation to per frame
Fixes out of array accesses for non default buffers with large strides

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4a30f08505)
2014-06-02 22:59:49 +02:00
Michael Niedermayer
5cd2cdf33f Merge commit '0ec75a04e5fc714bc3cd6e2a6b783e6df834ad01' into release/2.2
* commit '0ec75a04e5fc714bc3cd6e2a6b783e6df834ad01':
  ppc: Fix compilation for ppc64le (ELFv2)
  aarch64: Use the correct syntax for relocations

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:34:22 +02:00
Michael Niedermayer
a5a6f6fec3 avformat/mov: allow seeking back to the begin even if nothing is marked as keyframe
Fixes Ticket 3663

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 96470ca22b)
2014-05-31 12:22:20 +02:00
Andreas Cadhalpun
88544e8ceb Fix spelling error 'Inconsistant -> Inconsistent'
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eeb3baf7f7)
2014-05-31 12:20:51 +02:00
Andreas Cadhalpun
f183eaa3ad Fix spelling errors in texi files: accomodate -> accommodate allows to -> allows one to choosen -> chosen compability -> compatibility explictly -> explicitly overriden -> overridden specifed -> specified Trasmission -> Transmission
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9898bd9a82)
2014-05-31 12:20:02 +02:00
Andreas Cadhalpun
d773d7775a Correct the FSF address for two avisynth files to '51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA'
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 64b6164b72)
2014-05-31 12:18:31 +02:00
Andreas Cadhalpun
f15f4cefd7 Improve the detection of architecture x86.
This fixes building on Debian GNU/Hurd.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0f17bc644c)
2014-05-31 12:14:48 +02:00
Thierry Fauck
0ec75a04e5 ppc: Fix compilation for ppc64le (ELFv2)
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit d6d767d93e)
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-05-30 22:56:02 +03:00
Martin Storsjö
34fb994d93 aarch64: Use the correct syntax for relocations
This fixes building in PIC mode with gas. The examples in the gas
manual showed using a # here even though gas itself actually didn't
support that syntax (and the gas test suite only tests it without
the extra hash sign).

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 08cd92144e)
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-05-29 14:48:13 +03:00
Anshul
acafd1814e ffprobe: fix crash happening because of new streams occuring
Fix trac ticket #3603.

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 73a6063314)
2014-05-21 22:53:49 +02:00
Carl Eugen Hoyos
bb01956d67 Use Matroska document version 2 for WebM files if possible.
Google's plugin for the Internet Explorer refuses to play
files with another document version.

Fixes ticket #3583.
(cherry picked from commit ab21acecc7)
2014-05-12 23:20:05 +02:00
Michael Niedermayer
bc0c49b83e avformat/avidec: remove unused variables
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cc8b45c0ce)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 18:18:31 +02:00
Michael Niedermayer
0008a87cb1 Merge commit 'e780c3daafe0588e035e752c771ebfcd2201746a' into release/2.2
* commit 'e780c3daafe0588e035e752c771ebfcd2201746a':
  pcm-dvd: Fix 20bit decoding

Conflicts:
	Changelog

See: 5db49fc38d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 18:10:47 +02:00
Michael Niedermayer
2aa6592338 Merge commit '7f954ca502a16feeca44d4e9a7d450b404dabc94' into release/2.2
* commit '7f954ca502a16feeca44d4e9a7d450b404dabc94':
  avi: Improve non-interleaved detection

Conflicts:
	Changelog
	libavformat/avidec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:59:58 +02:00
Michael Niedermayer
2b14d98086 avformat/avidec: Check required demuxing buffer sizes in guess_ni_flag()
Fixes Ticket3421

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:59:50 +02:00
Michael Niedermayer
a05f86ec10 Merge commit '8e9e57ed0c7f40741da1ca83e52c851263e0c168' into release/2.2
* commit '8e9e57ed0c7f40741da1ca83e52c851263e0c168':
  Update Changelog

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:31:57 +02:00
Michael Niedermayer
9bdb254b98 Merge commit '1bd6372cd34935815c0a061adbf3bc68ca68ff73' into release/2.2
* commit '1bd6372cd34935815c0a061adbf3bc68ca68ff73':
  arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:31:24 +02:00
Michael Niedermayer
358d1f6e01 Merge commit '40ffa99dfa39c574d8784a3c4eaf6406198d675d' into release/2.2
* commit '40ffa99dfa39c574d8784a3c4eaf6406198d675d':
  arm: hpeldsp: prevent overreads in armv6 asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:24:43 +02:00
Michael Niedermayer
ea28034f5d Merge commit 'ff79f6b35a94dde69b3d52bd2abdfdb793f525c3' into release/2.2
* commit 'ff79f6b35a94dde69b3d52bd2abdfdb793f525c3':
  avfilter: Add missing emms_c when needed

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:10:07 +02:00
Michael Niedermayer
6452b31599 Merge commit 'e2a83d72da866a29f5307a56f66c469966f02473' into release/2.2
* commit 'e2a83d72da866a29f5307a56f66c469966f02473':
  Update Changelog for v10.1

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:09:47 +02:00
Michael Niedermayer
a14969253a Merge commit '6c3985713b77c5c1155f31c3fbb8236f9b4cdfb5' into release/2.2
* commit '6c3985713b77c5c1155f31c3fbb8236f9b4cdfb5':
  Add missing changelog entries for v10

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:03:53 +02:00
Michael Niedermayer
fab9a7be76 Merge commit '7d97cc8d87ebf6ebe7ec1865d6f932c652dbce3a' into release/2.2
* commit '7d97cc8d87ebf6ebe7ec1865d6f932c652dbce3a':
  rtmpproto: Check the buffer sizes when copying app/playpath strings

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:03:09 +02:00
Michael Niedermayer
3a67865963 Merge commit 'a56a9e65c6a17dd8b6303dd45bdc3e3368093092' into release/2.2
* commit 'a56a9e65c6a17dd8b6303dd45bdc3e3368093092':
  swscale: Fix an undefined behaviour

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 16:44:08 +02:00
Michael Niedermayer
3fb754712c Merge commit '428b629eb28907738ae98331b9f6c25cc9a8f3c8' into release/2.2
* commit '428b629eb28907738ae98331b9f6c25cc9a8f3c8':
  vp9: Read the frame size as unsigned

Conflicts:
	libavcodec/vp9.c

See: c72f587353
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 16:43:45 +02:00
Michael Niedermayer
e5294f407a Merge commit '194d12345d86c15b20b7e44a3679c9df3075d7f6' into release/2.2
* commit '194d12345d86c15b20b7e44a3679c9df3075d7f6':
  dcadec: Use correct channel count in stereo downmix check

Conflicts:
	libavcodec/dcadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 16:23:49 +02:00
Michael Niedermayer
ed1ad2f5eb Merge commit 'b3d8276d2dc913d708d187fb15f6e98869d00500' into release/2.2
* commit 'b3d8276d2dc913d708d187fb15f6e98869d00500':
  dcadec: Do not decode the XCh extension when downmixing to stereo

Conflicts:
	libavcodec/dcadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 16:23:29 +02:00
nu774
e780c3daaf pcm-dvd: Fix 20bit decoding
Increment the pointer as needed.

Bug-Id: 592

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 9880a0d4b1)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-05-10 12:03:46 -04:00
Michael Niedermayer
7f954ca502 avi: Improve non-interleaved detection
Additional fixes by Nigel Touati-Evans <nigel.touatievans@gmail.com>.

Check the index for streams with a time drift of 2s or a buffer drift
of 64MB.

Bug-Id: 666
CC: libav-stable@libav.org
Sample-Id: yet-another-broken-interleaved-avi.avi

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit 9d599e3f6e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-05-10 12:00:40 -04:00
John Stebbins
8e9e57ed0c Update Changelog 2014-05-10 11:43:08 -04:00
Janne Grunau
1bd6372cd3 arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6
The overread avoidance fix in cbddee1cca
broke the computation for the last row since it prevented the safe
reading from the height+1-th row.

CC: libav-stable@libav.org
(cherry picked from commit 61985ad72c)
2014-05-10 11:11:50 -04:00
Janne Grunau
40ffa99dfa arm: hpeldsp: prevent overreads in armv6 asm
Based on a patch by Russel King <rmk+libav@arm.linux.org.uk>

Bug-Id: 646
CC: libav-stable@libav.org
(cherry picked from commit cbddee1cca)
2014-05-10 11:11:43 -04:00
Luca Barbato
ff79f6b35a avfilter: Add missing emms_c when needed
Arch specific calls should have an emms_c following to keep the cpu
state consistent.

Reported-By: wm4
CC: libav-stable@libav.org
(cherry picked from commit e995cf1bcc)
2014-05-10 11:11:21 -04:00
Reinhard Tartler
e2a83d72da Update Changelog for v10.1 2014-05-10 10:05:03 -04:00
Reinhard Tartler
6c3985713b Add missing changelog entries for v10 2014-05-10 10:01:37 -04:00
Martin Storsjö
7d97cc8d87 rtmpproto: Check the buffer sizes when copying app/playpath strings
As pointed out by Reimar Döffinger.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 0bacfa8d37)

Conflicts:
	libavformat/rtmpproto.c
2014-05-08 20:00:47 -04:00
Luca Barbato
a56a9e65c6 swscale: Fix an undefined behaviour
Prevent a division by zero down the codepath.

Sample-Id: 00001721-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 3a177a9cca)
2014-05-08 19:56:00 -04:00
Luca Barbato
428b629eb2 vp9: Read the frame size as unsigned
Sample-Id: 00001723-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 925c37874b)
2014-05-08 19:56:00 -04:00
Tim Walker
194d12345d dcadec: Use correct channel count in stereo downmix check
s->prim_channels is greater than num_core_channels
when an XCh extension is present in the bitstream.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 801c39e1e3)
2014-05-07 23:51:01 +02:00
Tim Walker
b3d8276d2d dcadec: Do not decode the XCh extension when downmixing to stereo
This is neither necessary nor currently supported.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit c8cf461c19)
2014-05-07 23:50:53 +02:00
Michael Niedermayer
c2eb668617 Update for 2.2.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:41:34 +02:00
Lukasz Marek
c9c223ba00 lavd/opengl_enc: fix pixel data alignment
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8ff72924cf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
9d0ff6436e ffmpeg: print an error at the end if conversion failed
Fixes Ticket3477

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
02b7b125b5 avfilter/graphdump: Fix pointer to local outside scope
Fixes CID1194435
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 18af0ce62d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
5643668308 ffmpeg_filter: fix pointer to local outside scope
Fixes CID1206652
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 09b16619d3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
2d18e7f3ef avcodec/mjpegdec: Fix undefined shift
Fixes CID1194388

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
f1b5830182 avformat/h263dec: Fix h263 probe
The code was missing 1 bit in the src format

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
c588316555 avfilter/filtfmts: Support dynamically allocated in/outputs
Fixes crash
Fixes Ticket3468

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
afd1f61944 iavcodec/vc1dec: Fix missing {}
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb53beb81a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
16a9c5ea9e avfilter/vf_deshake: fix loss of precission with odd resolutions
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 73734282e0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
83fb31a76d avfilter/f_select: fix loss of precission in SAD calculation
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5a8ef3c66b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
fc5b32877a avcodec/g723_1: add assert to help static code analyzers
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1457f3fd90)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
10e023c4fa avcodec/diracdec: fix undefined behavior with shifts
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b8598f6ce6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
27a3a59428 avformat/mpegts: Remove redundant check
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ff6fa0b4b9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
8ab849cddc avcodec/fic: Fix return value check
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 230db1426d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
5191b00155 avcodec/dcadec: fix error message suppression code
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f202af29c9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
1131e7a1a4 avcodec/mjpegen: Fix declared argument size
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 256f530603)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
26becbcd2a swscale/swscale: fix srcStride/srcSlice typo
Fixes part of Ticket3466
Found by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 14fa7fc6a8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
366cdd3548 avcodec/x86/idct_sse2_xvid: fix non C99 inline function
Found-by: Matt Oliver <protogonoi@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 46d5625f44)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Stephan Soller
e3b08b3ad4 avformat/rtmpproto: Added handling of an initial RTMP chunk size packet.
Fixes ticket #2911.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 36b9c27dae)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
fa16440659 Merge commit '79041d92ee7421853ee8c57fc13891cb0c272e0e' into release/2.2
* commit '79041d92ee7421853ee8c57fc13891cb0c272e0e':
  matroska: add the Opus mapping

Conflicts:
	libavformat/matroska.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 21:25:27 +02:00
Michael Niedermayer
c36fd16aaa Merge commit '82cebc0e0544dce507749dd9b1c2983f083de836' into release/2.2
* commit '82cebc0e0544dce507749dd9b1c2983f083de836':
  matroskadec: read the CodecDelay element

Conflicts:
	libavformat/matroska.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 21:01:38 +02:00
Michael Niedermayer
8c5897632a Merge commit 'c4e764aa6980dd9dc7c423921b415ff7261c944a' into release/2.2
* commit 'c4e764aa6980dd9dc7c423921b415ff7261c944a':
  rtmpproto: Make sure to pass on the error code if read_connect failed

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 20:54:43 +02:00
Michael Niedermayer
b34fce9c54 Merge commit '9d02e38d3f03100784348ff75fd181d2aaad7e43' into release/2.2
* commit '9d02e38d3f03100784348ff75fd181d2aaad7e43':
  lavr: allocate the resampling buffer with a positive size

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 20:14:18 +02:00
Michael Niedermayer
742f9aa879 Merge commit '0f6e309b97e3da83a0fa75fbf1c4b50cd72047eb' into release/2.2
* commit '0f6e309b97e3da83a0fa75fbf1c4b50cd72047eb':
  mp3enc: Properly write bitrate value in XING header

Conflicts:
	libavformat/mp3enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 20:13:41 +02:00
Anton Khirnov
79041d92ee matroska: add the Opus mapping
(cherry picked from commit 141fdc763c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-05-03 16:22:58 -04:00
Anton Khirnov
82cebc0e05 matroskadec: read the CodecDelay element
(cherry picked from commit eb3b5501e8)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavformat/matroskadec.c
2014-05-03 13:50:26 -04:00
Michael Niedermayer
09abca6802 sws: dont use the optimized 410->420 unscaled conversion when height%4
Fixes Ticket3594
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 421b21ca8a)
2014-05-01 18:23:30 +02:00
Michael Niedermayer
43d64829e6 avcodec/vorbisdec: try to workaround libvorbisenc bug
Fixes Ticket3590

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0a266cb55a)
2014-05-01 18:22:19 +02:00
Michael Niedermayer
4a479fd3e6 swresample: fix AV_CH_LAYOUT_STEREO_DOWNMIX input
Fixes Ticket 3542

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 291d464161)
2014-04-24 08:59:56 +02:00
Michael Niedermayer
4f41717d01 avformat/mux: Check for and remove invalid packet durations
Fixes assertion failure
Fixes Ticket3575

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dc6a17cf74)
2014-04-24 08:56:58 +02:00
Michael Niedermayer
6896dcbf5f avformat/avidec: Speed up keyframe detection code
Fixes Ticket3531

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 57fb570908)
2014-04-23 17:11:23 +02:00
Stefano Sabatini
14404170b9 ffprobe: fix scaling of vali in value_string() in case -prefix is selected
Fix trac ticket #3523.
(cherry picked from commit 1ba59b1cbe)
2014-04-23 17:11:16 +02:00
Michael Niedermayer
e9e42beed2 avformat/asfenc: dont allow non interleaved packets
The muxer does not support this currently

Fixes ticket #3547.
Fixes ticket #3555.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 369cdf917a)
(cherry picked from commit 514ec9bece86fed440ac829c10e82c4a0569c3a5)
2014-04-23 17:10:26 +02:00
Michael Niedermayer
abd6decd55 avformat/pmpdec: remove cur_dts timestamp hack
It appears the demuxer works fine without it

Fixes Ticket3534

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5b19fc7aae)
2014-04-23 17:01:36 +02:00
Michael Niedermayer
0385c824f1 avformat: Fix decoder search in find stream info
Fixes Ticket3548

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f3743901d7)
2014-04-23 16:58:23 +02:00
Martin Storsjö
c4e764aa69 rtmpproto: Make sure to pass on the error code if read_connect failed
Previously, if read_connect failed, the ret variable was unmodified
and had the value 0, indicating success, which then was returned from
the rtmp_open function, even though it actually failed.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 6477139721)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-04-19 22:03:57 -04:00
Anton Khirnov
9d02e38d3f lavr: allocate the resampling buffer with a positive size
This fixes cases where very few input samples (fewer than needed for one
output sample) are passed to lavr at the beginning.
CC:libav-stable@libav.org

(cherry picked from commit ac976ed91e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-04-19 22:03:29 -04:00
Peter Ross
30cf47c6f0 ff_id3v2_read: add option to limit ID3 magic number search
Several chunked formats (AIFF, IFF,DSF) store ID3 metadata within an 'ID3 '
chunk tag. If such chunks are stored sequentially, it is possible for the
ID3v2 parser to confuse the chunk tag for the ID3 magic number. e.g.

[1st chunk tag ('ID3 ') | chunk size] [ID3 magic number | metadata ...]
[2nd chunk tag ('ID3 ') | chunk size] [ID3 magic number | metadata ...]

Fixes ticket #3530.

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5331773cc3)

Conflicts:
	libavformat/dsfdec.c
2014-04-19 13:00:57 +02:00
Peter Ross
b45cd17d29 ff_id3v2_free_extra_meta: set the pointer pointing to extra_meta to NULL
Fixes ticket #3530.

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c94305ae23)
2014-04-19 12:59:18 +02:00
Carl Eugen Hoyos
26b6d70c72 Do not overwrite VDPAU structures in ff_MPV_frame_start().
Fixes crashes with VDR and MPlayer as reported by irc user crow.
(cherry picked from commit 941b2240f2)
2014-04-18 10:32:43 +02:00
Anh
32919db4fb Fix compilation with --disable-everything --enable-muxer=avi --disable-network.
Fixes ticket #3568.
(cherry picked from commit c150e2cf32)
2014-04-16 20:07:51 +02:00
Michael Niedermayer
56f44c26f0 avutil/avstring: do not lose ascii characters when decoding non utf-8 with av_utf8_decode()
Fixes Ticket3363

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a31547ce2e)
2014-04-16 19:20:20 +02:00
Michael Niedermayer
fe87a40de6 ffprobe: do not lose non ascii characters in non utf8 strings
Fixes Ticket3363

Using U+FFFD REPLACEMENT CHARACTER as suggested by nicolas

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ca6dd53a73)
2014-04-16 19:20:03 +02:00
Michael Niedermayer
0f6e309b97 mp3enc: Properly write bitrate value in XING header
Instead of using a fixed bitrate_idx, calculate a matching bitrate for
the XING header.

Using a fixed bitrate_idx causes tools such as file(1) and mediainfo(1)
to report wrong bitrate and bitrate mode when using CBR.

Bug-Id: https://bugs.debian.org/736088

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 617a1a98a6)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-04-12 10:49:30 -04:00
Derek Buitenhuis
96e13c9897 libx265: Use x265_param_parse to set the SAR
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
(cherry picked from commit 8945dcbb52)

Conflicts:
	libavcodec/libx265.c
2014-04-11 16:45:33 -03:00
Michael Niedermayer
e72c0a0466 update for 2.2.1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 05:09:51 +02:00
Anthoine Bourgeois
dfddefa13a avcodec/dirac_arith: Fix build with PIC and stack-check options
Fixes Ticket3540

The function dirac_get_arith_bit in libavcodec/dirac_arith.h can't be
built with PIC and check-stack because the asm code needs 6 registers
and PIC and check-stack options take 1 each and x86 is quite limited
in this area.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
ce94955b3c swscale/x86/swscale_template: loose hardcoded dstw_offset
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f6759d9ad4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
dde95268cc swresample/resample: use av_malloc_array() where appropriate
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5027f39712)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
d20ac551a8 swresample/dither: use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a5290cb1ac)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
352b0969e2 swresample/resample: Limit filter length
Related to CID1197063

The limit choosen is arbitrary and much larger than what makes sense.
It avoids the need for checking arithmetic operations with the length for overflow

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
b479b42b26 avcodec/msrle: check return code for success before use
The check is possibly redundant, but better to check for errors
that dont occur than to skip the check and crash

Fixes CID1197060

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
36cab9c408 avcodec/pthread_frame: fix missing unlock on error
Fixes CID1197057
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f87b3d5523)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
34592d04fb examples/avio_reading: fix null dereference on error
Fixed CID1197052
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 419800acc4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
544accc895 avformat/omadec: fix probetest failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a84f9c75bc)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
f41622ecb4 avcodec/wma: use av_freep(), do not leave stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d167faafe9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Lukasz Marek
fc8eb4c1f9 lavu/opt: validate range before dereference
This change make error handling simplier.
av_opt_freep_ranges may be called when some ranges are NULL,
for example after memory allocation fail.

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3aac5fcfa9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
02bae9f013 avcodec/h264: clear cur_pic structure instead of duplicating it in ff_h264_update_thread_context()
Fixes crash

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

Conflicts:

	libavcodec/h264_slice.c
2014-04-10 04:53:00 +02:00
Michael Niedermayer
5cb2a1c3f0 avfilter/vf_pullup: fix gray8
Fixes segfault
Fixes Ticket3469

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
a221c9bd76 avcodec/libx264: move where x264opts is applied down so it isnt overridden by avctx & defaults
fixes x264opts opengop=1

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
b2583c2b62 Merge commit 'e0aa76d38a02090245284fc157afb9074e9ff073' into release/2.2
* commit 'e0aa76d38a02090245284fc157afb9074e9ff073':
  golomb: Fix the implementation of get_se_golomb_long

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:46:00 +02:00
Michael Niedermayer
bd553941ae Merge commit 'a014b9614e6165fb8df9e756f46a95d516794678' into release/2.2
* commit 'a014b9614e6165fb8df9e756f46a95d516794678':
  Prepare for 10.1 Release

Conflicts:
	RELEASE

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:35:35 +02:00
Martin Storsjö
e0aa76d38a golomb: Fix the implementation of get_se_golomb_long
This was only used in hevc muxing code so far.

This makes the return values match what get_se_golomb returns for
the same bitstream reader instances.

The logic for producing a signed golomb code out of an unsigned one
was based on the corresponding code in get_se_golomb, which operated
directly on the bitstream reader buffer - not on the equivalent
return value from get_ue_golomb.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 508a84e672)
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-03-30 12:45:40 +03:00
Reinhard Tartler
a014b9614e Prepare for 10.1 Release 2014-03-29 13:03:59 -04:00
Andreas Cadhalpun
31c21d2f69 Fix spelling errors in texi files: more informations --> more information allows to --> allows one to
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d473f2d18a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Andreas Cadhalpun
3cd1c8653b Fix texinfo error due to wrong @subsubsection
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cf3bfc970c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
194485cfba avfilter/vf_pullup: zero freed memory for saftey
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a44409e692)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
wm4
81cfe39113 vf_pullup: simplify, fix double free error
The memory allocation for f->diffs was freed multiple times in some
corner cases. Simplify the code so that this doesn't happen.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
ef0c503d37 avcodec/h264_mp4toannexb_bsf: prepend global headers before any in stream parameter sets
Fixes h264_mp4toannexb_bsf_failure.mkv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
James Almer
1103aec1df x86/cpu: check for OS support before enabling AVX2
AV_CPU_FLAG_AVX is enabled at this point only if there's OS support.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
b40ab81d1f avcodec/x86/mpegvideoenc_template: fix integer overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
314f055c29 dox/scaler:fix bicubiclin typo
See Ticket3486

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
2c566744c4 avcodec/vorbis: fix decoding of single element huffman trees
Fixes Ticket2893

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
adad1ba5d8 avcodec/vorbisdec: use the stored previous window type only when the actual previous is not known
Fixes Ticket3432

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
a80a7131d1 swscale/swscale: fix integer overflow
Should fix fate failure with clang ftrapv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Carl Eugen Hoyos
3ab63abbd4 Do not set swscale sizeFactor to -1.
Fixes ticket #3495.
(cherry picked from commit e6fe804bdd)
2014-03-26 11:05:41 +01:00
Michael Niedermayer
d2c76782e0 update for 2.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 21:13:49 +01:00
Andrey Myznikov
4dc8b4d7d0 Fix pthread-related compile errors in iec61883.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9deecdf85f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 21:01:50 +01:00
Michael Niedermayer
9ff0467566 Move avpriv_find_pix_fmt() to utils.c
Fixes build with --disable-everything

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
4407b38b28 swscale/x86/swscale: fix missing xmm clobbers in yuv2yuvX_sse3()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6c47a4e972)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
8caaf260a6 avformat/utils: detect MPEG streams with faulty DTS and discard affected DTS
Fixes issue2.ts

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
e1f51bbd1f avcodec/g2meet: also reset local got_header when reseting the context got_header
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8b8ae298af)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
4b7c149306 avcodec/g2meet: fix error returns
Fixes out of array accesses

This should not affect any release

Fixes: 8ab69af9e5a7a7e20fe04cdd25c0d6e7-asan_heap-oob_e72b82_5505_cov_2278389485_g2m4.wmv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6b53c1aa82)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
e8919d6522 Revert "mpegts: do not set pts for missing dts in video streams"
This reverts commit f65afef1df.

If only pts is coded then dts must be equal pts
See Rec. ITU-T H.222.0 (06/2012) / ISO/IEC 13818-1:2013 (E) 2.7.5

Found-by: Baptiste Coudurier
(cherry picked from commit 0bf882864e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
b017785fa5 avformat/mp3dec: optimize mp3_seek() for dir < 0
this minimizes the amount of protocol seeks and reading needed in that case

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
01507eb1f8 avformat/aviobuf: optimize sequential backward seeking
This reduces the number of protocol seeks

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
938ff93710 avformat/aviobuf: factorize buffer_size out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2adf422ce2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
0c88d539f8 avcodec: Add padding after the remaining AVFrames
This limits ABI issues in case libavcodec is linked to a libavutil with larger AVFrame
Which can happen if they are shiped in seperate binary packages and libavutil is upgraded

A cleaner alternative would be to replace them by pointers but this would likely cause
a small speedloss

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

Conflicts:

	libavcodec/h264.h
(cherry picked from commit 618d062bd553a7d7fad194d4236913f2b0a0251e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
e39a992bd1 avformat/mp3enc: use av_copy_packet()
Fixes double free
Fixes Ticket3476

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
72a12f61ef avcodec/snowenc: allow larger mb variances
Fixes assertion failure
Fixes Ticket3463

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
30ae080e9d avcodec/ratecontrol: make (mc_)mb_var_sum(_last) 64bit
This avoids hypothetical integer overflows
(cherry picked from commit b4356c9cc2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
dca463b728 avcodec/mpegvideo: make mc_mb_var_sum / mb_var_sum 64bit
This avoids a hypothetical integer overflow with very high resolution video

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
25b462cab9 avcodec/mpegvideo: make mc_mb_var_sum_temp / mb_var_sum_temp 64bit
This avoids a hypothetical integer overflow with very high resolution video

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
7c6a8afa7e ffmpeg: dont call exit_program() from a signal hander
This is unsafe and can deadlock amongth other things

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
b052525f9b avcodec/mjpegdec: Switch default interlaced polarity for MJPG to 1
Fixes Ticket3229

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
90c7bfb9be avcodec/mjpegdec: parse avid data from extradata
Makes no difference for any file tested but is needed
for following bug-fix

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
7bdd348e58 avcodec/mjpeg: print info from parse_avid() if requested
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 046a75eea0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:04 +01:00
Michael Niedermayer
af3d003658 avcodec/mjpegdec: switch interlaced_polarity to 0 for PAL AVID
0 should have been the default, this change should make no difference
but this is needed for the following bugfix

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:04 +01:00
Michael Niedermayer
c00beff5e0 avcodec/mjpegdec: factorize parse_avid out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1083c479eb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:04 +01:00
Michael Niedermayer
57a43142ba avcodec/utils: fix sizeof(AVFrame) dependence in avcodec_encode_audio2()
This is a bit tricky, we allocate a correctly sized AVFrame but then only
copy the compile time AVFrame size, this is to ensure that user applications
which do not use the correct av frame API dont end with out of array reads.
Note, applications using the correct API have set extended_data and the
changed code will never be executed for them.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:04 +01:00
Nicolas George
99905118a8 lavd/xv: take aspect ratio into account.
(cherry picked from commit c37bbe54f4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:04 +01:00
Nicolas George
dcf560204c lavc/pthread: copy packet side data.
(cherry picked from commit ea6825fd09)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:04 +01:00
Michael Niedermayer
5b0e2eb041 Merge commit 'f25e6e0c255a6d81971fe66f6c32d29be0706f3d' into release/2.2
* commit 'f25e6e0c255a6d81971fe66f6c32d29be0706f3d':
  RELEASE_NOTES: mention new filters

Conflicts:
	doc/RELEASE_NOTES

Not merged as these things where in past ffmpeg releases already.
    Or at least some of them where, volunteers to checks this and update
    our release notes are welcome

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:29:23 +01:00
Carl Eugen Hoyos
d461e077a5 Always pass the configure option sysroot to --sysroot and -isysroot.
On darwin, --sysroot may be ignored.

(cherry picked from commit cc6d549adb)
2014-03-23 20:12:54 +01:00
Michael Niedermayer
9a884b7b97 Merge commit '80239a8bb11f730d95f03dfbd0deab258b413b0e' into release/2.2
* commit '80239a8bb11f730d95f03dfbd0deab258b413b0e':
  af_channelmap: fix ONE_STR mapping mode

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 19:56:37 +01:00
Michael Niedermayer
9abe0bfb7f Merge commit '26bbc1c242ebfeec3c49585207efac7293632433' into release/2.2
* commit '26bbc1c242ebfeec3c49585207efac7293632433':
  Prepare for 10 Release

Conflicts:
	RELEASE

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 19:54:52 +01:00
Carl Eugen Hoyos
13682b48e9 Autodetect VDA like all other hardware acccelerations.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 942cded690)

Conflicts:
	configure
2014-03-23 19:05:59 +01:00
Vittorio Giovara
f25e6e0c25 RELEASE_NOTES: mention new filters 2014-03-23 17:28:34 +01:00
Anton Khirnov
80239a8bb1 af_channelmap: fix ONE_STR mapping mode
get_channel() returns 0 on success

CC:libav-stable@libav.org
(cherry picked from commit e843612695)
2014-03-23 11:41:40 -04:00
Reinhard Tartler
26bbc1c242 Prepare for 10 Release 2014-03-23 11:38:38 -04:00
Michael Niedermayer
efe259a27e Merge commit '29d61d73b1cbf0dcd1f79bc49c7df01b0a377c85' into release/2.2
* commit '29d61d73b1cbf0dcd1f79bc49c7df01b0a377c85':
  movenc: Allow override of major brand in ftyp atom

Conflicts:
	libavformat/movenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 04:05:56 +01:00
Michael Niedermayer
49f11e12d5 Merge commit '9a6a7109985cbd3a20707b40cc31ed53a174195c' into release/2.2
* commit '9a6a7109985cbd3a20707b40cc31ed53a174195c':
  matroskaenc: enable Annex B to MP4 conversion for HEVC tracks.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 03:20:00 +01:00
Michael Niedermayer
d130fae519 Merge commit 'daaef403d122b35d87b27d6b369d287b1ed06973' into release/2.2
* commit 'daaef403d122b35d87b27d6b369d287b1ed06973':
  matroskaenc: write private data in hvcC format for HEVC.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 03:14:03 +01:00
Michael Niedermayer
dde996bf99 Merge commit '0f42e06651c9c4d7581b70b9ad2b160c2525094f' into release/2.2
* commit '0f42e06651c9c4d7581b70b9ad2b160c2525094f':
  doc: Point to the correct, actually maintained gas-preprocessor repo

Conflicts:
	doc/platform.texi

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 03:12:28 +01:00
Michael Niedermayer
cad2958fd7 Merge commit '230c4c6ad9f74697e77351d32e679bf0c24478ea' into release/2.2
* commit '230c4c6ad9f74697e77351d32e679bf0c24478ea':
  armv6: vp8: use explicit labels in motion compensation asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 03:11:19 +01:00
John Stebbins
29d61d73b1 movenc: Allow override of major brand in ftyp atom
Signed-off-by: Tim Walker <tdskywalker@gmail.com>
(cherry picked from commit 1e9db41e2a)
2014-03-23 00:50:02 +01:00
Tim Walker
9a6a710998 matroskaenc: enable Annex B to MP4 conversion for HEVC tracks.
(cherry picked from commit 558b20d729)
2014-03-21 00:55:16 +01:00
Tim Walker
daaef403d1 matroskaenc: write private data in hvcC format for HEVC.
(cherry picked from commit a823d09486)
2014-03-21 00:55:00 +01:00
Carl Eugen Hoyos
207f5a138a Add APIchanges entry and bump libswscale micro version for making gray16 full-scale. 2014-03-19 09:14:53 +01:00
Carl Eugen Hoyos
e9c8a9aaa6 swscale/utils: Fix color range of gray16
Improves rgb -> gray16 conversion

Fixes Ticket3422

The pam and png output files look visually similar, in both cases the
dynamics increase to 0x0 -> 0xfffb.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 37c07d4529)
2014-03-19 03:14:39 +01:00
Michael Niedermayer
7b7d8b8794 avcodec/mpegvideo_enc: dont use direct mode for unaligned input
Fixes Ticket3456

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 06a3185e38)
2014-03-17 15:47:51 +01:00
Michael Niedermayer
90d6b563fe avcodec: Move STRIDE_ALIGN to internal.h
The next commit/bugfix will need it

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit da89572004)
2014-03-17 15:47:49 +01:00
Peter Ross
dce2f820e9 avcodec/adpcm: squelch 'mismatch in coded sample count' warning for AV_CODEC_ID_ADPCM_EA_R2/3
These ADPCM codecs include a per-frame flag that enables a raw 16-bit mode. Therefore
the the number of samples returned by get_nb_samples() is only ever approximate.

Fixes ticket #3460.

Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7380201451)
2014-03-17 15:46:12 +01:00
Peter Ross
4aab3f868f avcodec/adpcm: ADPCM_IMA_DK3 packets are padded to 16-bit packet boundary
Fixes ticket #3461.

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d1bb17940d)
2014-03-17 15:46:00 +01:00
Michael Niedermayer
48609236da ffmpeg_opt: check that a subtitle encoder is available before auto mapping streams
Fixes Ticket3470

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 25bcf24d4d)
2014-03-17 15:45:49 +01:00
Michael Niedermayer
d8fe695779 avcodec/h264: be more tolerant on what pixel format changes trigger reinits
Fixes Ticket3260

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8e92ff2546)
2014-03-17 15:45:36 +01:00
Martin Storsjö
0f42e06651 doc: Point to the correct, actually maintained gas-preprocessor repo
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit d15c536123)
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-03-16 20:54:24 +02:00
Janne Grunau
230c4c6ad9 armv6: vp8: use explicit labels in motion compensation asm
The integrated arm assembler in clang-503.0.38 (Xcode-5.1) seems
to get confused by the offset of 4 and decides to use a non-wide
thumb encoding. That fails since the labels are out of range of
the limited offset a 16-bit thumb encoding offers.
2014-03-16 18:13:39 +01:00
Michael Niedermayer
f4489c9558 Merge commit 'b5210f4eae30df587815b5f005f219aa723591d3' into release/2.2
* commit 'b5210f4eae30df587815b5f005f219aa723591d3':
  http: Properly initialize icy headers string

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 04:12:43 +01:00
Michael Niedermayer
0e5d9fe2a7 Merge commit '10379d50be18325a07ef297bd2120d85a58ec78b' into release/2.2
* commit '10379d50be18325a07ef297bd2120d85a58ec78b':
  http: Declare more parameters as const where possible

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 04:12:29 +01:00
Michael Niedermayer
9ae2aaea50 Merge commit 'cd874cf8e69f1b31986fd978577994b45efa3d5c' into release/2.2
* commit 'cd874cf8e69f1b31986fd978577994b45efa3d5c':
  http: Allow setting a Content-Type for POST requests

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 04:06:49 +01:00
Michael Niedermayer
2513314912 Merge commit '82a3e469c6584e6d9e56a3fc38eb001d0650defa' into release/2.2
* commit '82a3e469c6584e6d9e56a3fc38eb001d0650defa':
  http: Improve options descriptions

Conflicts:
	doc/protocols.texi
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 04:02:57 +01:00
Michael Niedermayer
e727cbf0be Merge commit 'f859fed03d5d039430baea03a0ef35cfd6ac4abd' into release/2.2
* commit 'f859fed03d5d039430baea03a0ef35cfd6ac4abd':
  http: Always allow no-op seek

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:56:19 +01:00
Michael Niedermayer
bcc25353cf Merge commit '991e6fa35b4ad2df389ba7e1c2c58d064e295c76' into release/2.2
* commit '991e6fa35b4ad2df389ba7e1c2c58d064e295c76':
  http: Add support for selecting a request range

Conflicts:
	doc/protocols.texi
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:38:30 +01:00
Michael Niedermayer
6a10263f16 Merge commit '09dca5106698871920328ae8041d1437ce3cff43' into release/2.2
* commit '09dca5106698871920328ae8041d1437ce3cff43':
  http: Support setting custom User-Agent

Conflicts:
	doc/protocols.texi
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:38:07 +01:00
Michael Niedermayer
bcc6429c01 Merge commit '40de74d0eb8c1898e2184a1484fe246aed5b295d' into release/2.2
* commit '40de74d0eb8c1898e2184a1484fe246aed5b295d':
  http: Export Content-Type information

Conflicts:
	doc/protocols.texi
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:37:53 +01:00
Michael Niedermayer
bdb219435e Merge commit 'e2811c2ede428a20aec3630bef4378f2927fb306' into release/2.2
* commit 'e2811c2ede428a20aec3630bef4378f2927fb306':
  http: Add support reading ICY metadata

Conflicts:
	doc/protocols.texi
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:30:09 +01:00
Michael Niedermayer
a7338ae8ac Merge commit '25d14b716aef43bf9e82f1d67a364e5922332f47' into release/2.2
* commit '25d14b716aef43bf9e82f1d67a364e5922332f47':
  http: Refactor process_line

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:29:40 +01:00
Michael Niedermayer
6776c2c04f Merge commit 'f1de93dec302cc860c718e89656f184510b2d239' into release/2.2
* commit 'f1de93dec302cc860c718e89656f184510b2d239':
  http: K&R formatting cosmetics

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:29:24 +01:00
wm4
facd3dbc6e http: handle ICY in presence of chunked transfer encoding
Some http servers send an ICY stream in combination with chunked
transfer encoding. This case was handled incorrectly by the ICY code:
instead of handling chunked encoding before anything ICY related, both
were mixed.

Fix this by separating the ICY code from normal http reading. Move the
normal http reading to a new function http_read_stream(), while
http_read() handles ICY on top of http_read_stream().

The server identified itself as: cloudflare-nginx

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

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:29:12 +01:00
Michael Niedermayer
8796c3b7d3 Merge commit '738d68d' into release/2.2
* commit '738d68d':
  http: Drop doxy comments

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:00:17 +01:00
Michael Niedermayer
7430f3064f Merge commit '00ecce5' into release/2.2
* commit '00ecce5':
  http: Return meaningful error codes

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 02:59:41 +01:00
Michael Niedermayer
eac281b06c Merge commit 'b920c1d' into release/2.2
* commit 'b920c1d':
  configure: Support older version of openjpeg1

Conflicts:
	configure

Not merged as the problematic pkg config code wasnt merged

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 02:58:57 +01:00
Alessandro Ghedini
b5210f4eae http: Properly initialize icy headers string
The icy_metadata_headers string never gets initialized, so,
during the first call to av_strlcatf() in parse_icy(),
strlen() will be called on a pointer to uninitialized memory.
At best this causes some garbage data to be left at the
start of the string.

By initializing icy_metadata_headers to the empty string, the
first call to strlen() will always return 0, so that data is
appended from the start of the string.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 6998a9f4c4)
2014-03-15 09:54:28 -04:00
Martin Storsjö
10379d50be http: Declare more parameters as const where possible
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e77a2ea950)
2014-03-15 09:54:20 -04:00
Clément Bœsch
cd874cf8e6 http: Allow setting a Content-Type for POST requests
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 2572d07c1f)
2014-03-15 09:52:07 -04:00
Reinhard Tartler
82a3e469c6 http: Improve options descriptions
Add documentation where missing.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit fe568b3d27)

Conflicts:
	libavformat/http.c
2014-03-15 09:51:57 -04:00
Anssi Hannula
f859fed03d http: Always allow no-op seek
This also allows checking stream position as per ffurl_seek() doxy.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit ab76d9f628)
2014-03-15 09:51:17 -04:00
Anssi Hannula
991e6fa35b http: Add support for selecting a request range
Comment from Reimar Döffinger included as pro memoria.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 2ec33d2712)
2014-03-15 09:51:10 -04:00
Clément Bœsch
09dca51066 http: Support setting custom User-Agent
Contextually make the default User-Agent use the common
"Name/Version" pattern.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit ddfc989063)
2014-03-15 09:51:03 -04:00
Michael Niedermayer
40de74d0eb http: Export Content-Type information
Bug-Id: https://bugs.debian.org/740421

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit e58c85b068)
2014-03-15 09:50:54 -04:00
Luca Barbato
e2811c2ede http: Add support reading ICY metadata
Export the metadata as a icy_metadata_packet avoption.
Based on the work of wm4 and Alessandro Ghedini.

Bug-Id: https://bugs.debian.org/739936

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 8075c3d8bb)
2014-03-15 09:50:17 -04:00
Luca Barbato
25d14b716a http: Refactor process_line
(cherry picked from commit 4ff99ab3d7)
2014-03-15 09:44:59 -04:00
Luca Barbato
f1de93dec3 http: K&R formatting cosmetics
(cherry picked from commit 7a2fddb448)
2014-03-15 09:44:59 -04:00
Luca Barbato
738d68de85 http: Drop doxy comments
(cherry picked from commit 78b21c1d71)
2014-03-15 09:44:59 -04:00
Luca Barbato
00ecce5c8b http: Return meaningful error codes
(cherry picked from commit 55a215ba63)
2014-03-15 09:44:59 -04:00
Michael Niedermayer
6ba07e9948 update for 2.2-rc2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 03:08:20 +01:00
Michael Niedermayer
125bea15d1 avcodec/libx265: fill headers in extradata
Fixes Ticket3457

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:42:11 +01:00
Michael Niedermayer
70e3cc282b avutil/timestamp: Warn about missing __STDC_FORMAT_MACROS for C++ use
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8b02dfd37c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:42:11 +01:00
Michael Niedermayer
242df26b44 mvformat/movenc: fix IMX
fixes Ticket3351

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:42:11 +01:00
Michael Niedermayer
46c2dba20e doc/texi2pod: fix encoding type
docs say:
'A document having more than one "=encoding" line should be considered an error. '

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:42:11 +01:00
Carl Eugen Hoyos
3caa6a5a57 Revert "Allow stream-copying grayscale mov files."
This reverts commit 691dec6201.

The commit did not fix ticket #3215, it was fixed one commit earlier.
The revert may break other use-cases but they should be fixed differently,
the offending commit introduced too many problems.

Fixes ticket #3377.
Fixes ticket #3378.
(cherry picked from commit 54bbe3e2a6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:42:11 +01:00
Matt Oliver
bf08665e2e Fix modplug linkage on Windows.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 99b48fd448)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:42:11 +01:00
Stephen Hutchinson
c4f5f4dbd3 doc/general.texi: Adjust the notes on AviSynth
FFmpeg provides local copies of these headers in compat/avisynth/,
and there is no restriction against using 2.5.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:41:27 +01:00
Michael Niedermayer
29df24252a Merge commit '2b9ee7d5b901e0d7ba617511e4ed31d3043894d3' into release/2.2
* commit '2b9ee7d5b901e0d7ba617511e4ed31d3043894d3':
  doc: Add section about AviSynth support

Conflicts:
	doc/general.texi

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:40:44 +01:00
Luca Barbato
b920c1d5ad configure: Support older version of openjpeg1
It should work best for debian stable and people not installing the .pc
file.

(cherry picked from commit aa80742539)
2014-03-14 21:28:23 -04:00
Stephen Hutchinson
2b9ee7d5b9 doc: Add section about AviSynth support
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit 908836e207)
2014-03-11 20:40:47 +01:00
Michael Niedermayer
f800cacada Merge remote-tracking branch 'qatar/release/10' into release/2.2
* qatar/release/10:
  lavf: always use av_free

See: 88c8e4afea
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 13:21:56 +01:00
Michael Niedermayer
5227eac5b0 Merge commit '6d56bc9a6d853a33fe53ab63db580c4facaba420' into release/2.2
* commit '6d56bc9a6d853a33fe53ab63db580c4facaba420':
  lavf: simplify ff_hevc_annexb2mp4_buf

Conflicts:
	libavformat/hevc.c
	libavformat/hevc.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 13:13:42 +01:00
Michael Niedermayer
bb40f8f5e2 Merge commit '2c5e1d0933facc20c6926a788cce05d3e6cad149' into release/2.2
* commit '2c5e1d0933facc20c6926a788cce05d3e6cad149':
  configure: Use the right pkgconf file for openjpeg

Conflicts:
	configure

No change as the incorrect code wasnt in ffmpegs configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 13:13:13 +01:00
Michael Niedermayer
ad8bf22086 Merge commit 'b37b83214ae3a462df1e8d3cc765ddbd2bfc73aa' into release/2.2
* commit 'b37b83214ae3a462df1e8d3cc765ddbd2bfc73aa':
  hevc: Use get_se_golomb_long

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 13:12:41 +01:00
Michael Niedermayer
7f8804296d Merge commit '6d7ab09788bdafffb3f3fc4f7feb262eb8cdf0b1' into release/2.2
* commit '6d7ab09788bdafffb3f3fc4f7feb262eb8cdf0b1':
  golomb: Add a get_se_golomb_long

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:16:27 +01:00
Michael Niedermayer
f67e75b5dc Merge commit '227cfc1f10a940c88ad3742ec805c07b6a5e7abb' into release/2.2
* commit '227cfc1f10a940c88ad3742ec805c07b6a5e7abb':
  vf_frei0r: adjust error messages

Conflicts:
	libavfilter/vf_frei0r.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:16:05 +01:00
Michael Niedermayer
35e63f35b0 Merge commit '416847d19593e87ee1704c26a9a638fd6b0d977c' into release/2.2
* commit '416847d19593e87ee1704c26a9a638fd6b0d977c':
  vf_frei0r: prevent a segfault when filter parameters are not set

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:15:51 +01:00
Michael Niedermayer
3bfb7a2537 Merge commit 'bd4ad1a1d52b8882df016826b8bdcf7b1009cb97' into release/2.2
* commit 'bd4ad1a1d52b8882df016826b8bdcf7b1009cb97':
  vf_frei0r: fix missing end of line character

Conflicts:
	libavfilter/vf_frei0r.c

No change as the token parsing change was not merged

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:15:21 +01:00
Michael Niedermayer
4a1e7a6fb7 Merge commit '6230de03aad9f26d5843afb913d196622e0b5b98' into release/2.2
* commit '6230de03aad9f26d5843afb913d196622e0b5b98':
  vf_frei0r: refactor library loading from env variable

Conflicts:
	configure
	libavfilter/vf_frei0r.c

Not merged, we use av_strtok() which leads to simpler code

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:14:41 +01:00
Michael Niedermayer
ff1e982205 Merge commit '45acc228a6d5f1e7d6c5ce6da63b293bd5eda57d' into release/2.2
* commit '45acc228a6d5f1e7d6c5ce6da63b293bd5eda57d':
  doc: fix a couple of typos in frame.h

Conflicts:
	libavutil/frame.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:09:13 +01:00
Michael Niedermayer
bb116e6ba3 Merge commit 'd37fac6dbbdddb76225aa691b83ffd9a0c7dae6b' into release/2.2
* commit 'd37fac6dbbdddb76225aa691b83ffd9a0c7dae6b':
  isom: lpcm in mov default to big endian
  movdec: handle 0x7fff langcode as macintosh per the specs

No change as these have been part of the branch previously

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:08:21 +01:00
Michael Niedermayer
ebe356bf1c avformat/hevc: fix mix of av_malloc() with free()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 88c8e4afea)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:06:13 +01:00
Michael Niedermayer
30099413ec Merge commit 'eabefe83f40a65d0f0c2a9a0521f6d96c3932545' into release/2.2
* commit 'eabefe83f40a65d0f0c2a9a0521f6d96c3932545':
  movenc: allow muxing HEVC in MODE_MP4.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:05:53 +01:00
Michael Niedermayer
186e0ff067 avformat/hevc: Make return codes consistent and more flexible
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5d5e2bd862)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:05:29 +01:00
Michael Niedermayer
2642ad9f55 Merge commit 'eaa79b79b25ac0ceaf44fe575a3ae724b87285b2' into release/2.2
* commit 'eaa79b79b25ac0ceaf44fe575a3ae724b87285b2':
  movenc: enable Annex B to MP4 conversion for HEVC tracks.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:04:54 +01:00
Michael Niedermayer
95ddd2227b avformat: fix hevcs use of golomb from avformat
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb403b2570)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:49:51 +01:00
Michael Niedermayer
3faebed6fa Merge commit 'c761379825ff0bf9dd191e244c4b2f7697fb2b3c' into release/2.2
* commit 'c761379825ff0bf9dd191e244c4b2f7697fb2b3c':
  movenc: write hvcC tag for HEVC.

Conflicts:
	libavformat/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:48:10 +01:00
Michael Niedermayer
3aee1fa5b6 Merge commit 'ea3309eba715e83027e8ece4a226e39a4bf2a6ce' into release/2.2
* commit 'ea3309eba715e83027e8ece4a226e39a4bf2a6ce':
  movenc: use 'hev1' tag for HEVC in MODE_MOV.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:47:51 +01:00
Michael Niedermayer
89a9c84ebb Merge commit '1c1e252cd1cbd5f59fe118c49f6d7207dbdfdbd4' into release/2.2
* commit '1c1e252cd1cbd5f59fe118c49f6d7207dbdfdbd4':
  movenc: Add a fallback fragmentation method for plain mp4 as well

Conflicts:
	libavformat/movenc.c

See: ef1aae6ea9
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:46:55 +01:00
Michael Niedermayer
0adde39e04 Merge commit 'ca2c9d6b9bfadb64e1502594fdf745a391699890' into release/2.2
* commit 'ca2c9d6b9bfadb64e1502594fdf745a391699890':
  hevc: make pps/sps ids unsigned where necessary

Conflicts:
	libavcodec/hevc.h
	libavcodec/hevc_ps.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:39:46 +01:00
Michael Niedermayer
03ae616b19 Merge commit 'fa6b99d351ed483766a875054676a56fd8459774' into release/2.2
* commit 'fa6b99d351ed483766a875054676a56fd8459774':
  hevc: Do not turn 32bit timebases into negative numbers

Conflicts:
	libavcodec/hevc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:39:31 +01:00
Michael Niedermayer
830c3058ff Merge commit 'd79cb6947e4a9c42ac20925dd920d3a0910d9a26' into release/2.2
* commit 'd79cb6947e4a9c42ac20925dd920d3a0910d9a26':
  hevc: use av_mallocz() for allocating tab_ipm

See: 26568c04a8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:29:06 +01:00
Michael Niedermayer
b12c5cbbb2 Merge commit '5aa4b29bbefc06fc2bbcb52af7a14393a1bcf504' into release/2.2
* commit '5aa4b29bbefc06fc2bbcb52af7a14393a1bcf504':
  hevc: Use get_bits_long() in decode_vui()

See: e15a57b67a
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:28:23 +01:00
Michael Niedermayer
82c96b5ad8 Merge commit 'e4cbd0d6e5a7b3b850d72f4f4ef0124b27dbdcbd' into release/2.2
* commit 'e4cbd0d6e5a7b3b850d72f4f4ef0124b27dbdcbd':
  changelog: Cleanups and prepare for v10_beta2

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:23:30 +01:00
Michael Niedermayer
3e4b957847 Merge commit '0ede7b534483c5c90f404a8f11f776d2f2da4e7e' into release/2.2
* commit '0ede7b534483c5c90f404a8f11f776d2f2da4e7e':
  float_dsp: fix errors in documentation

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:22:10 +01:00
Michael Niedermayer
cbabbe8220 Merge commit '5b933be089ab2657eb754ebf5b804ae43badf13d' into release/2.2
* commit '5b933be089ab2657eb754ebf5b804ae43badf13d':
  arm: vp3: remove incorrect const in ff_vp3_idct_dc_add_neon declaration

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:21:54 +01:00
Michael Niedermayer
80122a3af3 Merge commit 'f2693e98b449592ec0ed4979220814bf54e60a16' into release/2.2
* commit 'f2693e98b449592ec0ed4979220814bf54e60a16':
  build: Use pkg-config for openjpeg

Conflicts:
	configure

Not merged / merge just for metadata at request of carl

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:21:18 +01:00
Michael Niedermayer
a475755b3a Merge commit 'c3861e14ceace7ee69820091871173b4abcae311' into release/2.2
* commit 'c3861e14ceace7ee69820091871173b4abcae311':
  movenc: allow override of "writing application" tag

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:04:13 +01:00
Michael Niedermayer
66030e8133 Merge commit 'daa5a988e2ec8275ad8b724ea68f78306c271ae7' into release/2.2
* commit 'daa5a988e2ec8275ad8b724ea68f78306c271ae7':
  matroskaenc: allow override of "writing application" tag

Conflicts:
	libavformat/matroskaenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:03:30 +01:00
Michael Niedermayer
46f8d838b3 Merge commit 'db67b7c31b6fdd3747e2b5328945ad2091533698' into release/2.2
* commit 'db67b7c31b6fdd3747e2b5328945ad2091533698':
  rv10: Forward error from rv10_decode_packet

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:03:17 +01:00
Michael Niedermayer
bc3648d4b4 Merge commit 'a643a47d41f4924b66fce339e4b82aaee20825be' into release/2.2
* commit 'a643a47d41f4924b66fce339e4b82aaee20825be':
  fic: Properly handle skip frames

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:03:01 +01:00
Michael Niedermayer
27e6b4a3ff Merge commit '23af29e8825ac112877b9ac0572ef11e5f0539f2' into release/2.2
* commit '23af29e8825ac112877b9ac0572ef11e5f0539f2':
  arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:02:36 +01:00
Michael Niedermayer
b82860caa7 Merge commit '72a58c0772450993d375c6cf4b187a068f5bc765' into release/2.2
* commit '72a58c0772450993d375c6cf4b187a068f5bc765':
  Update default FATE URL for release/10

Conflicts:
	tests/Makefile

Merge for metadata only as we dont duplicate the fate samples per release branch.
Theres no need for that currently

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 10:49:37 +01:00
Michael Niedermayer
3d05625136 Merge commit 'd5254230068e196a2496618c0d89cdfbc41f7478' into release/2.2
* commit 'd5254230068e196a2496618c0d89cdfbc41f7478':
  Revert "Add libx265 encoder"

Conflicts:
	Changelog
	LICENSE
	configure
	doc/general.texi
	libavcodec/allcodecs.c
	libavcodec/libx265.c

Not merged, release branches should only contain bugfixes
a feature removial like this has to be discussed on ffmpeg-devel first

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 10:46:52 +01:00
Michael Niedermayer
ddd3301bad Merge commit '4b476e6aa4b830f919cf3c67ba2caa039ff285b9' into release/2.2
* commit '4b476e6aa4b830f919cf3c67ba2caa039ff285b9':
  configure: enable PIC on s390(x)

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 10:32:26 +01:00
Michael Niedermayer
123981930f Merge commit 'a1ab3300c83a16c2d5f5d29c51393668b9d92667' into release/2.2
* commit 'a1ab3300c83a16c2d5f5d29c51393668b9d92667':
  arm: hpeldsp: prevent overreads in armv6 asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 10:31:47 +01:00
Lukasz Marek
3171e2360a Revert "lavu/buffer: add release function"
This reverts commit 3144440004.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 09:06:51 +01:00
Michael Niedermayer
3533a850e7 lavf: always use av_free
Signed-off-by: Tim Walker <tdskywalker@gmail.com>
(cherry picked from commit 77e9123fe5)
2014-03-10 19:53:51 -04:00
Tim Walker
6d56bc9a6d lavf: simplify ff_hevc_annexb2mp4_buf
Use ff_hevc_annexb2mp4 instead of duplicating
its functionality, and update the documentation
to match the new behavior.

(cherry picked from commit 34bbc81de8)
2014-03-10 19:53:44 -04:00
Luca Barbato
2c5e1d0933 configure: Use the right pkgconf file for openjpeg
The current release of version 1 uses libopenjpeg1.

(cherry picked from commit 4a8562394b)
2014-03-10 19:53:27 -04:00
Luca Barbato
b37b83214a hevc: Use get_se_golomb_long
Do not use inline functions that refer to tables present in other
libraries.

(cherry picked from commit ee17be3fdd)
2014-03-10 19:53:26 -04:00
Luca Barbato
6d7ab09788 golomb: Add a get_se_golomb_long
Useful in libavformat mostly.

(cherry picked from commit 5eacbb5328)
2014-03-10 19:53:04 -04:00
Vittorio Giovara
227cfc1f10 vf_frei0r: adjust error messages
(cherry picked from commit 8accddeb58)
2014-03-09 17:54:01 -04:00
Vittorio Giovara
416847d195 vf_frei0r: prevent a segfault when filter parameters are not set
(cherry picked from commit 4e0be9c86f)
2014-03-09 17:53:47 -04:00
Vittorio Giovara
bd4ad1a1d5 vf_frei0r: fix missing end of line character
Error introduced in 61b323ce7c.

(cherry picked from commit 4c41a7a179)
2014-03-09 17:53:33 -04:00
Vittorio Giovara
6230de03aa vf_frei0r: refactor library loading from env variable
strtok_r is not needed any more, so remove it from configure.

(cherry picked from commit 61b323ce7c)
2014-03-09 17:53:24 -04:00
Janne Grunau
45acc228a6 doc: fix a couple of typos in frame.h
(cherry picked from commit a18ef7a76c)
2014-03-09 17:53:09 -04:00
Mark Himsley
d37fac6dbb isom: lpcm in mov default to big endian
It is my understanding that "Unless otherwise stated, all data in a
QuickTime movie is stored in big-endian byte ordering" [1] in MOV files.

I have a couple of thousand files, which technically are invalid because
their sound sample description element 4CC is 'lpcm' but its version is
0 - and "Version 0 supports only uncompressed audio in raw ('raw ') or
twos-complement ('twos') format" [2]

Because isom.c only contains a mapping for 4CC 'lpcm' to
AV_CODEC_ID_PCM_S16LE, these files have their audio decoded as LE when
it is actually BE.

This commit adds AV_CODEC_ID_PCM_S16BE as the first match for 4CC 'lpcm'.

[1]
https://developer.apple.com/library/mac/documentation/quicktime/QTFF/qtff.pdf
page 21
[2]
https://developer.apple.com/library/mac/documentation/quicktime/QTFF/qtff.pdf
page 178

Reviewed-by: Yusuke Nakamura <muken.the.vfrmaniac@gmail.com>
(cherry picked from commit 360022bd3b)
2014-03-09 17:50:54 -04:00
Baptiste Coudurier
7940306a47 movdec: handle 0x7fff langcode as macintosh per the specs
The correct point that seperates ISO and MAC language codes is 0x400
according to the current QT spec. Old QT specs did not list where this
seperation is but apparently only defined the meaning of the first 137.

(cherry picked from commit 9e71cc81f3)
2014-03-09 17:50:41 -04:00
Tim Walker
eabefe83f4 movenc: allow muxing HEVC in MODE_MP4.
(cherry picked from commit 4f3db5d341)
2014-03-09 16:58:28 -04:00
Tim Walker
eaa79b79b2 movenc: enable Annex B to MP4 conversion for HEVC tracks.
(cherry picked from commit b6c61fb83e)
2014-03-09 16:58:26 -04:00
Tim Walker
c761379825 movenc: write hvcC tag for HEVC.
(cherry picked from commit 20b40a597c)
2014-03-09 16:58:21 -04:00
Tim Walker
ea3309eba7 movenc: use 'hev1' tag for HEVC in MODE_MOV.
'hvc1' requires that parameter set NAL units be
present only in the samples entry, but not in the
samples themselves, requiring that additional
parameter sets, if present, be filtered out of the
samples and placed in new, additional sample entries
if they override or otherwise conflict with the
parameter sets present in the first sample entry.
We do not have any way of doing this at present, so
the files we produce can only comply with the
restrictions set for the 'hev1' sample entry name in
ISO/IEC 14496-15.

(cherry picked from commit 1d9014f0b0)
2014-03-09 16:58:15 -04:00
Martin Storsjö
1c1e252cd1 movenc: Add a fallback fragmentation method for plain mp4 as well
Previously the default fragmentation method was only enabled
if writing an ISM file.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 1e142d5b48)
2014-03-09 16:57:53 -04:00
Vittorio Giovara
ca2c9d6b9b hevc: make pps/sps ids unsigned where necessary
Fixes integer overflow and out of array accesses.
Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind

(cherry picked from commit 4d33873c29)
2014-03-09 14:55:38 -04:00
Michael Niedermayer
fa6b99d351 hevc: Do not turn 32bit timebases into negative numbers
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit ed06e5d92b)
2014-03-09 14:55:36 -04:00
Michael Niedermayer
d79cb6947e hevc: use av_mallocz() for allocating tab_ipm
Fixes use of uninitialized memory and out of stack array read.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

(cherry picked from commit 6cc94e9719)
2014-03-09 14:55:35 -04:00
Michael Niedermayer
5aa4b29bbe hevc: Use get_bits_long() in decode_vui()
Fix assertion failure.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

(cherry picked from commit 920c01adce)
2014-03-09 14:55:34 -04:00
Reinhard Tartler
e4cbd0d6e5 changelog: Cleanups and prepare for v10_beta2 2014-03-08 20:50:36 -05:00
Janne Grunau
0ede7b5344 float_dsp: fix errors in documentation
(cherry picked from commit 74cc901905)
2014-03-08 19:36:20 -05:00
Janne Grunau
5b933be089 arm: vp3: remove incorrect const in ff_vp3_idct_dc_add_neon declaration
Was missed in aeaf268e52 when integrating
clear_blocks into the idct.

(cherry picked from commit 4506a854a4)
2014-03-08 19:36:02 -05:00
Pierre Lejeune
f2693e98b4 build: Use pkg-config for openjpeg
Bug-Id: 387
CC: libav-stable@libav.org
(cherry picked from commit 0e0cefb222)
2014-03-08 19:34:44 -05:00
John Stebbins
c3861e14ce movenc: allow override of "writing application" tag
Signed-off-by: Tim Walker <tdskywalker@gmail.com>

CC: libav-stable@libav.org
(cherry picked from commit 565e0c6d86)
2014-03-08 19:34:42 -05:00
John Stebbins
daa5a988e2 matroskaenc: allow override of "writing application" tag
Signed-off-by: Tim Walker <tdskywalker@gmail.com>

CC: libav-stable@libav.org
(cherry picked from commit 0092c1dd8d)
2014-03-08 19:34:39 -05:00
Keiji Costantini
db67b7c31b rv10: Forward error from rv10_decode_packet
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit b4d372e091)
2014-03-08 19:34:29 -05:00
Derek Buitenhuis
a643a47d41 fic: Properly handle skip frames
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
(cherry picked from commit f87a6e500b)
2014-03-08 19:33:41 -05:00
Janne Grunau
23af29e882 arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6
The overread avoidance fix in cbddee1cca
broke the computation for the last row since it prevented the safe
reading from the height+1-th row.
2014-03-08 21:48:21 +01:00
Nicolas George
7d995cd1b8 lavfi/af_atempo: clear references before returning error.
Once the frame has been given to ff_filter_frame(), it can
no longer be used, even on error.

Fix trac ticket #3430.
(cherry picked from commit bc6901c949)
2014-03-08 15:17:14 +01:00
Reinhard Tartler
72a58c0772 Update default FATE URL for release/10 2014-03-07 08:32:55 -05:00
Reinhard Tartler
d525423006 Revert "Add libx265 encoder"
cf. the discussion following
https://lists.libav.org/pipermail/libav-devel/2014-March/056894.html

This reverts commit 50ea93158d.

Conflicts:
	doc/general.texi
	libavcodec/version.h
2014-03-07 08:32:55 -05:00
Reinhard Tartler
4b476e6aa4 configure: enable PIC on s390(x)
The s390 architecture requires shared libraries to be built in PIC mode.
Otherwise applications will get wrong relocations at run-time, leading
to confusing segmentation faults.

CC: libav-stable@libav.org
(cherry picked from commit 5ddc9f5052)
2014-03-07 08:32:55 -05:00
Michael Niedermayer
124c78fd44 avformat/oggparsevorbis: dont use invalid granules
Fixes Ticket3437

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 12b97dd375)
2014-03-06 09:31:49 +01:00
Janne Grunau
a1ab3300c8 arm: hpeldsp: prevent overreads in armv6 asm
Based on a patch by Russel King <rmk+libav@arm.linux.org.uk>

Bug-Id: 646
CC: libav-stable@libav.org
2014-03-05 16:21:52 +01:00
Michael Niedermayer
1af235f6b3 Merge remote-tracking branch 'qatar/release/10' into release/2.2
* qatar/release/10:
  ituh263: reject b-frame with pp_time = 0
  af_compand: replace strtok_r() with av_get_token()
  latm: Always reconfigure if no extradata was set previously
  af_compand: add a dependency on strtok_r
  lavfi: add compand audio filter

Conflicts:
	Changelog
	doc/filters.texi
	libavfilter/Makefile
	libavfilter/af_compand.c
	libavfilter/allfilters.c
	libavfilter/version.h

All changes are already in our 2.2 branch, this is just for metadata

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 23:39:42 +01:00
Michael Niedermayer
82031e41f8 Merge commit '596d3e20ae69a278d562eea08f5e8c0ae5a5bfc4' into release/2.2
* commit '596d3e20ae69a278d562eea08f5e8c0ae5a5bfc4':
  parser: cosmetics: Drop some unnecessary parentheses
  parser: K&R formatting cosmetics
  parser: Remove commented-out cruft
  doc: name correct header
  af_volume: preserve frame properties

Conflicts:
	doc/APIchanges
	libavcodec/parser.c
	libavfilter/af_volume.c

All changes are already in our 2.2 branch, this is just for metadata

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 23:30:47 +01:00
Michael Niedermayer
222e7549a7 Merge commit '7933039ade01b39638ec3d9e638b6ae06ee84984' into release/2.2
* commit '7933039ade01b39638ec3d9e638b6ae06ee84984':
  af_resample: preserve frame properties
  avconv: Do not divide by zero
  dca: replace some memcpy by AV_COPY128
  h264: avoid undefined behavior in chroma motion compensation
  x86: dsputil: Use correct file name as multiple inclusion guard

Conflicts:
	ffmpeg.c

All changes are already in our 2.2 branch, this is just for metadata

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 23:16:15 +01:00
Michael Niedermayer
eb2244ece9 Merge commit '4015829accc2382393d42d62654eb96d896d1326' into release/2.2
* commit '4015829accc2382393d42d62654eb96d896d1326':
  bit_depth_template: Use file name as multiple inclusion guard
  svq3: Adjust #endif comment
  hevc: Mention the missing SPS in the error message
  doc: Name the MOV muxer as it should be called
  doc: Sort the muxer documentation

Conflicts:
	doc/muxers.texi

All changes are already in our 2.2 branch, this is just for metadata

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 23:03:44 +01:00
Michael Niedermayer
b967c10029 Merge commit '39dc4a6bb34baf833ce1e5eabad7d0dbf933237d' into release/2.2
* commit '39dc4a6bb34baf833ce1e5eabad7d0dbf933237d':
  x86: dca: Add missing multiple inclusion guards
  gitignore: Add all examples below doc/examples
  arm: Mark the stack as non-executable
  doxygen: Replace @parblock syntax with manual linebreaks
  doxygen: Add a number of missing function parameter descriptions

Conflicts:
	.gitignore
	libavformat/avformat.h

All changes are already in our 2.2 branch, this is just for metadata

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 22:53:25 +01:00
Michael Niedermayer
7ff4cd2acc Merge commit 'a6a2d8eb8f125a2edb512a7a47df33dbd70d6b35' into release/2.2
* commit 'a6a2d8eb8f125a2edb512a7a47df33dbd70d6b35':
  qt-faststart: Add a note about the -movflags +faststart feature
  qt-faststart: Avoid unintentionally sign extending BE_32
  qt-faststart: Check offset_count before reading from the moov_atom buffer
  qt-faststart: Check the ftello() return codes
  qt-faststart: Fix the signedness of variables keeping the ftello return values
  qt-faststart: Check fseeko() return codes
  qt-faststart: Simplify code by using a MIN() macro
  qt-faststart: Increase the copy buffer size to 64 KB

Conflicts:
	tools/qt-faststart.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 22:42:25 +01:00
Michael Niedermayer
c4149c4d54 Merge commit '1d1df82093fdacb2cbc443c70c80f8f801002d28' into release/2.2
* commit '1d1df82093fdacb2cbc443c70c80f8f801002d28':
  pthread_frame: flush all threads on flush, not just the first one

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 22:30:54 +01:00
Michael Niedermayer
8ad2f45964 Merge commit 'de187e3e9ec4803575deb1c293ccad84d2a88da8' into release/2.2
* commit 'de187e3e9ec4803575deb1c293ccad84d2a88da8':
  h264: Fix a typo from the previous commit
  h264: Lower bound check for slice offsets
  hevc: Always consider VLC NALU type mismatch fatal
  Prepare for 10_beta2 Release
  build: The MPEG-4 video parser depends on h263dsp

Conflicts:
	RELEASE
	configure

All changes are already in our 2.2 branch, this is just for metadata

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 22:22:15 +01:00
Keiji Costantini
5df52b0131 ituh263: reject b-frame with pp_time = 0
Avoid a division by 0 in ff_mpeg4_set_one_direct_mv.

Sample-Id: 00000168-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
(cherry picked from commit 9514440337)
2014-03-02 11:42:38 -05:00
Diego Biurrun
596d3e20ae parser: cosmetics: Drop some unnecessary parentheses
(cherry picked from commit 4ec336484d)
2014-03-02 11:42:38 -05:00
Anton Khirnov
00d5ff6431 af_compand: replace strtok_r() with av_get_token()
(cherry picked from commit bc6461c286)
2014-03-02 11:42:38 -05:00
Luca Barbato
437179e9c8 parser: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit a1c699659d)
2014-03-02 11:42:38 -05:00
Hendrik Leppkes
031d3b66c2 latm: Always reconfigure if no extradata was set previously
AAC LOAS can have new audio config objects in the stream itself.

Make sure the decoder reconfigures itself when the first one arrives
midstream.

Bug-Id: 644
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 3aca10bf76)
2014-03-02 11:42:38 -05:00
Diego Biurrun
b76871d870 parser: Remove commented-out cruft
(cherry picked from commit ed61f3ca8a)
2014-03-02 11:42:38 -05:00
Anton Khirnov
15ae305007 af_compand: add a dependency on strtok_r
(cherry picked from commit 291e49d4e7)
2014-03-02 11:42:38 -05:00
Vittorio Giovara
3c72204ae0 doc: name correct header
(cherry picked from commit 48d1ed9c83)
2014-03-02 11:42:38 -05:00
Andrew Kelley
ba21499648 lavfi: add compand audio filter
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 738f83582a)

Conflicts:
	libavfilter/version.h
2014-03-02 11:42:38 -05:00
Anton Khirnov
7933039ade af_resample: preserve frame properties
(cherry picked from commit dcc7e4bf1d)
2014-03-02 11:42:37 -05:00
Diego Biurrun
4015829acc bit_depth_template: Use file name as multiple inclusion guard
(cherry picked from commit ba42c85247)
2014-03-02 11:42:37 -05:00
Diego Biurrun
39dc4a6bb3 x86: dca: Add missing multiple inclusion guards
(cherry picked from commit b23bc95920)
2014-03-02 11:42:37 -05:00
Lou Logan
a6a2d8eb8f qt-faststart: Add a note about the -movflags +faststart feature
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 700687ebe0)
2014-03-02 11:42:37 -05:00
Anton Khirnov
58556826a8 af_volume: preserve frame properties
(cherry picked from commit 39c2880eea)
2014-03-02 11:42:37 -05:00
Luca Barbato
bc2c9a479a avconv: Do not divide by zero
(cherry picked from commit 5c79d2e12d)
2014-03-02 11:42:37 -05:00
Diego Biurrun
9cc22be032 svq3: Adjust #endif comment
(cherry picked from commit 61e7c7f27b)
2014-03-02 11:42:37 -05:00
Diego Biurrun
33e1bca651 gitignore: Add all examples below doc/examples
(cherry picked from commit 294a51e18a)
2014-03-02 11:42:37 -05:00
Martin Storsjö
9841617b7f qt-faststart: Avoid unintentionally sign extending BE_32
Without this cast, the BE_32() expression is sign extended when
assigned to an uint64_t, since the uint8_t|uint8_t expression
is promoted to an int.

Also avoid undefined behaviour when left shifting an uint8_t
by 24 by casting it to an uint32_t explicitly before shifting.

Based on a patch by Michael Niedermayer.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit ea7f79f937)
2014-03-02 11:42:37 -05:00
Christophe Gisquet
2897481f64 dca: replace some memcpy by AV_COPY128
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit ef010f08ae)
2014-03-02 11:42:37 -05:00
Luca Barbato
646c564de5 hevc: Mention the missing SPS in the error message
(cherry picked from commit 175e506332)
2014-03-02 11:42:37 -05:00
Martin Storsjö
cd6281abef arm: Mark the stack as non-executable
If linking in an object file without this attribute set, the
linker will assume that an executable stack might be needed.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 543156d751)
2014-03-02 11:42:37 -05:00
Janne Grunau
697be8173b h264: avoid undefined behavior in chroma motion compensation
Makes fate-h264 pass under valgrind --undef-value-errors=yes with
-cpuflags none. {avg,put}_h264_chroma_mc8_8 approximately 5% faster,
{avg,put}_h264_chroma_mc4_8 2% faster both on x86 and arm.

(cherry picked from commit 982b596ea6)
2014-03-02 11:42:37 -05:00
Luca Barbato
1853d8bb7a doc: Name the MOV muxer as it should be called
The section name is the muxer, not the format.

(cherry picked from commit 93632a70f9)
2014-03-02 11:42:37 -05:00
Diego Biurrun
1779cd7695 doxygen: Replace @parblock syntax with manual linebreaks
@parblock is only supported in very recent Doxygen versions.

(cherry picked from commit 2f2b2efd31)
2014-03-02 11:42:37 -05:00
Diego Biurrun
bb4820727f x86: dsputil: Use correct file name as multiple inclusion guard
(cherry picked from commit 017a06a9ee)
2014-03-02 11:42:37 -05:00
Luca Barbato
affc7687d3 doc: Sort the muxer documentation
Keep the sections alphabetically sorted.

(cherry picked from commit a7b3216cbd)
2014-03-02 11:42:37 -05:00
Diego Biurrun
3569470693 doxygen: Add a number of missing function parameter descriptions
(cherry picked from commit 4d7ab5cfeb)
2014-03-02 11:42:37 -05:00
Anton Khirnov
1d1df82093 pthread_frame: flush all threads on flush, not just the first one
avcodec_flush_buffers() must release all internally held references
according to its documentation, for which all the threads need to be
flushed.

CC:libav-stable@libav.org
Bug-Id: vlc/9665
(cherry picked from commit d1f9563d50)
2014-03-02 11:42:36 -05:00
Luca Barbato
de187e3e9e h264: Fix a typo from the previous commit
f777504f64 changed a - in +

CC: libav-stable@libav.org
(cherry picked from commit d922c5a5fb)
2014-03-02 11:42:36 -05:00
Michael Niedermayer
7754d48381 qt-faststart: Check offset_count before reading from the moov_atom buffer
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit bb95334c34)
2014-03-02 11:42:36 -05:00
Vittorio Giovara
63169474b3 h264: Lower bound check for slice offsets
And use the value from the specification.

Sample-Id: 00000451-google
Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit f777504f64)
2014-03-02 11:42:36 -05:00
Michael Niedermayer
b3f106cb1f qt-faststart: Check the ftello() return codes
This silences a warning in the coverity static analyzer.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 6384885425)
2014-03-02 11:42:36 -05:00
Luca Barbato
9b6ccf0f24 hevc: Always consider VLC NALU type mismatch fatal
Sample-Id: 00001667-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 521726ff57)
2014-03-02 11:42:36 -05:00
Michael Niedermayer
298d66c8de qt-faststart: Fix the signedness of variables keeping the ftello return values
These variables are assigned the return values of ftello, which
returns an off_t, which is a signed type. On errors, ftello returns
-1, thus make sure this error return value can be stored properly.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 03c2a66fcf)
2014-03-02 11:42:36 -05:00
Reinhard Tartler
4be1b68d52 Prepare for 10_beta2 Release 2014-03-02 11:42:36 -05:00
Michael Niedermayer
92edc13d69 qt-faststart: Check fseeko() return codes
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 5612244351)
2014-03-02 11:42:36 -05:00
Michael Niedermayer
c9f015f1c6 qt-faststart: Simplify code by using a MIN() macro
qt-faststart doesn't use the normal libav headers at all since
it's supposed to be a completely standalone tool, so we implement
the macro locally in this file.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit ea15a9a5d8)
2014-03-02 11:42:36 -05:00
Martin Storsjö
db6b2ca0b3 qt-faststart: Increase the copy buffer size to 64 KB
Copying data in chunks of 1 KB is a little wasteful.

64 KB should still easily fit on the stack, so there's no need
to allocate it dynamically.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 3cbc7ef3d6)
2014-03-02 11:42:36 -05:00
Michael Niedermayer
3503ec8461 Changelog: remove <next>
Found-by: Timothy
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-01 18:26:04 +01:00
Michael Niedermayer
ecc5e42d92 Update for 2.2-rc1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-01 04:03:08 +01:00
Diego Biurrun
f87ce262f6 build: The MPEG-4 video parser depends on h263dsp
The dependency is indirect through the h263/mpegvideo code.
CC: libav-stable@libav.org
(cherry picked from commit 192ccc5034)
2014-02-20 12:06:39 +01:00
407 changed files with 5883 additions and 1933 deletions

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
*.pnm -diff -text

View File

@@ -1,11 +1,24 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version <next>
version 2.2.7
- snow: fix null pointer dereference
- iff: fix out of array access
- svq1dec: fix input data corruption
- proresenc_ks: check buffer size
version 2.2.6
- fix infinite loop in dvbsub parser
- fix some interlaced MPEG-2 videos
- fix decoding issues in dv (Ticket2340, 2341)
- fix v4l2 and v4l2enc crashes
- fix theoretical librtmp crash
- fix theoretical eamad crash
- support dimension change in g2meet
version 2.2:
- HNM version 4 demuxer and video decoder
- Live HDS muxer
- setsar/setdar filters now support variables in ratio expressions
@@ -31,6 +44,7 @@ version 2.2:
- Support DNx444
- libx265 encoder
- dejudder filter
- Autodetect VDA like all other hardware accelerations
version 2.1:

View File

@@ -33,6 +33,7 @@ Specifically, the GPL parts of FFmpeg are
- vf_geq.c
- vf_histeq.c
- vf_hqdn3d.c
- vf_interlace.c
- vf_kerndeint.c
- vf_mcdeint.c
- vf_mp.c

View File

@@ -14,7 +14,6 @@ patches and related discussions.
Project Leader
==============
Michael Niedermayer
final design decisions

View File

@@ -106,7 +106,7 @@ endef
$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(PROGSSUF)$(EXESUF)=))))
ffprobe.o cmdutils.o : libavutil/ffversion.h
ffprobe.o cmdutils.o libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
$(CP) $< $@

View File

@@ -1 +1 @@
2.1.git
2.2.16

View File

@@ -1803,7 +1803,7 @@ int read_yesno(void)
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
{
int ret;
int64_t ret;
FILE *f = av_fopen_utf8(filename, "rb");
if (!f) {

View File

@@ -22,6 +22,7 @@
#include "libavutil/time.h"
#include "libavutil/log.h"
#include "libavutil/opencl.h"
#include "libavutil/avstring.h"
#include "cmdutils.h"
typedef struct {
@@ -224,7 +225,7 @@ int opt_opencl_bench(void *optctx, const char *opt, const char *arg)
av_log(NULL, AV_LOG_ERROR, "No OpenCL device detected!\n");
return AVERROR(EINVAL);
}
if (!(devices = av_malloc(sizeof(OpenCLDeviceBenchmark) * nb_devices))) {
if (!(devices = av_malloc_array(nb_devices, sizeof(OpenCLDeviceBenchmark)))) {
av_log(NULL, AV_LOG_ERROR, "Could not allocate buffer\n");
return AVERROR(ENOMEM);
}
@@ -238,7 +239,8 @@ int opt_opencl_bench(void *optctx, const char *opt, const char *arg)
devices[count].platform_idx = i;
devices[count].device_idx = j;
devices[count].runtime = score;
strcpy(devices[count].device_name, device_node->device_name);
av_strlcpy(devices[count].device_name, device_node->device_name,
sizeof(devices[count].device_name));
count++;
}
}

View File

@@ -13,7 +13,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA, or visit
// http://www.gnu.org/copyleft/gpl.html .
//
// As a special exception, I give you permission to link to the

View File

@@ -13,7 +13,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA, or visit
// http://www.gnu.org/copyleft/gpl.html .
//
// As a special exception, I give you permission to link to the

26
configure vendored
View File

@@ -149,7 +149,7 @@ Component options:
Hardware accelerators:
--disable-dxva2 disable DXVA2 code [autodetect]
--disable-vaapi disable VAAPI code [autodetect]
--enable-vda enable VDA code
--disable-vda disable VDA code [autodetect]
--disable-vdpau disable VDPAU code [autodetect]
Individual component options:
@@ -1539,6 +1539,7 @@ HAVE_LIST="
alsa_asoundlib_h
altivec_h
arpa_inet_h
as_object_arch
asm_mod_q
asm_types_h
atomic_cas_ptr
@@ -2504,7 +2505,7 @@ enable static
enable swscale_alpha
# Enable hwaccels by default.
enable dxva2 vaapi vdpau xvmc
enable dxva2 vaapi vda vdpau xvmc
# build settings
SHFLAGS='-shared -Wl,-soname,$$(@F)'
@@ -3324,6 +3325,9 @@ if test -n "$sysroot"; then
gcc|llvm_gcc|clang)
add_cppflags --sysroot="$sysroot"
add_ldflags --sysroot="$sysroot"
# On Darwin --sysroot may be ignored, -isysroot always affects headers and linking
add_cppflags -isysroot "$sysroot"
add_ldflags -isysroot "$sysroot"
;;
tms470)
add_cppflags -I"$sysinclude"
@@ -3383,7 +3387,7 @@ case "$arch" in
tilegx|tile-gx)
arch="tilegx"
;;
i[3-6]86|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
arch="x86"
;;
esac
@@ -3581,6 +3585,7 @@ elif enabled x86; then
case $cpu in
i[345]86|pentium)
cpuflags="-march=$cpu"
disable i686
disable mmx
;;
# targets that do NOT support nopl and conditional mov (cmov)
@@ -3661,6 +3666,10 @@ case "$arch" in
check_64bit ppc ppc64 'sizeof(void *) > 4'
spic=$shared
;;
s390)
check_64bit s390 s390x 'sizeof(void *) > 4'
spic=$shared
;;
sparc)
check_64bit sparc sparc64 'sizeof(void *) > 4'
spic=$shared
@@ -4147,6 +4156,11 @@ EOF
check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
# llvm's integrated assembler supports .object_arch from llvm 3.5
[ "$objformat" = elf ] && check_as <<EOF && enable as_object_arch
.object_arch armv4
EOF
[ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
elif enabled mips; then
@@ -4280,6 +4294,7 @@ EOF
fi
check_ldflags -Wl,--as-needed
check_ldflags -Wl,-z,noexecstack
if check_func dlopen; then
ldl=
@@ -4632,7 +4647,7 @@ enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
if enabled libcdio; then
check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
die "ERROR: libcdio-paranoia not found"
die "ERROR: No usable libcdio/cdparanoia found"
fi
check_lib X11/Xlib.h XOpenDisplay -lX11 && enable xlib
@@ -5168,7 +5183,7 @@ cat > $TMPH <<EOF
#define FFMPEG_CONFIG_H
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
#define FFMPEG_LICENSE "$(c_escape $license)"
#define CONFIG_THIS_YEAR 2014
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
@@ -5195,6 +5210,7 @@ enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
mkdir -p doc
mkdir -p tests
echo "@c auto-generated by configure" > doc/config.texi
print_config ARCH_ "$config_files" $ARCH_LIST

View File

@@ -15,6 +15,9 @@ libavutil: 2012-10-22
API changes, most recent first:
2014-03-18 - e9c8a9a - lsws 2.5.102
Make gray16 full-scale.
2014-xx-xx - xxxxxxx - lavu 53.05.0 - frame.h
Add av_frame_copy() for copying the frame data.

View File

@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER =
PROJECT_NUMBER = 2.2.16
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
# in the documentation. The maximum height of the logo should not exceed 55

View File

@@ -62,7 +62,7 @@ AC-3 audio decoder.
This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as
the undocumented RealAudio 3 (a.k.a. dnet).
@subsubsection AC-3 Decoder Options
@subsection AC-3 Decoder Options
@table @option

View File

@@ -296,7 +296,7 @@ teletext packet PTS and DTS values untouched.
Raw video demuxer.
This demuxer allows to read raw video data. Since there is no header
This demuxer allows one to read raw video data. Since there is no header
specifying the assumed video parameters, the user must specify them
in order to be able to decode the data correctly.

View File

@@ -807,7 +807,7 @@ while producing the worst quality.
@item reservoir
Enable use of bit reservoir when set to 1. Default value is 1. LAME
has this enabled by default, but can be overriden by use
has this enabled by default, but can be overridden by use
@option{--nores} option.
@item joint_stereo (@emph{-m j})
@@ -1271,7 +1271,7 @@ Requires the presence of the libtheora headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libtheora}.
For more informations about the libtheora project see
For more information about the libtheora project see
@url{http://www.theora.org/}.
@subsection Options
@@ -1525,7 +1525,7 @@ for detail retention (adaptive quantization, psy-RD, psy-trellis).
Many libx264 encoder options are mapped to FFmpeg global codec
options, while unique encoder options are provided through private
options. Additionally the @option{x264opts} and @option{x264-params}
private options allows to pass a list of key=value tuples as accepted
private options allows one to pass a list of key=value tuples as accepted
by the libx264 @code{x264_param_parse} function.
The x264 project website is at
@@ -1853,7 +1853,7 @@ Override the x264 configuration using a :-separated list of key=value
parameters.
This option is functionally the same as the @option{x264opts}, but is
duplicated for compability with the Libav fork.
duplicated for compatibility with the Libav fork.
For example to specify libx264 encoding options with @command{ffmpeg}:
@example
@@ -2047,7 +2047,7 @@ Set physical density of pixels, in dots per meter, unset by default
Apple ProRes encoder.
FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
The used encoder can be choosen with the @code{-vcodec} option.
The used encoder can be chosen with the @code{-vcodec} option.
@subsection Private Options for prores-ks

View File

@@ -119,8 +119,10 @@ int main(int argc, char *argv[])
end:
avformat_close_input(&fmt_ctx);
/* note: the internal buffer could have changed, and be != avio_ctx_buffer */
av_freep(&avio_ctx->buffer);
av_freep(&avio_ctx);
if (avio_ctx) {
av_freep(&avio_ctx->buffer);
av_freep(&avio_ctx);
}
av_file_unmap(buffer, buffer_size);
if (ret < 0) {

View File

@@ -298,7 +298,7 @@ FFmpeg has a @url{http://ffmpeg.org/ffmpeg-protocols.html#concat,
@code{concat}} protocol designed specifically for that, with examples in the
documentation.
A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to concatenate
A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow one to concatenate
video by merely concatenating the files containing them.
Hence you may concatenate your multimedia files by first transcoding them to

View File

@@ -14,7 +14,7 @@
The FFmpeg resampler provides a high-level interface to the
libswresample library audio resampling utilities. In particular it
allows to perform audio resampling, audio channel layout rematrixing,
allows one to perform audio resampling, audio channel layout rematrixing,
and convert audio format and packing layout.
@c man end DESCRIPTION

View File

@@ -13,7 +13,7 @@
@c man begin DESCRIPTION
The FFmpeg rescaler provides a high-level interface to the libswscale
library image conversion utilities. In particular it allows to perform
library image conversion utilities. In particular it allows one to perform
image rescaling and pixel format conversion.
@c man end DESCRIPTION

View File

@@ -1405,11 +1405,11 @@ ffmpeg -f image2 -pattern_type glob -i 'foo-*.jpeg' -r 12 -s WxH foo.avi
You can put many streams of the same type in the output:
@example
ffmpeg -i test1.avi -i test2.avi -map 0:3 -map 0:2 -map 0:1 -map 0:0 -c copy test12.nut
ffmpeg -i test1.avi -i test2.avi -map 1:1 -map 1:0 -map 0:1 -map 0:0 -c copy -y test12.nut
@end example
The resulting output file @file{test12.avi} will contain first four streams from
the input file in reverse order.
The resulting output file @file{test12.nut} will contain the first four streams
from the input files in reverse order.
@item
To force CBR video output:

View File

@@ -71,7 +71,7 @@ the HTTP server (configured through the @option{Port} option), and
configuration file.
Each feed is associated to a file which is stored on disk. This stored
file is used to allow to send pre-recorded data to a player as fast as
file is used to send pre-recorded data to a player as fast as
possible when new content is added in real-time to the stream.
A "live-stream" or "stream" is a resource published by
@@ -111,7 +111,7 @@ must be configured in the stream configuration. They are sent to
the @command{ffmpeg} encoders.
The @command{ffmpeg} @option{override_ffserver} commandline option
allows to override the encoding parameters set by the server.
allows one to override the encoding parameters set by the server.
Multiple streams can be connected to the same feed.

View File

@@ -225,10 +225,14 @@ Possible flags for this option are:
@item sse4.1
@item sse4.2
@item avx
@item avx2
@item xop
@item fma3
@item fma4
@item 3dnow
@item 3dnowext
@item bmi1
@item bmi2
@item cmov
@end table
@item ARM
@@ -240,6 +244,11 @@ Possible flags for this option are:
@item vfpv3
@item neon
@end table
@item AArch64
@table @samp
@item vfp
@item neon
@end table
@item PowerPC
@table @samp
@item altivec

View File

@@ -172,7 +172,7 @@ terminated when the next special character (belonging to the set
The name and arguments of the filter are optionally preceded and
followed by a list of link labels.
A link label allows to name a link and associate it to a filter output
A link label allows one to name a link and associate it to a filter output
or input pad. The preceding labels @var{in_link_1}
... @var{in_link_N}, are associated to the filter input pads,
the following labels @var{out_link_1} ... @var{out_link_M}, are
@@ -491,7 +491,7 @@ aeval=val(ch)/2:c=same
@item
Invert phase of the second channel:
@example
eval=val(0)|-val(1)
aeval=val(0)|-val(1)
@end example
@end itemize
@@ -3143,7 +3143,7 @@ Set number overlapping pixels for each block. Each block is of size
@code{16x16}. Since the filter can be slow, you may want to reduce this value,
at the cost of a less effective filter and the risk of various artefacts.
If the overlapping value doesn't allow to process the whole input width or
If the overlapping value doesn't permit processing the whole input width or
height, a warning will be displayed and according borders won't be denoised.
Default value is @code{15}.
@@ -3855,7 +3855,7 @@ within the parameter list.
@item
Show the text at the center of the video frame:
@example
drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2"
drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2"
@end example
@item
@@ -3921,7 +3921,7 @@ The high threshold selects the "strong" edge pixels, which are then
connected through 8-connectivity with the "weak" edge pixels selected
by the low threshold.
@var{low} and @var{high} threshold values must be choosen in the range
@var{low} and @var{high} threshold values must be chosen in the range
[0,1], and @var{low} should be lesser or equal to @var{high}.
Default value for @var{low} is @code{20/255}, and default value for @var{high}
@@ -5238,7 +5238,7 @@ Set progressive threshold.
Deinterleave or interleave fields.
This filter allows to process interlaced images fields without
This filter allows one to process interlaced images fields without
deinterlacing them. Deinterleaving splits the input frame into 2
fields (so called half pictures). Odd lines are moved to the top
half of the output image, even lines to the bottom half.
@@ -6860,7 +6860,7 @@ rotate=A*sin(2*PI/T*t)
@end example
@item
Rotate the video, output size is choosen so that the whole rotating
Rotate the video, output size is chosen so that the whole rotating
input video is always completely contained in the output:
@example
rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
@@ -6983,7 +6983,7 @@ Default value is @samp{0}.
@item flags
Set libswscale scaling flags. See
@ref{sws_flags,,the ffmpeg-scaler manual,ffmpeg-scaler} for the
complete list of values. If not explictly specified the filter applies
complete list of values. If not explicitly specified the filter applies
the default flags.
@item size, s
@@ -7797,7 +7797,7 @@ Produce 8x8 PNG tiles of all keyframes (@option{-skip_frame nokey}) in a movie:
ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
@end example
The @option{-vsync 0} is necessary to prevent @command{ffmpeg} from
duplicating each output frame to accomodate the originally detected frame
duplicating each output frame to accommodate the originally detected frame
rate.
@item
@@ -8394,7 +8394,7 @@ Set dithering to reduce the circular banding effects. Default is @code{1}
(enabled).
@item aspect
Set vignette aspect. This setting allows to adjust the shape of the vignette.
Set vignette aspect. This setting allows one to adjust the shape of the vignette.
Setting this value to the SAR of the input will make a rectangular vignetting
following the dimensions of the video.
@@ -8850,7 +8850,7 @@ Default value is "all", which will cycle through the list of all tests.
For example the following:
@example
testsrc=t=dc_luma
mptestsrc=t=dc_luma
@end example
will generate a "dc_luma" test pattern.
@@ -8903,7 +8903,7 @@ horizontally, vertically, or diagonally adjacent.
At each interaction the grid evolves according to the adopted rule,
which specifies the number of neighbor alive cells which will make a
cell stay alive or born. The @option{rule} option allows to specify
cell stay alive or born. The @option{rule} option allows one to specify
the rule to adopt.
This source accepts the following options:
@@ -10323,7 +10323,7 @@ Note that when the movie is looped the source timestamps are not
changed, so it will generate non monotonically increasing timestamps.
@end table
This filter allows to overlay a second video on top of main input of
This filter allows one to overlay a second video on top of main input of
a filtergraph as shown in this graph:
@example
input -----------> deltapts0 --> overlay --> output

View File

@@ -23,7 +23,7 @@ Reduce buffering.
@item probesize @var{integer} (@emph{input})
Set probing size in bytes, i.e. the size of the data to analyze to get
stream information. A higher value will allow to detect more
stream information. A higher value will enable detecting more
information in case it is dispersed into the stream, but will increase
latency. Must be an integer not lesser than 32. It is 5000000 by default.
@@ -63,7 +63,7 @@ Default is 0.
@item analyzeduration @var{integer} (@emph{input})
Specify how many microseconds are analyzed to probe the input. A
higher value will allow to detect more accurate information, but will
higher value will enable detecting more accurate information, but will
increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
@item cryptokey @var{hexadecimal string} (@emph{input})

View File

@@ -162,6 +162,27 @@ libzvbi is licensed under the GNU General Public License Version 2 or later
you must upgrade FFmpeg's license to GPL in order to use it.
@end float
@section AviSynth
FFmpeg can read AviSynth scripts as input. To enable support, pass
@code{--enable-avisynth} to configure. The correct headers are
included in compat/avisynth/, which allows the user to enable support
without needing to search for these headers themselves.
For Windows, supported AviSynth variants are
@url{http://avisynth.nl, AviSynth 2.5 or 2.6} for 32-bit builds and
@url{http://avs-plus.net, AviSynth+ 0.1} for 32-bit and 64-bit builds.
For Linux and OS X, the supported AviSynth variant is
@url{https://github.com/avxsynth/avxsynth, AvxSynth}.
@float NOTE
AviSynth and AvxSynth are loaded dynamically. Distributors can build FFmpeg
with @code{--enable-avisynth}, and the binaries will work regardless of the
end user having AviSynth or AvxSynth installed - they'll only need to be
installed to use AviSynth scripts (obviously).
@end float
@chapter Supported File Formats, Codecs or Features

View File

@@ -299,7 +299,7 @@ the current branch history.
git commit --amend
@end example
allows to amend the last commit details quickly.
allows one to amend the last commit details quickly.
@example
git rebase -i origin/master

View File

@@ -1,7 +1,7 @@
@chapter Input Devices
@c man begin INPUT DEVICES
Input devices are configured elements in FFmpeg which allow to access
Input devices are configured elements in FFmpeg which enable accessing
the data coming from a multimedia device attached to your system.
When you configure your FFmpeg build, all the supported input devices
@@ -409,7 +409,7 @@ OpenAL is part of Core Audio, the official Mac OS X Audio interface.
See @url{http://developer.apple.com/technologies/mac/audio-and-video.html}
@end table
This device allows to capture from an audio input device handled
This device allows one to capture from an audio input device handled
through OpenAL.
You need to specify the name of the device to capture in the provided
@@ -617,7 +617,7 @@ Select the pixel format (only valid for raw video input).
@item input_format
Set the preferred pixel format (for raw video) or a codec name.
This option allows to select the input format, when several are
This option allows one to select the input format, when several are
available.
@item framerate
@@ -678,7 +678,7 @@ other filename will be interpreted as device number 0.
X11 video input device.
This device allows to capture a region of an X11 display.
This device allows one to capture a region of an X11 display.
The filename passed as input has the syntax:
@example

View File

@@ -758,7 +758,7 @@ The segment muxer supports the following options:
@table @option
@item reference_stream @var{specifier}
Set the reference stream, as specified by the string @var{specifier}.
If @var{specifier} is set to @code{auto}, the reference is choosen
If @var{specifier} is set to @code{auto}, the reference is chosen
automatically. Otherwise it must be a stream specifier (see the ``Stream
specifiers'' chapter in the ffmpeg manual) which specifies the
reference stream. The default value is @code{auto}.

View File

@@ -42,7 +42,7 @@ ffmpeg -i INPUT -f alsa hw:1,7
CACA output device.
This output device allows to show a video stream in CACA window.
This output device allows one to show a video stream in CACA window.
Only one CACA window is allowed per application, so you can
have only one instance of this output device in an application.
@@ -216,7 +216,7 @@ OpenGL output device.
To enable this output device you need to configure FFmpeg with @code{--enable-opengl}.
Device allows to render to OpenGL context.
This output device allows one to render to OpenGL context.
Context may be provided by application or default SDL window is created.
When device renders to external context, application must implement handlers for following messages:
@@ -302,7 +302,7 @@ ffmpeg -i INPUT -f pulse "stream name"
SDL (Simple DirectMedia Layer) output device.
This output device allows to show a video stream in an SDL
This output device allows one to show a video stream in an SDL
window. Only one SDL window is allowed per application, so you can
have only one instance of this output device in an application.
@@ -361,7 +361,7 @@ sndio audio output device.
XV (XVideo) output device.
This output device allows to show a video stream in a X Window System
This output device allows one to show a video stream in a X Window System
window.
@subsection Options

View File

@@ -51,8 +51,9 @@ The toolchain provided with Xcode is sufficient to build the basic
unacelerated code.
Mac OS X on PowerPC or ARM (iPhone) requires a preprocessor from
@url{https://github.com/FFmpeg/gas-preprocessor} or
@url{http://github.com/yuvi/gas-preprocessor} to build the optimized
assembler functions. Just download the Perl script and put it somewhere
assembler functions. Put the Perl script somewhere
in your PATH, FFmpeg's configure will pick it up automatically.
Mac OS X on amd64 and x86 requires @command{yasm} to build most of the
@@ -120,8 +121,6 @@ You will need the following prerequisites:
(if using MSVC 2012 or earlier)
@item @uref{http://www.mingw.org/, MSYS}
@item @uref{http://yasm.tortall.net/, YASM}
@item @uref{http://gnuwin32.sourceforge.net/packages/bc.htm, bc for Windows} if
you want to run @uref{fate.html, FATE}.
@end itemize
To set up a proper environment in MSYS, you need to run @code{msys.bat} from
@@ -268,7 +267,7 @@ binutils, gcc4-core, make, git, mingw-runtime, texi2html
In order to run FATE you will also need the following "Utils" packages:
@example
bc, diffutils
diffutils
@end example
If you want to build FFmpeg with additional libraries, download Cygwin

View File

@@ -213,7 +213,7 @@ m3u8 files.
HTTP (Hyper Text Transfer Protocol).
This protocol accepts the following options.
This protocol accepts the following options:
@table @option
@item seekable
@@ -223,32 +223,33 @@ if set to -1 it will try to autodetect if it is seekable. Default
value is -1.
@item chunked_post
If set to 1 use chunked transfer-encoding for posts, default is 1.
If set to 1 use chunked Transfer-Encoding for posts, default is 1.
@item content_type
Set a specific content type for the POST messages.
@item headers
Set custom HTTP headers, can override built in default headers. The
value must be a string encoding the headers.
@item content_type
Force a content type.
@item user-agent
Override User-Agent header. If not specified the protocol will use a
string describing the libavformat build.
@item multiple_requests
Use persistent connections if set to 1. By default it is 0.
Use persistent connections if set to 1, default is 0.
@item post_data
Set custom HTTP post data.
@item user-agent
@item user_agent
Override the User-Agent header. If not specified the protocol will use a
string describing the libavformat build. ("Lavf/<version>")
@item timeout
Set timeout of socket I/O operations used by the underlying low level
operation. By default it is set to -1, which means that the timeout is
not specified.
@item mime_type
Set MIME type.
Export the MIME type.
@item icy
If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
@@ -257,17 +258,25 @@ the @option{icy_metadata_headers} and @option{icy_metadata_packet} options.
The default is 0.
@item icy_metadata_headers
If the server supports ICY metadata, this contains the ICY specific HTTP reply
headers, separated with newline characters.
If the server supports ICY metadata, this contains the ICY-specific HTTP reply
headers, separated by newline characters.
@item icy_metadata_packet
If the server supports ICY metadata, and @option{icy} was set to 1, this
contains the last non-empty metadata packet sent by the server.
contains the last non-empty metadata packet sent by the server. It should be
polled in regular intervals by applications interested in mid-stream metadata
updates.
@item cookies
Set the cookies to be sent in future requests. The format of each cookie is the
same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
delimited by a newline character.
@item offset
Set initial byte offset.
@item end_offset
Try to limit the request to bytes preceding this offset.
@end table
@subsection HTTP Cookies
@@ -951,7 +960,7 @@ used as master salt.
@section tcp
Trasmission Control Protocol.
Transmission Control Protocol.
The required syntax for a TCP url is:
@example
@@ -973,8 +982,8 @@ Set raise error timeout, expressed in microseconds.
This option is only relevant in read mode: if no data arrived in more
than this time interval, raise error.
@item listen_timeout=@var{microseconds}
Set listen timeout, expressed in microseconds.
@item listen_timeout=@var{milliseconds}
Set listen timeout, expressed in milliseconds.
@end table
The following example shows how to setup a listening TCP connection
@@ -1057,7 +1066,7 @@ udp://@var{hostname}:@var{port}[?@var{options}]
@var{options} contains a list of &-separated options of the form @var{key}=@var{val}.
In case threading is enabled on the system, a circular buffer is used
to store the incoming data, which allows to reduce loss of data due to
to store the incoming data, which allows one to reduce loss of data due to
UDP socket buffer overruns. The @var{fifo_size} and
@var{overrun_nonfatal} options are related to this buffer.

View File

@@ -35,7 +35,7 @@ Select nearest neighbor rescaling algorithm.
@item area
Select averaging area rescaling algorithm.
@item bicubiclin
@item bicublin
Select bicubic scaling algorithm for the luma component, bilinear for
chroma components.

View File

@@ -327,10 +327,11 @@ die "No filename or title\n" unless defined $fn && defined $tl;
$chapters{NAME} = "$fn \- $tl\n";
$chapters{FOOTNOTES} .= "=back\n" if exists $chapters{FOOTNOTES};
# always use utf8
print "=encoding utf8\n\n";
unshift @chapters_sequence, "NAME";
for $chapter (@chapters_sequence) {
# always use utf8
print "=encoding utf8\n";
if (exists $chapters{$chapter}) {
$head = uc($chapter);
print "=head1 $head\n\n";

View File

@@ -841,7 +841,7 @@ Return 1.0 if @var{x} is +/-INFINITY, 0.0 otherwise.
Return 1.0 if @var{x} is NAN, 0.0 otherwise.
@item ld(var)
Allow to load the value of the internal variable with number
Load the value of the internal variable with number
@var{var}, which was previously stored with st(@var{var}, @var{expr}).
The function returns the loaded value.
@@ -858,7 +858,7 @@ Return 1 if @var{x} is lesser than or equal to @var{y}, 0 otherwise.
Return the maximum between @var{x} and @var{y}.
@item min(x, y)
Return the maximum between @var{x} and @var{y}.
Return the minimum between @var{x} and @var{y}.
@item mod(x, y)
Compute the remainder of division of @var{x} by @var{y}.
@@ -909,7 +909,7 @@ Compute the square root of @var{expr}. This is equivalent to
Compute expression @code{1/(1 + exp(4*x))}.
@item st(var, expr)
Allow to store the value of the expression @var{expr} in an internal
Store the value of the expression @var{expr} in an internal
variable. @var{var} specifies the number of the variable where to
store the value, and it is a value ranging from 0 to 9. The function
returns the value stored in the internal variable.
@@ -1056,7 +1056,7 @@ which can be obtained with @code{ffmpeg -opencl_bench} or @code{av_opencl_get_de
@item device_idx
Select the index of the device used to run OpenCL code.
The specifed index must be one of the indexes in the device list which
The specified index must be one of the indexes in the device list which
can be obtained with @code{ffmpeg -opencl_bench} or @code{av_opencl_get_device_list()}.
@end table

View File

@@ -323,7 +323,7 @@ sigterm_handler(int sig)
received_nb_signals++;
term_exit();
if(received_nb_signals > 3)
exit_program(123);
exit(123);
}
void term_init(void)
@@ -353,7 +353,6 @@ void term_init(void)
signal(SIGQUIT, sigterm_handler); /* Quit (POSIX). */
}
#endif
avformat_network_deinit();
signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */
signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */
@@ -514,6 +513,8 @@ static void ffmpeg_cleanup(int ret)
if (received_sigterm) {
av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n",
(int) received_sigterm);
} else if (ret) {
av_log(NULL, AV_LOG_INFO, "Conversion failed!\n");
}
term_exit();
}
@@ -619,7 +620,8 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
bsfc = bsfc->next;
}
if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS) &&
if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
if(
(avctx->codec_type == AVMEDIA_TYPE_AUDIO || avctx->codec_type == AVMEDIA_TYPE_VIDEO) &&
pkt->dts != AV_NOPTS_VALUE &&
ost->last_mux_dts != AV_NOPTS_VALUE) {
@@ -640,6 +642,16 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
pkt->pts = FFMAX(pkt->pts, max);
pkt->dts = max;
}
}
if (pkt->dts != AV_NOPTS_VALUE &&
pkt->pts != AV_NOPTS_VALUE &&
pkt->dts > pkt->pts) {
av_log(s, AV_LOG_WARNING, "Invalid DTS: %"PRId64" PTS: %"PRId64" in output stream %d:%d\n",
pkt->dts, pkt->pts,
ost->file_index, ost->st->index);
pkt->pts = AV_NOPTS_VALUE;
pkt->dts = AV_NOPTS_VALUE;
}
}
ost->last_mux_dts = pkt->dts;
@@ -1089,6 +1101,19 @@ static void do_video_stats(OutputStream *ost, int frame_size)
}
}
static void finish_output_stream(OutputStream *ost)
{
OutputFile *of = output_files[ost->file_index];
int i;
ost->finished = ENCODER_FINISHED | MUXER_FINISHED;
if (of->shortest) {
for (i = 0; i < of->ctx->nb_streams; i++)
output_streams[of->ost_index + i]->finished = ENCODER_FINISHED | MUXER_FINISHED;
}
}
/**
* Get and encode new output from any of the filtergraphs, without causing
* activity.
@@ -1966,7 +1991,7 @@ static int output_packet(InputStream *ist, const AVPacket *pkt)
if (avpkt.duration) {
duration = av_rescale_q(avpkt.duration, ist->st->time_base, AV_TIME_BASE_Q);
} else if(ist->st->codec->time_base.num != 0 && ist->st->codec->time_base.den != 0) {
int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : ist->st->codec->ticks_per_frame;
int ticks= av_stream_get_parser(ist->st) ? av_stream_get_parser(ist->st)->repeat_pict+1 : ist->st->codec->ticks_per_frame;
duration = ((int64_t)AV_TIME_BASE *
ist->st->codec->time_base.num * ticks) /
ist->st->codec->time_base.den;
@@ -2023,7 +2048,7 @@ static int output_packet(InputStream *ist, const AVPacket *pkt)
} else if (pkt->duration) {
ist->next_dts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q);
} else if(ist->st->codec->time_base.num != 0) {
int ticks= ist->st->parser ? ist->st->parser->repeat_pict + 1 : ist->st->codec->ticks_per_frame;
int ticks= av_stream_get_parser(ist->st) ? av_stream_get_parser(ist->st)->repeat_pict + 1 : ist->st->codec->ticks_per_frame;
ist->next_dts += ((int64_t)AV_TIME_BASE *
ist->st->codec->time_base.num * ticks) /
ist->st->codec->time_base.den;
@@ -2258,7 +2283,7 @@ static int transcode_init(void)
AVCodecContext *codec;
OutputStream *ost;
InputStream *ist;
char error[1024];
char error[1024] = {0};
int want_sdp = 1;
for (i = 0; i < nb_filtergraphs; i++) {
@@ -2356,11 +2381,13 @@ static int transcode_init(void)
codec->rc_max_rate = icodec->rc_max_rate;
codec->rc_buffer_size = icodec->rc_buffer_size;
codec->field_order = icodec->field_order;
codec->extradata = av_mallocz(extra_size);
if (!codec->extradata) {
return AVERROR(ENOMEM);
if (icodec->extradata_size) {
codec->extradata = av_mallocz(extra_size);
if (!codec->extradata) {
return AVERROR(ENOMEM);
}
memcpy(codec->extradata, icodec->extradata, icodec->extradata_size);
}
memcpy(codec->extradata, icodec->extradata, icodec->extradata_size);
codec->extradata_size= icodec->extradata_size;
codec->bits_per_coded_sample = icodec->bits_per_coded_sample;
@@ -3145,7 +3172,7 @@ static int process_input(int file_index)
if (ost->source_index == ifile->ist_index + i &&
(ost->stream_copy || ost->enc->type == AVMEDIA_TYPE_SUBTITLE))
close_output_stream(ost);
finish_output_stream(ost);
}
}

View File

@@ -44,12 +44,15 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(target);
int has_alpha = desc ? desc->nb_components % 2 == 0 : 0;
enum AVPixelFormat best= AV_PIX_FMT_NONE;
const enum AVPixelFormat mjpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
const enum AVPixelFormat ljpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
if (st->codec->codec_id == AV_CODEC_ID_MJPEG) {
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
p = mjpeg_formats;
} else if (st->codec->codec_id == AV_CODEC_ID_LJPEG) {
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
p =ljpeg_formats;
}
}
for (; *p != AV_PIX_FMT_NONE; p++) {
@@ -825,6 +828,12 @@ static int configure_input_filter(FilterGraph *fg, InputFilter *ifilter,
av_freep(&ifilter->name);
DESCRIBE_FILTER_LINK(ifilter, in, 1);
if (!ifilter->ist->dec) {
av_log(NULL, AV_LOG_ERROR,
"No decoder for stream #%d:%d, filtering impossible\n",
ifilter->ist->file_index, ifilter->ist->st->index);
return AVERROR_DECODER_NOT_FOUND;
}
switch (avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx)) {
case AVMEDIA_TYPE_VIDEO: return configure_input_video_filter(fg, ifilter, in);
case AVMEDIA_TYPE_AUDIO: return configure_input_audio_filter(fg, ifilter, in);

View File

@@ -1783,7 +1783,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
/* pick the "best" stream of each type */
/* video: highest resolution */
if (!o->video_disable && oc->oformat->video_codec != AV_CODEC_ID_NONE) {
if (!o->video_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_VIDEO) != AV_CODEC_ID_NONE) {
int area = 0, idx = -1;
int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0);
for (i = 0; i < nb_input_streams; i++) {
@@ -1805,7 +1805,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
}
/* audio: most channels */
if (!o->audio_disable && oc->oformat->audio_codec != AV_CODEC_ID_NONE) {
if (!o->audio_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_AUDIO) != AV_CODEC_ID_NONE) {
int channels = 0, idx = -1;
for (i = 0; i < nb_input_streams; i++) {
ist = input_streams[i];
@@ -1821,7 +1821,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
/* subtitles: pick first */
MATCH_PER_TYPE_OPT(codec_names, str, subtitle_codec_name, oc, "s");
if (!o->subtitle_disable && (oc->oformat->subtitle_codec != AV_CODEC_ID_NONE || subtitle_codec_name)) {
if (!o->subtitle_disable && (avcodec_find_encoder(oc->oformat->subtitle_codec) || subtitle_codec_name)) {
for (i = 0; i < nb_input_streams; i++)
if (input_streams[i]->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
new_subtitle_stream(o, oc, i);
@@ -2119,7 +2119,8 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
for (j = 0; j < nb_input_files; j++) {
for (i = 0; i < input_files[j]->nb_streams; i++) {
AVCodecContext *c = input_files[j]->ctx->streams[i]->codec;
if (c->codec_type != AVMEDIA_TYPE_VIDEO)
if (c->codec_type != AVMEDIA_TYPE_VIDEO ||
!c->time_base.num)
continue;
fr = c->time_base.den * 1000 / c->time_base.num;
if (fr == 25000) {
@@ -2152,19 +2153,19 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
parse_option(o, "s", norm == PAL ? "352x288" : "352x240", options);
parse_option(o, "r", frame_rates[norm], options);
av_dict_set(&o->g->codec_opts, "g", norm == PAL ? "15" : "18", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "g", norm == PAL ? "15" : "18");
av_dict_set(&o->g->codec_opts, "b:v", "1150000", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->codec_opts, "maxrate", "1150000", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->codec_opts, "minrate", "1150000", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->codec_opts, "bufsize", "327680", AV_DICT_DONT_OVERWRITE); // 40*1024*8;
opt_default(NULL, "b:v", "1150000");
opt_default(NULL, "maxrate", "1150000");
opt_default(NULL, "minrate", "1150000");
opt_default(NULL, "bufsize", "327680"); // 40*1024*8;
av_dict_set(&o->g->codec_opts, "b:a", "224000", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "b:a", "224000");
parse_option(o, "ar", "44100", options);
parse_option(o, "ac", "2", options);
av_dict_set(&o->g->format_opts, "packetsize", "2324", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->format_opts, "muxrate", "1411200", AV_DICT_DONT_OVERWRITE); // 2352 * 75 * 8;
opt_default(NULL, "packetsize", "2324");
opt_default(NULL, "muxrate", "1411200"); // 2352 * 75 * 8;
/* We have to offset the PTS, so that it is consistent with the SCR.
SCR starts at 36000, but the first two packs contain only padding
@@ -2181,18 +2182,18 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
parse_option(o, "s", norm == PAL ? "480x576" : "480x480", options);
parse_option(o, "r", frame_rates[norm], options);
parse_option(o, "pix_fmt", "yuv420p", options);
av_dict_set(&o->g->codec_opts, "g", norm == PAL ? "15" : "18", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "g", norm == PAL ? "15" : "18");
av_dict_set(&o->g->codec_opts, "b:v", "2040000", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->codec_opts, "maxrate", "2516000", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->codec_opts, "minrate", "0", AV_DICT_DONT_OVERWRITE); // 1145000;
av_dict_set(&o->g->codec_opts, "bufsize", "1835008", AV_DICT_DONT_OVERWRITE); // 224*1024*8;
av_dict_set(&o->g->codec_opts, "scan_offset", "1", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "b:v", "2040000");
opt_default(NULL, "maxrate", "2516000");
opt_default(NULL, "minrate", "0"); // 1145000;
opt_default(NULL, "bufsize", "1835008"); // 224*1024*8;
opt_default(NULL, "scan_offset", "1");
av_dict_set(&o->g->codec_opts, "b:a", "224000", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "b:a", "224000");
parse_option(o, "ar", "44100", options);
av_dict_set(&o->g->format_opts, "packetsize", "2324", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "packetsize", "2324");
} else if (!strcmp(arg, "dvd")) {
@@ -2203,17 +2204,17 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
parse_option(o, "s", norm == PAL ? "720x576" : "720x480", options);
parse_option(o, "r", frame_rates[norm], options);
parse_option(o, "pix_fmt", "yuv420p", options);
av_dict_set(&o->g->codec_opts, "g", norm == PAL ? "15" : "18", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "g", norm == PAL ? "15" : "18");
av_dict_set(&o->g->codec_opts, "b:v", "6000000", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->codec_opts, "maxrate", "9000000", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->codec_opts, "minrate", "0", AV_DICT_DONT_OVERWRITE); // 1500000;
av_dict_set(&o->g->codec_opts, "bufsize", "1835008", AV_DICT_DONT_OVERWRITE); // 224*1024*8;
opt_default(NULL, "b:v", "6000000");
opt_default(NULL, "maxrate", "9000000");
opt_default(NULL, "minrate", "0"); // 1500000;
opt_default(NULL, "bufsize", "1835008"); // 224*1024*8;
av_dict_set(&o->g->format_opts, "packetsize", "2048", AV_DICT_DONT_OVERWRITE); // from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack.
av_dict_set(&o->g->format_opts, "muxrate", "10080000", AV_DICT_DONT_OVERWRITE); // from mplex project: data_rate = 1260000. mux_rate = data_rate * 8
opt_default(NULL, "packetsize", "2048"); // from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack.
opt_default(NULL, "muxrate", "10080000"); // from mplex project: data_rate = 1260000. mux_rate = data_rate * 8
av_dict_set(&o->g->codec_opts, "b:a", "448000", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "b:a", "448000");
parse_option(o, "ar", "48000", options);
} else if (!strncmp(arg, "dv", 2)) {
@@ -2232,6 +2233,10 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
av_log(NULL, AV_LOG_ERROR, "Unknown target: %s\n", arg);
return AVERROR(EINVAL);
}
av_dict_copy(&o->g->codec_opts, codec_opts, AV_DICT_DONT_OVERWRITE);
av_dict_copy(&o->g->format_opts, format_opts, AV_DICT_DONT_OVERWRITE);
return 0;
}
@@ -2248,6 +2253,9 @@ static int opt_vstats(void *optctx, const char *opt, const char *arg)
time_t today2 = time(NULL);
struct tm *today = localtime(&today2);
if (!today)
return AVERROR(errno);
snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
today->tm_sec);
return opt_vstats_file(NULL, opt, filename);
@@ -2724,7 +2732,7 @@ const OptionDef options[] = {
{ "itsscale", HAS_ARG | OPT_DOUBLE | OPT_SPEC |
OPT_EXPERT | OPT_INPUT, { .off = OFFSET(ts_scale) },
"set the input ts scale", "scale" },
{ "timestamp", HAS_ARG | OPT_PERFILE, { .func_arg = opt_recording_timestamp },
{ "timestamp", HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_recording_timestamp },
"set the recording timestamp ('now' to set the current time)", "time" },
{ "metadata", HAS_ARG | OPT_STRING | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(metadata) },
"add metadata", "string=string" },

View File

@@ -191,6 +191,7 @@ static const char unit_hertz_str[] = "Hz" ;
static const char unit_byte_str[] = "byte" ;
static const char unit_bit_per_second_str[] = "bit/s";
static int nb_streams;
static uint64_t *nb_streams_packets;
static uint64_t *nb_streams_frames;
static int *selected_streams;
@@ -246,6 +247,7 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv)
vald /= pow(10, index * 3);
prefix_string = decimal_unit_prefixes[index];
}
vali = vald;
}
if (show_float || (use_value_prefix && vald != (long long int)vald))
@@ -336,7 +338,7 @@ static const AVOption writer_options[] = {
{ "replace", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = WRITER_STRING_VALIDATION_REPLACE}, .unit = "sv" },
{ "fail", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = WRITER_STRING_VALIDATION_FAIL}, .unit = "sv" },
{ "string_validation_replacement", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str=""}},
{ "svr", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str=""}},
{ "svr", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str="\xEF\xBF\xBD"}},
{ NULL }
};
@@ -1631,6 +1633,14 @@ static void writer_register_all(void)
#define print_section_header(s) writer_print_section_header(w, s)
#define print_section_footer(s) writer_print_section_footer(w, s)
#define REALLOCZ_ARRAY_STREAM(ptr, cur_n, new_n) \
{ \
ret = av_reallocp_array(&(ptr), (new_n), sizeof(*(ptr))); \
if (ret < 0) \
goto end; \
memset( (ptr) + (cur_n), 0, ((new_n) - (cur_n)) * sizeof(*(ptr)) ); \
}
static inline int show_tags(WriterContext *w, AVDictionary *tags, int section_id)
{
AVDictionaryEntry *tag = NULL;
@@ -1892,6 +1902,12 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
goto end;
}
while (!av_read_frame(fmt_ctx, &pkt)) {
if (fmt_ctx->nb_streams > nb_streams) {
REALLOCZ_ARRAY_STREAM(nb_streams_frames, nb_streams, fmt_ctx->nb_streams);
REALLOCZ_ARRAY_STREAM(nb_streams_packets, nb_streams, fmt_ctx->nb_streams);
REALLOCZ_ARRAY_STREAM(selected_streams, nb_streams, fmt_ctx->nb_streams);
nb_streams = fmt_ctx->nb_streams;
}
if (selected_streams[pkt.stream_index]) {
AVRational tb = fmt_ctx->streams[pkt.stream_index]->time_base;
@@ -2366,9 +2382,10 @@ static int probe_file(WriterContext *wctx, const char *filename)
#define CHECK_END if (ret < 0) goto end
nb_streams_frames = av_calloc(fmt_ctx->nb_streams, sizeof(*nb_streams_frames));
nb_streams_packets = av_calloc(fmt_ctx->nb_streams, sizeof(*nb_streams_packets));
selected_streams = av_calloc(fmt_ctx->nb_streams, sizeof(*selected_streams));
nb_streams = fmt_ctx->nb_streams;
REALLOCZ_ARRAY_STREAM(nb_streams_frames,0,fmt_ctx->nb_streams);
REALLOCZ_ARRAY_STREAM(nb_streams_packets,0,fmt_ctx->nb_streams);
REALLOCZ_ARRAY_STREAM(selected_streams,0,fmt_ctx->nb_streams);
for (i = 0; i < fmt_ctx->nb_streams; i++) {
if (stream_specifier) {

View File

@@ -2989,6 +2989,8 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
AVDictionaryEntry *entry = av_dict_get(stream->metadata, "title", NULL, 0);
int i;
*pbuffer = NULL;
avc = avformat_alloc_context();
if (avc == NULL || !rtp_format) {
return -1;
@@ -3025,7 +3027,7 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
av_free(avc);
av_free(avs);
return strlen(*pbuffer);
return *pbuffer ? strlen(*pbuffer) : AVERROR(ENOMEM);
}
static void rtsp_cmd_options(HTTPContext *c, const char *url)

View File

@@ -38,15 +38,15 @@ static av_cold int zero12v_decode_init(AVCodecContext *avctx)
static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
int line = 0, ret;
int line, ret;
const int width = avctx->width;
AVFrame *pic = data;
uint16_t *y, *u, *v;
const uint8_t *line_end, *src = avpkt->data;
int stride = avctx->width * 8 / 3;
if (width == 1) {
av_log(avctx, AV_LOG_ERROR, "Width 1 not supported.\n");
if (width <= 1 || avctx->height <= 0) {
av_log(avctx, AV_LOG_ERROR, "Dimensions %dx%d not supported.\n", width, avctx->height);
return AVERROR_INVALIDDATA;
}
@@ -67,45 +67,45 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
pic->pict_type = AV_PICTURE_TYPE_I;
pic->key_frame = 1;
y = (uint16_t *)pic->data[0];
u = (uint16_t *)pic->data[1];
v = (uint16_t *)pic->data[2];
line_end = avpkt->data + stride;
for (line = 0; line < avctx->height; line++) {
uint16_t y_temp[6] = {0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000};
uint16_t u_temp[3] = {0x8000, 0x8000, 0x8000};
uint16_t v_temp[3] = {0x8000, 0x8000, 0x8000};
int x;
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
while (line++ < avctx->height) {
while (1) {
uint32_t t = AV_RL32(src);
for (x = 0; x < width; x += 6) {
uint32_t t;
if (width - x < 6 || line_end - src < 16) {
y = y_temp;
u = u_temp;
v = v_temp;
}
if (line_end - src < 4)
break;
t = AV_RL32(src);
src += 4;
*u++ = t << 6 & 0xFFC0;
*y++ = t >> 4 & 0xFFC0;
*v++ = t >> 14 & 0xFFC0;
if (src >= line_end - 1) {
*y = 0x80;
src++;
line_end += stride;
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
if (line_end - src < 4)
break;
}
t = AV_RL32(src);
src += 4;
*y++ = t << 6 & 0xFFC0;
*u++ = t >> 4 & 0xFFC0;
*y++ = t >> 14 & 0xFFC0;
if (src >= line_end - 2) {
if (!(width & 1)) {
*y = 0x80;
src += 2;
}
line_end += stride;
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
if (line_end - src < 4)
break;
}
t = AV_RL32(src);
src += 4;
@@ -113,15 +113,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
*y++ = t >> 4 & 0xFFC0;
*u++ = t >> 14 & 0xFFC0;
if (src >= line_end - 1) {
*y = 0x80;
src++;
line_end += stride;
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
if (line_end - src < 4)
break;
}
t = AV_RL32(src);
src += 4;
@@ -129,18 +122,21 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
*v++ = t >> 4 & 0xFFC0;
*y++ = t >> 14 & 0xFFC0;
if (src >= line_end - 2) {
if (width & 1) {
*y = 0x80;
src += 2;
}
line_end += stride;
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
if (width - x < 6)
break;
}
}
if (x < width) {
y = x + (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
u = x/2 + (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
v = x/2 + (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
memcpy(y, y_temp, sizeof(*y) * (width - x));
memcpy(u, u_temp, sizeof(*u) * (width - x + 1) / 2);
memcpy(v, v_temp, sizeof(*v) * (width - x + 1) / 2);
}
line_end += stride;
src = line_end - stride;
}
*got_frame = 1;

View File

@@ -119,7 +119,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
}
}
if ((avctx->bits_per_coded_sample & 0x1f) <= 8) {
if (avctx->bits_per_coded_sample <= 8) {
const uint8_t *pal = av_packet_get_side_data(avpkt,
AV_PKT_DATA_PALETTE,
NULL);

View File

@@ -26,7 +26,6 @@ OBJS = allcodecs.o \
options.o \
parser.o \
raw.o \
rawdec.o \
resample.o \
resample2.o \
utils.o \

View File

@@ -78,9 +78,13 @@ static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest)
for (y = blocky; y < blocky + 8 && y < C64YRES; y++) {
for (x = blockx; x < blockx + 8 && x < C64XRES; x += 2) {
if(x < width && y < height) {
/* build average over 2 pixels */
luma = (src[(x + 0 + y * p->linesize[0])] +
src[(x + 1 + y * p->linesize[0])]) / 2;
if (x + 1 < width) {
/* build average over 2 pixels */
luma = (src[(x + 0 + y * p->linesize[0])] +
src[(x + 1 + y * p->linesize[0])]) / 2;
} else {
luma = src[(x + y * p->linesize[0])];
}
/* write blocks as linear data now so they are suitable for elbg */
dest[0] = luma;
}
@@ -317,7 +321,9 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
} else {
/* fill up mc_meta_charset with data until lifetime exceeds */
if (c->mc_frame_counter < c->mc_lifetime) {
*p = *pict;
ret = av_frame_ref(p, pict);
if (ret < 0)
return ret;
p->pict_type = AV_PICTURE_TYPE_I;
p->key_frame = 1;
to_meta_with_crop(avctx, p, meta + 32000 * c->mc_frame_counter);
@@ -334,8 +340,8 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
req_size = 0;
/* any frames to encode? */
if (c->mc_lifetime) {
req_size = charset_size + c->mc_lifetime*(screen_size + colram_size);
if ((ret = ff_alloc_packet2(avctx, pkt, req_size)) < 0)
int alloc_size = charset_size + c->mc_lifetime*(screen_size + colram_size);
if ((ret = ff_alloc_packet2(avctx, pkt, alloc_size)) < 0)
return ret;
buf = pkt->data;
@@ -352,6 +358,7 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
/* advance pointers */
buf += charset_size;
charset += charset_size;
req_size += charset_size;
}
/* write x frames to buf */

View File

@@ -81,7 +81,7 @@ enum BandType {
INTENSITY_BT = 15, ///< Scalefactor data are intensity stereo positions.
};
#define IS_CODEBOOK_UNSIGNED(x) ((x - 1) & 10)
#define IS_CODEBOOK_UNSIGNED(x) (((x) - 1) & 10)
enum ChannelPosition {
AAC_CHANNEL_OFF = 0,

View File

@@ -34,7 +34,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int size;
union {
uint64_t u64;
uint8_t u8[8];
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
} tmp;
tmp.u64 = av_be2ne64(state);

View File

@@ -425,7 +425,7 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
* Save current output configuration if and only if it has been locked.
*/
static void push_output_configuration(AACContext *ac) {
if (ac->oc[1].status == OC_LOCKED) {
if (ac->oc[1].status == OC_LOCKED || ac->oc[0].status == OC_NONE) {
ac->oc[0] = ac->oc[1];
}
ac->oc[1].status = OC_NONE;
@@ -881,7 +881,7 @@ static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx,
if (len == 15 + 255)
len += get_bits(gb, 16);
if (get_bits_left(gb) < len * 8 + 4) {
av_log(ac->avctx, AV_LOG_ERROR, overread_err);
av_log(avctx, AV_LOG_ERROR, overread_err);
return AVERROR_INVALIDDATA;
}
skip_bits_long(gb, 8 * len);
@@ -3021,6 +3021,12 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
AV_WL32(side, 2*AV_RL32(side));
}
if (!ac->frame->data[0] && samples) {
av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
err = AVERROR_INVALIDDATA;
goto fail;
}
*got_frame_ptr = !!samples;
if (samples) {
ac->frame->nb_samples = samples;

View File

@@ -165,7 +165,7 @@ static void put_audio_specific_config(AVCodecContext *avctx)
PutBitContext pb;
AACEncContext *s = avctx->priv_data;
init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
init_put_bits(&pb, avctx->extradata, avctx->extradata_size);
put_bits(&pb, 5, 2); //object type - AAC-LC
put_bits(&pb, 4, s->samplerate_index); //sample rate index
put_bits(&pb, 4, s->channels);

View File

@@ -313,7 +313,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
ctx->bitres.size = 6144 - pctx->frame_bits;
ctx->bitres.size -= ctx->bitres.size % 8;
pctx->fill_level = ctx->bitres.size;
minath = ath(3410, ATH_ADD);
minath = ath(3410 - 0.733 * ATH_ADD, ATH_ADD);
for (j = 0; j < 2; j++) {
AacPsyCoeffs *coeffs = pctx->psy_coef[j];
const uint8_t *band_sizes = ctx->bands[j];
@@ -727,7 +727,10 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
if (active_lines > 0.0f)
band->thr = calc_reduced_thr_3gpp(band, coeffs[g].min_snr, reduction);
pe += calc_pe_3gpp(band);
band->norm_fac = band->active_lines / band->thr;
if (band->thr > 0.0f)
band->norm_fac = band->active_lines / band->thr;
else
band->norm_fac = 0.0f;
norm_fac += band->norm_fac;
}
}

View File

@@ -520,7 +520,7 @@ static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr,
/// High Frequency Generation - Patch Construction (14496-3 sp04 p216 fig. 4.46)
static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
{
int i, k, sb = 0;
int i, k, last_k = -1, last_msb = -1, sb = 0;
int msb = sbr->k[0];
int usb = sbr->kx[1];
int goal_sb = ((1000 << 11) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
@@ -534,6 +534,12 @@ static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
do {
int odd = 0;
if (k == last_k && msb == last_msb) {
av_log(ac->avctx, AV_LOG_ERROR, "patch construction failed\n");
return AVERROR_INVALIDDATA;
}
last_k = k;
last_msb = msb;
for (i = k; i == k || sb > (sbr->k[0] - 1 + msb - odd); i--) {
sb = sbr->f_master[i];
odd = (sb + sbr->k[0]) & 1;

View File

@@ -78,6 +78,7 @@ av_cold void ff_h264dsp_init_aarch64(H264DSPContext *c, const int bit_depth,
c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon;
c->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon;
c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon;
if (chroma_format_idc <= 1)
c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon;
c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;

View File

@@ -137,7 +137,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
return ret;
/* report that the buffer was completely consumed */
return buf_size;
return avpkt->size;
}
static av_cold int aasc_decode_end(AVCodecContext *avctx)

View File

@@ -131,6 +131,9 @@ int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd,
int band_start, band_end, begin, end1;
int lowcomp, fastleak, slowleak;
if (end <= 0)
return AVERROR_INVALIDDATA;
/* excitation function */
band_start = ff_ac3_bin_to_band_tab[start];
band_end = ff_ac3_bin_to_band_tab[end-1] + 1;

View File

@@ -166,7 +166,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int err;
union {
uint64_t u64;
uint8_t u8[8];
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
} tmp = { av_be2ne64(state) };
AC3HeaderInfo hdr, *phdr = &hdr;
GetBitContext gbc;

View File

@@ -256,7 +256,7 @@ static void apply_channel_coupling(AC3EncodeContext *s)
energy_cpl = energy[blk][CPL_CH][bnd];
energy_ch = energy[blk][ch][bnd];
blk1 = blk+1;
while (!s->blocks[blk1].new_cpl_coords[ch] && blk1 < s->num_blocks) {
while (blk1 < s->num_blocks && !s->blocks[blk1].new_cpl_coords[ch]) {
if (s->blocks[blk1].cpl_in_use) {
energy_cpl += energy[blk1][CPL_CH][bnd];
energy_ch += energy[blk1][ch][bnd];

View File

@@ -471,9 +471,11 @@ static void adpcm_swf_decode(AVCodecContext *avctx, const uint8_t *buf, int buf_
* @param[out] coded_samples set to the number of samples as coded in the
* packet, or 0 if the codec does not encode the
* number of samples in each frame.
* @param[out] approx_nb_samples set to non-zero if the number of samples
* returned is an approximation.
*/
static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
int buf_size, int *coded_samples)
int buf_size, int *coded_samples, int *approx_nb_samples)
{
ADPCMDecodeContext *s = avctx->priv_data;
int nb_samples = 0;
@@ -482,6 +484,7 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
int header_size;
*coded_samples = 0;
*approx_nb_samples = 0;
if(ch <= 0)
return 0;
@@ -552,10 +555,12 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
case AV_CODEC_ID_ADPCM_EA_R2:
header_size = 4 + 5 * ch;
*coded_samples = bytestream2_get_le32(gb);
*approx_nb_samples = 1;
break;
case AV_CODEC_ID_ADPCM_EA_R3:
header_size = 4 + 5 * ch;
*coded_samples = bytestream2_get_be32(gb);
*approx_nb_samples = 1;
break;
}
*coded_samples -= *coded_samples % 28;
@@ -570,6 +575,8 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
case AV_CODEC_ID_ADPCM_IMA_DK4:
if (avctx->block_align > 0)
buf_size = FFMIN(buf_size, avctx->block_align);
if (buf_size < 4 * ch)
return AVERROR_INVALIDDATA;
nb_samples = 1 + (buf_size - 4 * ch) * 2 / ch;
break;
case AV_CODEC_ID_ADPCM_IMA_RAD:
@@ -583,13 +590,15 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
int bsamples = ff_adpcm_ima_block_samples[avctx->bits_per_coded_sample - 2];
if (avctx->block_align > 0)
buf_size = FFMIN(buf_size, avctx->block_align);
if (buf_size < 4 * ch)
return AVERROR_INVALIDDATA;
nb_samples = 1 + (buf_size - 4 * ch) / (bsize * ch) * bsamples;
break;
}
case AV_CODEC_ID_ADPCM_MS:
if (avctx->block_align > 0)
buf_size = FFMIN(buf_size, avctx->block_align);
nb_samples = 2 + (buf_size - 7 * ch) * 2 / ch;
nb_samples = (buf_size - 6 * ch) * 2 / ch;
break;
case AV_CODEC_ID_ADPCM_SBPRO_2:
case AV_CODEC_ID_ADPCM_SBPRO_3:
@@ -602,6 +611,8 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
case AV_CODEC_ID_ADPCM_SBPRO_4: samples_per_byte = 2; break;
}
if (!s->status[0].step_index) {
if (buf_size < ch)
return AVERROR_INVALIDDATA;
nb_samples++;
buf_size -= ch;
}
@@ -663,11 +674,11 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
int16_t **samples_p;
int st; /* stereo */
int count1, count2;
int nb_samples, coded_samples, ret;
int nb_samples, coded_samples, approx_nb_samples, ret;
GetByteContext gb;
bytestream2_init(&gb, buf, buf_size);
nb_samples = get_nb_samples(avctx, &gb, buf_size, &coded_samples);
nb_samples = get_nb_samples(avctx, &gb, buf_size, &coded_samples, &approx_nb_samples);
if (nb_samples <= 0) {
av_log(avctx, AV_LOG_ERROR, "invalid number of samples in packet\n");
return AVERROR_INVALIDDATA;
@@ -683,7 +694,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
/* use coded_samples when applicable */
/* it is always <= nb_samples, so the output buffer will be large enough */
if (coded_samples) {
if (coded_samples != nb_samples)
if (!approx_nb_samples && coded_samples != nb_samples)
av_log(avctx, AV_LOG_WARNING, "mismatch in coded sample count\n");
frame->nb_samples = nb_samples = coded_samples;
}
@@ -917,6 +928,9 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
*samples++ = c->status[0].predictor + c->status[1].predictor;
*samples++ = c->status[0].predictor - c->status[1].predictor;
}
if ((bytestream2_tell(&gb) & 1))
bytestream2_skip(&gb, 1);
break;
}
case AV_CODEC_ID_ADPCM_IMA_ISS:
@@ -1517,6 +1531,11 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
*got_frame_ptr = 1;
if (avpkt->size < bytestream2_tell(&gb)) {
av_log(avctx, AV_LOG_ERROR, "Overread of %d < %d\n", avpkt->size, bytestream2_tell(&gb));
return avpkt->size;
}
return bytestream2_tell(&gb);
}

View File

@@ -541,7 +541,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
case AV_CODEC_ID_ADPCM_IMA_QT:
{
PutBitContext pb;
init_put_bits(&pb, dst, pkt_size * 8);
init_put_bits(&pb, dst, pkt_size);
for (ch = 0; ch < avctx->channels; ch++) {
ADPCMChannelStatus *status = &c->status[ch];
@@ -549,10 +549,11 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
put_bits(&pb, 7, status->step_index);
if (avctx->trellis > 0) {
uint8_t buf[64];
adpcm_compress_trellis(avctx, &samples_p[ch][1], buf, status,
adpcm_compress_trellis(avctx, &samples_p[ch][0], buf, status,
64, 1);
for (i = 0; i < 64; i++)
put_bits(&pb, 4, buf[i ^ 1]);
status->prev_sample = status->predictor;
} else {
for (i = 0; i < 64; i += 2) {
int t1, t2;
@@ -570,7 +571,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
case AV_CODEC_ID_ADPCM_SWF:
{
PutBitContext pb;
init_put_bits(&pb, dst, pkt_size * 8);
init_put_bits(&pb, dst, pkt_size);
n = frame->nb_samples - 1;

View File

@@ -150,6 +150,7 @@ typedef struct AICContext {
int16_t *data_ptr[NUM_BANDS];
DECLARE_ALIGNED(16, int16_t, block)[64];
DECLARE_ALIGNED(16, uint8_t, quant_matrix)[64];
} AICContext;
static int aic_decode_header(AICContext *ctx, const uint8_t *src, int size)
@@ -285,7 +286,7 @@ static void recombine_block_il(int16_t *dst, const uint8_t *scan,
}
}
static void unquant_block(int16_t *block, int q)
static void unquant_block(int16_t *block, int q, uint8_t *quant_matrix)
{
int i;
@@ -293,7 +294,7 @@ static void unquant_block(int16_t *block, int q)
int val = (uint16_t)block[i];
int sign = val & 1;
block[i] = (((val >> 1) ^ -sign) * q * aic_quant_matrix[i] >> 4)
block[i] = (((val >> 1) ^ -sign) * q * quant_matrix[i] >> 4)
+ sign;
}
}
@@ -334,7 +335,7 @@ static int aic_decode_slice(AICContext *ctx, int mb_x, int mb_y,
else
recombine_block_il(ctx->block, ctx->scantable.permutated,
&base_y, &ext_y, blk);
unquant_block(ctx->block, ctx->quant);
unquant_block(ctx->block, ctx->quant, ctx->quant_matrix);
ctx->dsp.idct(ctx->block);
if (!ctx->interlaced) {
@@ -352,7 +353,7 @@ static int aic_decode_slice(AICContext *ctx, int mb_x, int mb_y,
for (blk = 0; blk < 2; blk++) {
recombine_block(ctx->block, ctx->scantable.permutated,
&base_c, &ext_c);
unquant_block(ctx->block, ctx->quant);
unquant_block(ctx->block, ctx->quant, ctx->quant_matrix);
ctx->dsp.idct(ctx->block);
ctx->dsp.put_signed_pixels_clamped(ctx->block, C[blk],
ctx->frame->linesize[blk + 1]);
@@ -430,12 +431,14 @@ static av_cold int aic_decode_init(AVCodecContext *avctx)
for (i = 0; i < 64; i++)
scan[i] = i;
ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, scan);
for (i = 0; i < 64; i++)
ctx->quant_matrix[ctx->dsp.idct_permutation[i]] = aic_quant_matrix[i];
ctx->mb_width = FFALIGN(avctx->width, 16) >> 4;
ctx->mb_height = FFALIGN(avctx->height, 16) >> 4;
ctx->num_x_slices = 16;
ctx->slice_width = ctx->mb_width / 16;
ctx->num_x_slices = (ctx->mb_width + 15) >> 4;
ctx->slice_width = 16;
for (i = 1; i < 32; i++) {
if (!(ctx->mb_width % i) && (ctx->mb_width / i < 32)) {
ctx->slice_width = ctx->mb_width / i;

View File

@@ -311,6 +311,12 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
int lpc_quant[2];
int rice_history_mult[2];
if (!alac->rice_limit) {
avpriv_request_sample(alac->avctx,
"Compression with rice limit 0");
return AVERROR(ENOSYS);
}
decorr_shift = get_bits(&alac->gb, 8);
decorr_left_weight = get_bits(&alac->gb, 8);

View File

@@ -280,7 +280,7 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
GetBitContext gb;
uint64_t ht_size;
int i, config_offset;
MPEG4AudioConfig m4ac;
MPEG4AudioConfig m4ac = {0};
ALSSpecificConfig *sconf = &ctx->sconf;
AVCodecContext *avctx = ctx->avctx;
uint32_t als_id, header_size, trailer_size;
@@ -355,11 +355,15 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
ctx->cs_switch = 1;
for (i = 0; i < avctx->channels; i++) {
sconf->chan_pos[i] = -1;
}
for (i = 0; i < avctx->channels; i++) {
int idx;
idx = get_bits(&gb, chan_pos_bits);
if (idx >= avctx->channels) {
if (idx >= avctx->channels || sconf->chan_pos[idx] != -1) {
av_log(avctx, AV_LOG_WARNING, "Invalid channel reordering.\n");
ctx->cs_switch = 0;
break;
@@ -676,7 +680,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
if (!sconf->rlslms) {
if (sconf->adapt_order) {
if (sconf->adapt_order && sconf->max_order) {
int opt_order_length = av_ceil_log2(av_clip((bd->block_length >> 3) - 1,
2, sconf->max_order + 1));
*bd->opt_order = get_bits(gb, opt_order_length);
@@ -1238,6 +1242,7 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
ALSChannelData *ch = cd[c];
unsigned int dep = 0;
unsigned int channels = ctx->avctx->channels;
unsigned int channel_size = ctx->sconf.frame_length + ctx->sconf.max_order;
if (reverted[c])
return 0;
@@ -1268,9 +1273,9 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
bd->raw_samples = ctx->raw_samples[c] + offset;
for (dep = 0; !ch[dep].stop_flag; dep++) {
unsigned int smp;
unsigned int begin = 1;
unsigned int end = bd->block_length - 1;
ptrdiff_t smp;
ptrdiff_t begin = 1;
ptrdiff_t end = bd->block_length - 1;
int64_t y;
int32_t *master = ctx->raw_samples[ch[dep].master_channel] + offset;
@@ -1282,11 +1287,28 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
if (ch[dep].time_diff_sign) {
t = -t;
if (begin < t) {
av_log(ctx->avctx, AV_LOG_ERROR, "begin %td smaller than time diff index %d.\n", begin, t);
return AVERROR_INVALIDDATA;
}
begin -= t;
} else {
if (end < t) {
av_log(ctx->avctx, AV_LOG_ERROR, "end %td smaller than time diff index %d.\n", end, t);
return AVERROR_INVALIDDATA;
}
end -= t;
}
if (FFMIN(begin - 1, begin - 1 + t) < ctx->raw_buffer - master ||
FFMAX(end + 1, end + 1 + t) > ctx->raw_buffer + channels * channel_size - master) {
av_log(ctx->avctx, AV_LOG_ERROR,
"sample pointer range [%p, %p] not contained in raw_buffer [%p, %p].\n",
master + FFMIN(begin - 1, begin - 1 + t), master + FFMAX(end + 1, end + 1 + t),
ctx->raw_buffer, ctx->raw_buffer + channels * channel_size);
return AVERROR_INVALIDDATA;
}
for (smp = begin; smp < end; smp++) {
y = (1 << 6) +
MUL64(ch[dep].weighting[0], master[smp - 1 ]) +
@@ -1299,6 +1321,16 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
bd->raw_samples[smp] += y >> 7;
}
} else {
if (begin - 1 < ctx->raw_buffer - master ||
end + 1 > ctx->raw_buffer + channels * channel_size - master) {
av_log(ctx->avctx, AV_LOG_ERROR,
"sample pointer range [%p, %p] not contained in raw_buffer [%p, %p].\n",
master + begin - 1, master + end + 1,
ctx->raw_buffer, ctx->raw_buffer + channels * channel_size);
return AVERROR_INVALIDDATA;
}
for (smp = begin; smp < end; smp++) {
y = (1 << 6) +
MUL64(ch[dep].weighting[0], master[smp - 1]) +
@@ -1456,6 +1488,11 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
// TODO: read_diff_float_data
if (get_bits_left(gb) < 0) {
av_log(ctx->avctx, AV_LOG_ERROR, "Overread %d\n", -get_bits_left(gb));
return AVERROR_INVALIDDATA;
}
return 0;
}
@@ -1660,6 +1697,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->sample_fmt = sconf->resolution > 1
? AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S16;
avctx->bits_per_raw_sample = (sconf->resolution + 1) * 8;
if (avctx->bits_per_raw_sample > 32) {
av_log(avctx, AV_LOG_ERROR, "Bits per raw sample %d larger than 32.\n",
avctx->bits_per_raw_sample);
ret = AVERROR_INVALIDDATA;
goto fail;
}
}
// set maximum Rice parameter for progressive decoding based on resolution
@@ -1722,9 +1765,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
// allocate and assign channel data buffer for mcc mode
if (sconf->mc_coding) {
ctx->chan_data_buffer = av_malloc(sizeof(*ctx->chan_data_buffer) *
ctx->chan_data_buffer = av_mallocz(sizeof(*ctx->chan_data_buffer) *
num_buffers * num_buffers);
ctx->chan_data = av_malloc(sizeof(*ctx->chan_data) *
ctx->chan_data = av_mallocz(sizeof(*ctx->chan_data) *
num_buffers);
ctx->reverted_channels = av_malloc(sizeof(*ctx->reverted_channels) *
num_buffers);

View File

@@ -598,14 +598,14 @@ static void decode_array_0000(APEContext *ctx, GetBitContext *gb,
int ksummax, ksummin;
rice->ksum = 0;
for (i = 0; i < 5; i++) {
for (i = 0; i < FFMIN(blockstodecode, 5); i++) {
out[i] = get_rice_ook(&ctx->gb, 10);
rice->ksum += out[i];
}
rice->k = av_log2(rice->ksum / 10) + 1;
if (rice->k >= 24)
return;
for (; i < 64; i++) {
for (; i < FFMIN(blockstodecode, 64); i++) {
out[i] = get_rice_ook(&ctx->gb, rice->k);
rice->ksum += out[i];
rice->k = av_log2(rice->ksum / ((i + 1) * 2)) + 1;
@@ -1472,13 +1472,13 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR, "Invalid sample count: %u.\n", nblocks);
return AVERROR_INVALIDDATA;
}
s->samples = nblocks;
/* Initialize the frame decoder */
if (init_frame_decoder(s) < 0) {
av_log(avctx, AV_LOG_ERROR, "Error reading frame header\n");
return AVERROR_INVALIDDATA;
}
s->samples = nblocks;
}
if (!s->data) {

View File

@@ -108,8 +108,12 @@ av_cold void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth,
{
int cpu_flags = av_get_cpu_flags();
if (have_armv6(cpu_flags))
if (have_armv6(cpu_flags) && !(have_vfpv3(cpu_flags) || have_neon(cpu_flags))) {
// This function uses the 'setend' instruction which is deprecated
// on ARMv8. This instruction is serializing on some ARMv7 cores as
// well. Therefore, only use the function on ARMv6.
c->h264_find_start_code_candidate = ff_h264_find_start_code_candidate_armv6;
}
if (have_neon(cpu_flags))
h264dsp_init_neon(c, bit_depth, chroma_format_idc);
}

View File

@@ -144,10 +144,11 @@ function ff_put_pixels8_y2_armv6, export=1
eor r7, r5, r7
uadd8 r10, r10, r6
and r7, r7, r12
ldr_pre r6, r1, r2
ldrc_pre ne, r6, r1, r2
uadd8 r11, r11, r7
strd_post r8, r9, r0, r2
ldr r7, [r1, #4]
it ne
ldrne r7, [r1, #4]
strd_post r10, r11, r0, r2
bne 1b
@@ -196,9 +197,10 @@ function ff_put_pixels8_y2_no_rnd_armv6, export=1
uhadd8 r9, r5, r7
ldr r5, [r1, #4]
uhadd8 r12, r4, r6
ldr_pre r6, r1, r2
ldrc_pre ne, r6, r1, r2
uhadd8 r14, r5, r7
ldr r7, [r1, #4]
it ne
ldrne r7, [r1, #4]
stm r0, {r8,r9}
add r0, r0, r2
stm r0, {r12,r14}

View File

@@ -23,9 +23,10 @@
#include "libavutil/arm/asm.S"
function ff_prefetch_arm, export=1
1:
subs r2, r2, #1
pld [r0]
add r0, r0, r1
bne X(ff_prefetch_arm)
bne 1b
bx lr
endfunc

View File

@@ -26,7 +26,7 @@
void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, const int16_t *data);
void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_vp3_v_loop_filter_neon(uint8_t *, int, int *);
void ff_vp3_h_loop_filter_neon(uint8_t *, int, int *);

View File

@@ -1204,7 +1204,7 @@ function ff_put_vp8_\name\size\()_\hv\()_armv6, export=1
mov r4, #\size
stm r12, {r4, r5}
orr r12, r6, r7
b vp8_put_\name\()_\hv\()_armv6 + 4
b bl_put_\name\()_\hv\()_armv6
endfunc
.endm
@@ -1300,6 +1300,7 @@ vp8_mc_hv bilin, 4, h, v, 2
function vp8_put_epel_h6_armv6
push {r1, r4-r11, lr}
bl_put_epel_h6_armv6:
sub r2, r2, #2
movrel lr, sixtap_filters_13245600 - 16
add lr, lr, r12, lsl #3
@@ -1358,6 +1359,7 @@ endfunc
function vp8_put_epel_v6_armv6
push {r1, r4-r11, lr}
bl_put_epel_v6_armv6:
movrel lr, sixtap_filters_13245600 - 16
add lr, lr, r12, lsl #3
str r3, [sp, #48]
@@ -1437,6 +1439,7 @@ endfunc
function vp8_put_epel_h4_armv6
push {r1, r4-r11, lr}
bl_put_epel_h4_armv6:
subs r2, r2, #1
movrel lr, fourtap_filters_1324 - 4
add lr, lr, r12, lsl #2
@@ -1483,6 +1486,7 @@ endfunc
function vp8_put_epel_v4_armv6
push {r1, r4-r11, lr}
bl_put_epel_v4_armv6:
movrel lr, fourtap_filters_1324 - 4
add lr, lr, r12, lsl #2
ldm lr, {r5, r6}
@@ -1544,6 +1548,7 @@ endfunc
function vp8_put_bilin_h_armv6
push {r1, r4-r11, lr}
bl_put_bilin_h_armv6:
rsb r5, r12, r12, lsl #16
ldr r12, [sp, #44]
sub r3, r3, r4
@@ -1589,6 +1594,7 @@ endfunc
function vp8_put_bilin_v_armv6
push {r1, r4-r11, lr}
bl_put_bilin_v_armv6:
rsb r5, r12, r12, lsl #16
ldr r12, [sp, #44]
add r5, r5, #8

View File

@@ -381,7 +381,7 @@ static int atrac3p_decode_frame(AVCodecContext *avctx, void *data,
*got_frame_ptr = 1;
return avctx->block_align;
return FFMIN(avctx->block_align, avpkt->size);
}
AVCodec ff_atrac3p_decoder = {

View File

@@ -599,8 +599,8 @@ void ff_atrac3p_ipqf(FFTContext *dct_ctx, Atrac3pIPQFChannelCtx *hist,
const float *in, float *out)
{
int i, s, sb, t, pos_now, pos_next;
DECLARE_ALIGNED(32, float, idct_in)[ATRAC3P_SUBBANDS];
DECLARE_ALIGNED(32, float, idct_out)[ATRAC3P_SUBBANDS];
LOCAL_ALIGNED(32, float, idct_in, [ATRAC3P_SUBBANDS]);
LOCAL_ALIGNED(32, float, idct_out, [ATRAC3P_SUBBANDS]);
memset(out, 0, ATRAC3P_FRAME_SAMPLES * sizeof(*out));

View File

@@ -507,7 +507,6 @@ int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
dst->convergence_duration = src->convergence_duration;
dst->flags = src->flags;
dst->stream_index = src->stream_index;
dst->side_data_elems = src->side_data_elems;
for (i = 0; i < src->side_data_elems; i++) {
enum AVPacketSideDataType type = src->side_data[i].type;

View File

@@ -69,6 +69,8 @@ void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
if (length == 0)
return;
av_assert0(length <= put_bits_left(pb));
if (CONFIG_SMALL || words < 16 || put_bits_count(pb) & 7) {
for (i = 0; i < words; i++)
put_bits(pb, 16, AV_RB16(src + 2 * i));

View File

@@ -214,6 +214,7 @@ typedef struct AVSContext {
int luma_scan[4];
int qp;
int qp_fixed;
int pic_qp_fixed;
int cbp;
ScanTable scantable;

View File

@@ -570,6 +570,11 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
return AVERROR_INVALIDDATA;
}
esc_code = get_ue_code(gb, esc_golomb_order);
if (esc_code < 0 || esc_code > 32767) {
av_log(h->avctx, AV_LOG_ERROR, "esc_code invalid\n");
return AVERROR_INVALIDDATA;
}
level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);
while (level > r->inc_limit)
r++;
@@ -904,7 +909,7 @@ static inline int decode_slice_header(AVSContext *h, GetBitContext *gb)
/* mark top macroblocks as unavailable */
h->flags &= ~(B_AVAIL | C_AVAIL);
if ((h->mby == 0) && (!h->qp_fixed)) {
if (!h->pic_qp_fixed) {
h->qp_fixed = get_bits1(gb);
h->qp = get_bits(gb, 6);
}
@@ -1027,6 +1032,7 @@ static int decode_pic(AVSContext *h)
skip_bits1(&h->gb); //advanced_pred_mode_disable
skip_bits1(&h->gb); //top_field_first
skip_bits1(&h->gb); //repeat_first_field
h->pic_qp_fixed =
h->qp_fixed = get_bits1(&h->gb);
h->qp = get_bits(&h->gb, 6);
if (h->cur.f->pict_type == AV_PICTURE_TYPE_I) {

View File

@@ -261,7 +261,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data,
static int cdg_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
GetByteContext gb;
int buf_size = avpkt->size;
int ret;
uint8_t command, inst;
@@ -278,6 +278,8 @@ static int cdg_decode_frame(AVCodecContext *avctx,
return AVERROR(EINVAL);
}
bytestream2_init(&gb, avpkt->data, avpkt->size);
if ((ret = ff_reget_buffer(avctx, cc->frame)) < 0)
return ret;
if (!avctx->frame_number) {
@@ -285,13 +287,11 @@ static int cdg_decode_frame(AVCodecContext *avctx,
memset(cc->frame->data[1], 0, AVPALETTE_SIZE);
}
command = bytestream_get_byte(&buf);
inst = bytestream_get_byte(&buf);
command = bytestream2_get_byte(&gb);
inst = bytestream2_get_byte(&gb);
inst &= CDG_MASK;
buf += 2; /// skipping 2 unneeded bytes
if (buf_size > CDG_HEADER_SIZE)
bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
bytestream2_skip(&gb, 2);
bytestream2_get_buffer(&gb, cdg_data, sizeof(cdg_data));
if ((command & CDG_MASK) == CDG_COMMAND) {
switch (inst) {
@@ -353,10 +353,9 @@ static int cdg_decode_frame(AVCodecContext *avctx,
*got_frame = 1;
} else {
*got_frame = 0;
buf_size = 0;
}
return buf_size;
return avpkt->size;
}
static av_cold int cdg_decode_end(AVCodecContext *avctx)

View File

@@ -135,7 +135,7 @@ static int cinepak_decode_vectors (CinepakContext *s, cvid_strip *strip,
const uint8_t *eod = (data + size);
uint32_t flag, mask;
uint8_t *cb0, *cb1, *cb2, *cb3;
unsigned int x, y;
int x, y;
char *ip0, *ip1, *ip2, *ip3;
flag = 0;

View File

@@ -1214,8 +1214,8 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
q->num_subpackets++;
s++;
if (s > MAX_SUBPACKETS) {
avpriv_request_sample(avctx, "subpackets > %d", MAX_SUBPACKETS);
if (s > FFMIN(MAX_SUBPACKETS, avctx->block_align)) {
avpriv_request_sample(avctx, "subpackets > %d", FFMIN(MAX_SUBPACKETS, avctx->block_align));
return AVERROR_PATCHWELCOME;
}
}

View File

@@ -581,6 +581,14 @@ static int dca_parse_audio_coding_header(DCAContext *s, int base_channel,
}
nchans = get_bits(&s->gb, 3) + 1;
if (xxch && nchans >= 3) {
av_log(s->avctx, AV_LOG_ERROR, "nchans %d is too large\n", nchans);
return AVERROR_INVALIDDATA;
} else if (nchans + base_channel > DCA_PRIM_CHANNELS_MAX) {
av_log(s->avctx, AV_LOG_ERROR, "channel sum %d + %d is too large\n", nchans, base_channel);
return AVERROR_INVALIDDATA;
}
s->total_channels = nchans + base_channel;
s->prim_channels = s->total_channels;
@@ -839,6 +847,10 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index)
if (!base_channel) {
s->subsubframes[s->current_subframe] = get_bits(&s->gb, 2) + 1;
if (block_index + s->subsubframes[s->current_subframe] > s->sample_blocks/8) {
s->subsubframes[s->current_subframe] = 1;
return AVERROR_INVALIDDATA;
}
s->partial_samples[s->current_subframe] = get_bits(&s->gb, 3);
}
@@ -1370,7 +1382,7 @@ static int dca_subsubframe(DCAContext *s, int base_channel, int block_index)
* Decode VQ encoded high frequencies
*/
if (s->subband_activity[k] > s->vq_start_subband[k]) {
if (!s->debug_flag & 0x01) {
if (!(s->debug_flag & 0x01)) {
av_log(s->avctx, AV_LOG_DEBUG,
"Stream with high frequencies VQ coding\n");
s->debug_flag |= 0x01;
@@ -1800,8 +1812,13 @@ static int dca_xbr_parse_frame(DCAContext *s)
for(i = 0; i < num_chsets; i++) {
n_xbr_ch[i] = get_bits(&s->gb, 3) + 1;
k = get_bits(&s->gb, 2) + 5;
for(j = 0; j < n_xbr_ch[i]; j++)
for(j = 0; j < n_xbr_ch[i]; j++) {
active_bands[i][j] = get_bits(&s->gb, k) + 1;
if (active_bands[i][j] > DCA_SUBBANDS) {
av_log(s->avctx, AV_LOG_ERROR, "too many active subbands (%d)\n", active_bands[i][j]);
return AVERROR_INVALIDDATA;
}
}
}
/* skip to the end of the header */
@@ -1843,23 +1860,34 @@ static int dca_xbr_parse_frame(DCAContext *s)
for(i = 0; i < n_xbr_ch[chset]; i++) {
const uint32_t *scale_table;
int nbits;
int scale_table_size;
if (s->scalefactor_huffman[chan_base+i] == 6) {
scale_table = scale_factor_quant7;
scale_table_size = FF_ARRAY_ELEMS(scale_factor_quant7);
} else {
scale_table = scale_factor_quant6;
scale_table_size = FF_ARRAY_ELEMS(scale_factor_quant6);
}
nbits = anctemp[i];
for(j = 0; j < active_bands[chset][i]; j++) {
if(abits_high[i][j] > 0) {
scale_table_high[i][j][0] =
scale_table[get_bits(&s->gb, nbits)];
int index = get_bits(&s->gb, nbits);
if (index >= scale_table_size) {
av_log(s->avctx, AV_LOG_ERROR, "scale table index %d invalid\n", index);
return AVERROR_INVALIDDATA;
}
scale_table_high[i][j][0] = scale_table[index];
if(xbr_tmode && s->transition_mode[i][j]) {
scale_table_high[i][j][1] =
scale_table[get_bits(&s->gb, nbits)];
int index = get_bits(&s->gb, nbits);
if (index >= scale_table_size) {
av_log(s->avctx, AV_LOG_ERROR, "scale table index %d invalid\n", index);
return AVERROR_INVALIDDATA;
}
scale_table_high[i][j][1] = scale_table[index];
}
}
}
@@ -2173,7 +2201,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
if (s->core_downmix && (s->core_downmix_amode == DCA_STEREO ||
s->core_downmix_amode == DCA_STEREO_TOTAL)) {
int sign, code;
for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
for (i = 0; i < num_core_channels + !!s->lfe; i++) {
sign = s->core_downmix_codes[i][0] & 0x100 ? 1 : -1;
code = s->core_downmix_codes[i][0] & 0x0FF;
s->downmix_coef[i][0] = (!code ? 0.0f :
@@ -2191,19 +2219,19 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
"Invalid channel mode %d\n", am);
return AVERROR_INVALIDDATA;
}
if (s->prim_channels + !!s->lfe >
if (num_core_channels + !!s->lfe >
FF_ARRAY_ELEMS(dca_default_coeffs[0])) {
avpriv_request_sample(s->avctx, "Downmixing %d channels",
s->prim_channels + !!s->lfe);
return AVERROR_PATCHWELCOME;
}
for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
for (i = 0; i < num_core_channels + !!s->lfe; i++) {
s->downmix_coef[i][0] = dca_default_coeffs[am][i][0];
s->downmix_coef[i][1] = dca_default_coeffs[am][i][1];
}
}
av_dlog(s->avctx, "Stereo downmix coeffs:\n");
for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
for (i = 0; i < num_core_channels + !!s->lfe; i++) {
av_dlog(s->avctx, "L, input channel %d = %f\n", i,
s->downmix_coef[i][0]);
av_dlog(s->avctx, "R, input channel %d = %f\n", i,
@@ -2329,6 +2357,17 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
{ /* xxx should also do MA extensions */
if (s->amode < 16) {
avctx->channel_layout = dca_core_channel_layout[s->amode];
if (s->prim_channels + !!s->lfe > 2 &&
avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
/*
* Neither the core's auxiliary data nor our default tables contain
* downmix coefficients for the additional channel coded in the XCh
* extension, so when we're doing a Stereo downmix, don't decode it.
*/
s->xch_disable = 1;
}
#if FF_API_REQUEST_CHANNELS
FF_DISABLE_DEPRECATION_WARNINGS
if (s->xch_present && !s->xch_disable &&
@@ -2338,6 +2377,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
#else
if (s->xch_present && !s->xch_disable) {
#endif
if (avctx->channel_layout & AV_CH_BACK_CENTER) {
avpriv_request_sample(avctx, "XCh with Back center channel");
return AVERROR_INVALIDDATA;
}
avctx->channel_layout |= AV_CH_BACK_CENTER;
if (s->lfe) {
avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
@@ -2366,7 +2409,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
return AVERROR_INVALIDDATA;
}
if (s->prim_channels + !!s->lfe > 2 &&
if (num_core_channels + !!s->lfe > 2 &&
avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
channels = 2;
s->output = s->prim_channels == 2 ? s->amode : DCA_STEREO;
@@ -2415,7 +2458,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
* masks in some sense -- unfortunately some channels could overlap */
if (av_popcount(channel_mask) != av_popcount(channel_layout)) {
av_log(avctx, AV_LOG_DEBUG,
"DTS-XXCH: Inconsistant avcodec/dts channel layouts\n");
"DTS-XXCH: Inconsistent avcodec/dts channel layouts\n");
return AVERROR_INVALIDDATA;
}
@@ -2433,6 +2476,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
s->xxch_order_tab[j++] = posn;
}
}
}
s->lfe_index = av_popcount(channel_layout & (AV_CH_LOW_FREQUENCY-1));

View File

@@ -28,6 +28,7 @@
#ifndef AVCODEC_DIRAC_ARITH_H
#define AVCODEC_DIRAC_ARITH_H
#include "libavutil/x86/asm.h"
#include "bytestream.h"
#include "get_bits.h"
@@ -134,7 +135,7 @@ static inline int dirac_get_arith_bit(DiracArith *c, int ctx)
range_times_prob = (c->range * prob_zero) >> 16;
#if HAVE_FAST_CMOV && HAVE_INLINE_ASM
#if HAVE_FAST_CMOV && HAVE_INLINE_ASM && HAVE_6REGS
low -= range_times_prob << 16;
range -= range_times_prob;
bit = 0;
@@ -170,6 +171,10 @@ static inline int dirac_get_arith_uint(DiracArith *c, int follow_ctx, int data_c
{
int ret = 1;
while (!dirac_get_arith_bit(c, follow_ctx)) {
if (ret >= 0x40000000) {
av_log(NULL, AV_LOG_ERROR, "dirac_get_arith_uint overflow\n");
return -1;
}
ret <<= 1;
ret += dirac_get_arith_bit(c, data_ctx);
follow_ctx = ff_dirac_next_ctx[follow_ctx];

View File

@@ -201,6 +201,7 @@ typedef struct DiracContext {
uint16_t *mctmp; /* buffer holding the MC data multipled by OBMC weights */
uint8_t *mcscratch;
int buffer_stride;
DECLARE_ALIGNED(16, uint8_t, obmc_weight)[3][MAX_BLOCKSIZE*MAX_BLOCKSIZE];
@@ -343,22 +344,44 @@ static int alloc_sequence_buffers(DiracContext *s)
return AVERROR(ENOMEM);
}
w = s->source.width;
h = s->source.height;
/* fixme: allocate using real stride here */
s->sbsplit = av_malloc(sbwidth * sbheight);
s->blmotion = av_malloc(sbwidth * sbheight * 16 * sizeof(*s->blmotion));
s->edge_emu_buffer_base = av_malloc((w+64)*MAX_BLOCKSIZE);
s->sbsplit = av_malloc_array(sbwidth, sbheight);
s->blmotion = av_malloc_array(sbwidth, sbheight * 16 * sizeof(*s->blmotion));
s->mctmp = av_malloc((w+64+MAX_BLOCKSIZE) * (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
s->mcscratch = av_malloc((w+64)*MAX_BLOCKSIZE);
if (!s->sbsplit || !s->blmotion || !s->mctmp || !s->mcscratch)
if (!s->sbsplit || !s->blmotion)
return AVERROR(ENOMEM);
return 0;
}
static int alloc_buffers(DiracContext *s, int stride)
{
int w = s->source.width;
int h = s->source.height;
av_assert0(stride >= w);
stride += 64;
if (s->buffer_stride >= stride)
return 0;
s->buffer_stride = 0;
av_freep(&s->edge_emu_buffer_base);
memset(s->edge_emu_buffer, 0, sizeof(s->edge_emu_buffer));
av_freep(&s->mctmp);
av_freep(&s->mcscratch);
s->edge_emu_buffer_base = av_malloc_array(stride, MAX_BLOCKSIZE);
s->mctmp = av_malloc_array((stride+MAX_BLOCKSIZE), (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
s->mcscratch = av_malloc_array(stride, MAX_BLOCKSIZE);
if (!s->edge_emu_buffer_base || !s->mctmp || !s->mcscratch)
return AVERROR(ENOMEM);
s->buffer_stride = stride;
return 0;
}
static void free_sequence_buffers(DiracContext *s)
{
int i, j, k;
@@ -382,6 +405,7 @@ static void free_sequence_buffers(DiracContext *s)
av_freep(&s->plane[i].idwt_tmp);
}
s->buffer_stride = 0;
av_freep(&s->sbsplit);
av_freep(&s->blmotion);
av_freep(&s->edge_emu_buffer_base);
@@ -586,10 +610,10 @@ static av_always_inline void decode_subband_internal(DiracContext *s, SubBand *b
top = 0;
for (cb_y = 0; cb_y < cb_height; cb_y++) {
bottom = (b->height * (cb_y+1)) / cb_height;
bottom = (b->height * (cb_y+1LL)) / cb_height;
left = 0;
for (cb_x = 0; cb_x < cb_width; cb_x++) {
right = (b->width * (cb_x+1)) / cb_width;
right = (b->width * (cb_x+1LL)) / cb_width;
codeblock(s, b, &gb, &c, left, right, top, bottom, blockcnt_one, is_arith);
left = right;
}
@@ -773,7 +797,10 @@ static void decode_lowdelay(DiracContext *s)
slice_num++;
buf += bytes;
bufsize -= bytes*8;
if (bufsize/8 >= bytes)
bufsize -= bytes*8;
else
bufsize = 0;
}
avctx->execute(avctx, decode_lowdelay_slice, slices, NULL, slice_num,
@@ -870,6 +897,14 @@ static int dirac_unpack_prediction_parameters(DiracContext *s)
/*[DIRAC_STD] 11.2.4 motion_data_dimensions()
Calculated in function dirac_unpack_block_motion_data */
if (s->plane[0].xblen % (1 << s->chroma_x_shift) != 0 ||
s->plane[0].yblen % (1 << s->chroma_y_shift) != 0 ||
!s->plane[0].xblen || !s->plane[0].yblen) {
av_log(s->avctx, AV_LOG_ERROR,
"invalid x/y block length (%d/%d) for x/y chroma shift (%d/%d)\n",
s->plane[0].xblen, s->plane[0].yblen, s->chroma_x_shift, s->chroma_y_shift);
return AVERROR_INVALIDDATA;
}
if (!s->plane[0].xbsep || !s->plane[0].ybsep || s->plane[0].xbsep < s->plane[0].xblen/2 || s->plane[0].ybsep < s->plane[0].yblen/2) {
av_log(s->avctx, AV_LOG_ERROR, "Block separation too small\n");
return -1;
@@ -978,8 +1013,8 @@ static int dirac_unpack_idwt_params(DiracContext *s)
/* Codeblock parameters (core syntax only) */
if (get_bits1(gb)) {
for (i = 0; i <= s->wavelet_depth; i++) {
CHECKEDREAD(s->codeblock[i].width , tmp < 1, "codeblock width invalid\n")
CHECKEDREAD(s->codeblock[i].height, tmp < 1, "codeblock height invalid\n")
CHECKEDREAD(s->codeblock[i].width , tmp < 1 || tmp > (s->avctx->width >>s->wavelet_depth-i), "codeblock width invalid\n")
CHECKEDREAD(s->codeblock[i].height, tmp < 1 || tmp > (s->avctx->height>>s->wavelet_depth-i), "codeblock height invalid\n")
}
CHECKEDREAD(s->codeblock_mode, tmp > 1, "unknown codeblock mode\n")
@@ -1355,8 +1390,8 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5],
motion_y >>= s->chroma_y_shift;
}
mx = motion_x & ~(-1 << s->mv_precision);
my = motion_y & ~(-1 << s->mv_precision);
mx = motion_x & ~(-1U << s->mv_precision);
my = motion_y & ~(-1U << s->mv_precision);
motion_x >>= s->mv_precision;
motion_y >>= s->mv_precision;
/* normalize subpel coordinates to epel */
@@ -1710,6 +1745,12 @@ static int dirac_decode_picture_header(DiracContext *s)
get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF);
break;
}
if (!s->ref_pics[i]) {
av_log(s->avctx, AV_LOG_ERROR, "Reference could not be allocated\n");
return -1;
}
}
/* retire the reference frames that are not used anymore */
@@ -1854,6 +1895,9 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
s->plane[1].stride = pic->avframe->linesize[1];
s->plane[2].stride = pic->avframe->linesize[2];
if (alloc_buffers(s, FFMAX3(FFABS(s->plane[0].stride), FFABS(s->plane[1].stride), FFABS(s->plane[2].stride))) < 0)
return AVERROR(ENOMEM);
/* [DIRAC_STD] 11.1 Picture parse. picture_parse() */
if (dirac_decode_picture_header(s))
return -1;
@@ -1902,8 +1946,8 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
break;
data_unit_size = AV_RB32(buf+buf_idx+5);
if (buf_idx + data_unit_size > buf_size || !data_unit_size) {
if(buf_idx + data_unit_size > buf_size)
if (data_unit_size > buf_size - buf_idx || !data_unit_size) {
if(data_unit_size > buf_size - buf_idx)
av_log(s->avctx, AV_LOG_ERROR,
"Data unit with size %d is larger than input buffer, discarding\n",
data_unit_size);

View File

@@ -36,6 +36,7 @@ typedef struct DNXHDContext {
GetBitContext gb;
int64_t cid; ///< compression id
unsigned int width, height;
enum AVPixelFormat pix_fmt;
unsigned int mb_width, mb_height;
uint32_t mb_scan_index[68]; /* max for 1080p */
int cur_field; ///< current interlaced field
@@ -133,7 +134,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
ctx->is_444 = 0;
if (buf[0x4] == 0x2) {
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
ctx->pix_fmt = AV_PIX_FMT_YUV444P10;
ctx->avctx->bits_per_raw_sample = 10;
if (ctx->bit_depth != 10) {
ff_dsputil_init(&ctx->dsp, ctx->avctx);
@@ -142,7 +143,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
}
ctx->is_444 = 1;
} else if (buf[0x21] & 0x40) {
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
ctx->pix_fmt = AV_PIX_FMT_YUV422P10;
ctx->avctx->bits_per_raw_sample = 10;
if (ctx->bit_depth != 10) {
ff_dsputil_init(&ctx->dsp, ctx->avctx);
@@ -150,7 +151,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
ctx->decode_dct_block = dnxhd_decode_dct_block_10;
}
} else {
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
ctx->pix_fmt = AV_PIX_FMT_YUV422P;
ctx->avctx->bits_per_raw_sample = 8;
if (ctx->bit_depth != 8) {
ff_dsputil_init(&ctx->dsp, ctx->avctx);
@@ -348,7 +349,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame, int x, int
dest_u = frame->data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->is_444));
dest_v = frame->data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->is_444));
if (ctx->cur_field) {
if (frame->interlaced_frame && ctx->cur_field) {
dest_y += frame->linesize[0];
dest_u += frame->linesize[1];
dest_v += frame->linesize[2];
@@ -432,7 +433,13 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
avctx->width, avctx->height, ctx->width, ctx->height);
first_field = 1;
}
if (avctx->pix_fmt != AV_PIX_FMT_NONE && avctx->pix_fmt != ctx->pix_fmt) {
av_log(avctx, AV_LOG_WARNING, "pix_fmt changed: %s -> %s\n",
av_get_pix_fmt_name(avctx->pix_fmt), av_get_pix_fmt_name(ctx->pix_fmt));
first_field = 1;
}
avctx->pix_fmt = ctx->pix_fmt;
ret = ff_set_dimensions(avctx, ctx->width, ctx->height);
if (ret < 0)
return ret;

View File

@@ -45,8 +45,11 @@ static int dvdsub_parse(AVCodecParserContext *s,
DVDSubParseContext *pc = s->priv_data;
if (pc->packet_index == 0) {
if (buf_size < 2)
return 0;
if (buf_size < 2 || AV_RB16(buf) && buf_size < 6) {
if (buf_size)
av_log(avctx, AV_LOG_DEBUG, "Parser input %d too small\n", buf_size);
return buf_size;
}
pc->packet_len = AV_RB16(buf);
if (pc->packet_len == 0) /* HD-DVD subpicture packet */
pc->packet_len = AV_RB32(buf+2);

View File

@@ -37,7 +37,7 @@ typedef struct DVDSubContext
int has_palette;
uint8_t colormap[4];
uint8_t alpha[256];
uint8_t *buf;
uint8_t buf[0x10000];
int buf_size;
#ifdef DEBUG
int sub_id;
@@ -105,6 +105,12 @@ static int decode_rle(uint8_t *bitmap, int linesize, int w, int h,
int x, y, len, color;
uint8_t *d;
if (start >= buf_size)
return -1;
if (w <= 0 || h <= 0)
return -1;
bit_len = (buf_size - start) * 8;
init_get_bits(&gb, buf + start, bit_len);
@@ -356,10 +362,12 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
sub_header->rects[0] = av_mallocz(sizeof(AVSubtitleRect));
sub_header->num_rects = 1;
sub_header->rects[0]->pict.data[0] = bitmap;
decode_rle(bitmap, w * 2, w, (h + 1) / 2,
buf, offset1, buf_size, is_8bit);
decode_rle(bitmap + w, w * 2, w, h / 2,
buf, offset2, buf_size, is_8bit);
if (decode_rle(bitmap, w * 2, w, (h + 1) / 2,
buf, offset1, buf_size, is_8bit) < 0)
goto fail;
if (decode_rle(bitmap + w, w * 2, w, h / 2,
buf, offset2, buf_size, is_8bit) < 0)
goto fail;
sub_header->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
if (is_8bit) {
if (yuv_palette == 0)
@@ -494,15 +502,11 @@ static int append_to_cached_buf(AVCodecContext *avctx,
{
DVDSubContext *ctx = avctx->priv_data;
if (ctx->buf_size > 0xffff - buf_size) {
if (ctx->buf_size >= sizeof(ctx->buf) - buf_size) {
av_log(avctx, AV_LOG_WARNING, "Attempt to reconstruct "
"too large SPU packets aborted.\n");
av_freep(&ctx->buf);
return AVERROR_INVALIDDATA;
}
ctx->buf = av_realloc(ctx->buf, ctx->buf_size + buf_size);
if (!ctx->buf)
return AVERROR(ENOMEM);
memcpy(ctx->buf + ctx->buf_size, buf, buf_size);
ctx->buf_size += buf_size;
return 0;
@@ -518,7 +522,7 @@ static int dvdsub_decode(AVCodecContext *avctx,
AVSubtitle *sub = data;
int is_menu;
if (ctx->buf) {
if (ctx->buf_size) {
int ret = append_to_cached_buf(avctx, buf, buf_size);
if (ret < 0) {
*data_size = 0;
@@ -556,7 +560,6 @@ static int dvdsub_decode(AVCodecContext *avctx,
}
#endif
av_freep(&ctx->buf);
ctx->buf_size = 0;
*data_size = 1;
return buf_size;
@@ -638,7 +641,6 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
static av_cold int dvdsub_close(AVCodecContext *avctx)
{
DVDSubContext *ctx = avctx->priv_data;
av_freep(&ctx->buf);
ctx->buf_size = 0;
return 0;
}

View File

@@ -329,6 +329,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
{
DxaDecContext * const c = avctx->priv_data;
if (avctx->width%4 || avctx->height%4) {
avpriv_request_sample(avctx, "dimensions are not a multiple of 4");
return AVERROR_INVALIDDATA;
}
c->prev = av_frame_alloc();
if (!c->prev)
return AVERROR(ENOMEM);

View File

@@ -63,7 +63,7 @@ static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic,
uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V;
int ret;
if (src_size < avctx->width * avctx->height * 9L / 8) {
if (src_size < avctx->width * avctx->height * 9LL / 8) {
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
return AVERROR_INVALIDDATA;
}
@@ -106,7 +106,7 @@ static int dxtory_decode_v1_420(AVCodecContext *avctx, AVFrame *pic,
uint8_t *Y1, *Y2, *U, *V;
int ret;
if (src_size < avctx->width * avctx->height * 3L / 2) {
if (src_size < avctx->width * avctx->height * 3LL / 2) {
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
return AVERROR_INVALIDDATA;
}
@@ -143,7 +143,7 @@ static int dxtory_decode_v1_444(AVCodecContext *avctx, AVFrame *pic,
uint8_t *Y, *U, *V;
int ret;
if (src_size < avctx->width * avctx->height * 3L) {
if (src_size < avctx->width * avctx->height * 3LL) {
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
return AVERROR_INVALIDDATA;
}

View File

@@ -29,6 +29,7 @@
*/
#include "avcodec.h"
#include "bytestream.h"
#include "get_bits.h"
#include "aandcttab.h"
#include "eaidct.h"
@@ -144,6 +145,11 @@ static inline int decode_block_intra(MadContext *s, int16_t * block)
break;
} else if (level != 0) {
i += run;
if (i > 63) {
av_log(s->avctx, AV_LOG_ERROR,
"ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
j = scantable[i];
level = (level*quant_matrix[j]) >> 4;
level = (level-1)|1;
@@ -158,6 +164,11 @@ static inline int decode_block_intra(MadContext *s, int16_t * block)
run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
i += run;
if (i > 63) {
av_log(s->avctx, AV_LOG_ERROR,
"ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
j = scantable[i];
if (level < 0) {
level = -level;
@@ -169,10 +180,6 @@ static inline int decode_block_intra(MadContext *s, int16_t * block)
level = (level-1)|1;
}
}
if (i > 63) {
av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
block[j] = level;
}
@@ -237,30 +244,32 @@ static int decode_frame(AVCodecContext *avctx,
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
const uint8_t *buf_end = buf+buf_size;
MadContext *s = avctx->priv_data;
AVFrame *frame = data;
GetByteContext gb;
int width, height;
int chunk_type;
int inter, ret;
if (buf_size < 26) {
av_log(avctx, AV_LOG_ERROR, "Input buffer too small\n");
*got_frame = 0;
return AVERROR_INVALIDDATA;
}
bytestream2_init(&gb, buf, buf_size);
chunk_type = AV_RL32(&buf[0]);
chunk_type = bytestream2_get_le32(&gb);
inter = (chunk_type == MADm_TAG || chunk_type == MADe_TAG);
buf += 8;
bytestream2_skip(&gb, 10);
av_reduce(&avctx->time_base.num, &avctx->time_base.den,
AV_RL16(&buf[6]), 1000, 1<<30);
bytestream2_get_le16(&gb), 1000, 1<<30);
width = AV_RL16(&buf[8]);
height = AV_RL16(&buf[10]);
calc_quant_matrix(s, buf[13]);
buf += 16;
width = bytestream2_get_le16(&gb);
height = bytestream2_get_le16(&gb);
bytestream2_skip(&gb, 1);
calc_quant_matrix(s, bytestream2_get_byte(&gb));
bytestream2_skip(&gb, 2);
if (bytestream2_get_bytes_left(&gb) < 2) {
av_log(avctx, AV_LOG_ERROR, "Input data too small\n");
return AVERROR_INVALIDDATA;
}
if (width < 16 || height < 16) {
av_log(avctx, AV_LOG_ERROR, "Dimensions too small\n");
@@ -269,7 +278,7 @@ static int decode_frame(AVCodecContext *avctx,
if (avctx->width != width || avctx->height != height) {
av_frame_unref(s->last_frame);
if((width * height)/2048*7 > buf_end-buf)
if((width * height)/2048*7 > bytestream2_get_bytes_left(&gb))
return AVERROR_INVALIDDATA;
if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
return ret;
@@ -292,12 +301,13 @@ static int decode_frame(AVCodecContext *avctx,
}
av_fast_padded_malloc(&s->bitstream_buf, &s->bitstream_buf_size,
buf_end - buf);
bytestream2_get_bytes_left(&gb));
if (!s->bitstream_buf)
return AVERROR(ENOMEM);
s->dsp.bswap16_buf(s->bitstream_buf, (const uint16_t*)buf, (buf_end-buf)/2);
memset((uint8_t*)s->bitstream_buf + (buf_end-buf), 0, FF_INPUT_BUFFER_PADDING_SIZE);
init_get_bits(&s->gb, s->bitstream_buf, 8*(buf_end-buf));
s->dsp.bswap16_buf(s->bitstream_buf, (const uint16_t *)(buf + bytestream2_tell(&gb)),
bytestream2_get_bytes_left(&gb) / 2);
memset((uint8_t*)s->bitstream_buf + bytestream2_get_bytes_left(&gb), 0, FF_INPUT_BUFFER_PADDING_SIZE);
init_get_bits(&s->gb, s->bitstream_buf, 8*(bytestream2_get_bytes_left(&gb)));
for (s->mb_y=0; s->mb_y < (avctx->height+15)/16; s->mb_y++)
for (s->mb_x=0; s->mb_x < (avctx->width +15)/16; s->mb_x++)

View File

@@ -251,7 +251,7 @@ static void put_line(uint8_t *dst, int size, int width, const int *runs)
PutBitContext pb;
int run, mode = ~0, pix_left = width, run_idx = 0;
init_put_bits(&pb, dst, size * 8);
init_put_bits(&pb, dst, size);
while (pix_left > 0) {
run = runs[run_idx++];
mode = ~mode;

View File

@@ -117,6 +117,7 @@ static void fft_ref(FFTComplex *tabr, FFTComplex *tab, int nbits)
}
}
#if CONFIG_MDCT
static void imdct_ref(FFTSample *out, FFTSample *in, int nbits)
{
int n = 1<<nbits;
@@ -151,8 +152,10 @@ static void mdct_ref(FFTSample *output, FFTSample *input, int nbits)
output[k] = REF_SCALE(s, nbits - 1);
}
}
#endif /* CONFIG_MDCT */
#if FFT_FLOAT
#if CONFIG_DCT
static void idct_ref(FFTSample *output, FFTSample *input, int nbits)
{
int n = 1<<nbits;
@@ -185,6 +188,7 @@ static void dct_ref(FFTSample *output, FFTSample *input, int nbits)
output[k] = s;
}
}
#endif /* CONFIG_DCT */
#endif
@@ -310,6 +314,7 @@ int main(int argc, char **argv)
tab2 = av_malloc(fft_size * sizeof(FFTSample));
switch (transform) {
#if CONFIG_MDCT
case TRANSFORM_MDCT:
av_log(NULL, AV_LOG_INFO,"Scale factor is set to %f\n", scale);
if (do_inverse)
@@ -318,6 +323,7 @@ int main(int argc, char **argv)
av_log(NULL, AV_LOG_INFO,"MDCT");
ff_mdct_init(m, fft_nbits, do_inverse, scale);
break;
#endif /* CONFIG_MDCT */
case TRANSFORM_FFT:
if (do_inverse)
av_log(NULL, AV_LOG_INFO,"IFFT");
@@ -327,6 +333,7 @@ int main(int argc, char **argv)
fft_ref_init(fft_nbits, do_inverse);
break;
#if FFT_FLOAT
# if CONFIG_RDFT
case TRANSFORM_RDFT:
if (do_inverse)
av_log(NULL, AV_LOG_INFO,"IDFT_C2R");
@@ -335,6 +342,7 @@ int main(int argc, char **argv)
ff_rdft_init(r, fft_nbits, do_inverse ? IDFT_C2R : DFT_R2C);
fft_ref_init(fft_nbits, do_inverse);
break;
# endif /* CONFIG_RDFT */
# if CONFIG_DCT
case TRANSFORM_DCT:
if (do_inverse)
@@ -343,7 +351,7 @@ int main(int argc, char **argv)
av_log(NULL, AV_LOG_INFO,"DCT_II");
ff_dct_init(d, fft_nbits, do_inverse ? DCT_III : DCT_II);
break;
# endif
# endif /* CONFIG_DCT */
#endif
default:
av_log(NULL, AV_LOG_ERROR, "Requested transform not supported\n");
@@ -362,6 +370,7 @@ int main(int argc, char **argv)
av_log(NULL, AV_LOG_INFO,"Checking...\n");
switch (transform) {
#if CONFIG_MDCT
case TRANSFORM_MDCT:
if (do_inverse) {
imdct_ref((FFTSample *)tab_ref, (FFTSample *)tab1, fft_nbits);
@@ -375,6 +384,7 @@ int main(int argc, char **argv)
err = check_diff((FFTSample *)tab_ref, tab2, fft_size / 2, scale);
}
break;
#endif /* CONFIG_MDCT */
case TRANSFORM_FFT:
memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
s->fft_permute(s, tab);
@@ -384,6 +394,7 @@ int main(int argc, char **argv)
err = check_diff((FFTSample *)tab_ref, (FFTSample *)tab, fft_size * 2, 1.0);
break;
#if FFT_FLOAT
#if CONFIG_RDFT
case TRANSFORM_RDFT:
fft_size_2 = fft_size >> 1;
if (do_inverse) {
@@ -415,6 +426,8 @@ int main(int argc, char **argv)
err = check_diff((float *)tab_ref, (float *)tab2, fft_size, 1.0);
}
break;
#endif /* CONFIG_RDFT */
#if CONFIG_DCT
case TRANSFORM_DCT:
memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
d->dct_calc(d, (FFTSample *)tab);
@@ -425,6 +438,7 @@ int main(int argc, char **argv)
}
err = check_diff((float *)tab_ref, (float *)tab, fft_size, 1.0);
break;
#endif /* CONFIG_DCT */
#endif
}
@@ -476,21 +490,25 @@ int main(int argc, char **argv)
}
switch (transform) {
#if CONFIG_MDCT
case TRANSFORM_MDCT:
ff_mdct_end(m);
break;
#endif /* CONFIG_MDCT */
case TRANSFORM_FFT:
ff_fft_end(s);
break;
#if FFT_FLOAT
# if CONFIG_RDFT
case TRANSFORM_RDFT:
ff_rdft_end(r);
break;
# endif /* CONFIG_RDFT */
# if CONFIG_DCT
case TRANSFORM_DCT:
ff_dct_end(d);
break;
# endif
# endif /* CONFIG_DCT */
#endif
}

View File

@@ -103,7 +103,7 @@ av_cold int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
av_cold int ffv1_init_slices_state(FFV1Context *f)
{
int i, ret;
for (i = 0; i < f->slice_count; i++) {
for (i = 0; i < f->max_slice_count; i++) {
FFV1Context *fs = f->slice_context[i];
if ((ret = ffv1_init_slice_state(f, fs)) < 0)
return AVERROR(ENOMEM);
@@ -115,10 +115,10 @@ av_cold int ffv1_init_slice_contexts(FFV1Context *f)
{
int i;
f->slice_count = f->num_h_slices * f->num_v_slices;
av_assert0(f->slice_count > 0);
f->max_slice_count = f->num_h_slices * f->num_v_slices;
av_assert0(f->max_slice_count > 0);
for (i = 0; i < f->slice_count; i++) {
for (i = 0; i < f->max_slice_count; i++) {
FFV1Context *fs = av_mallocz(sizeof(*fs));
int sx = i % f->num_h_slices;
int sy = i / f->num_h_slices;
@@ -203,7 +203,7 @@ av_cold int ffv1_close(AVCodecContext *avctx)
ff_thread_release_buffer(avctx, &s->last_picture);
av_frame_free(&s->last_picture.f);
for (j = 0; j < s->slice_count; j++) {
for (j = 0; j < s->max_slice_count; j++) {
FFV1Context *fs = s->slice_context[j];
for (i = 0; i < s->plane_count; i++) {
PlaneContext *p = &fs->plane[i];
@@ -217,14 +217,14 @@ av_cold int ffv1_close(AVCodecContext *avctx)
av_freep(&avctx->stats_out);
for (j = 0; j < s->quant_table_count; j++) {
av_freep(&s->initial_states[j]);
for (i = 0; i < s->slice_count; i++) {
for (i = 0; i < s->max_slice_count; i++) {
FFV1Context *sf = s->slice_context[i];
av_freep(&sf->rc_stat2[j]);
}
av_freep(&s->rc_stat2[j]);
}
for (i = 0; i < s->slice_count; i++)
for (i = 0; i < s->max_slice_count; i++)
av_freep(&s->slice_context[i]);
return 0;

View File

@@ -122,6 +122,7 @@ typedef struct FFV1Context {
struct FFV1Context *slice_context[MAX_SLICES];
int slice_count;
int max_slice_count;
int num_v_slices;
int num_h_slices;
int slice_width;

View File

@@ -536,6 +536,12 @@ static int read_extra_header(FFV1Context *f)
f->num_h_slices = 1 + get_symbol(c, state, 0);
f->num_v_slices = 1 + get_symbol(c, state, 0);
if (f->chroma_h_shift > 4U || f->chroma_v_shift > 4U) {
av_log(f->avctx, AV_LOG_ERROR, "chroma shift parameters %d %d are invalid\n",
f->chroma_h_shift, f->chroma_v_shift);
return AVERROR_INVALIDDATA;
}
if (f->num_h_slices > (unsigned)f->width || !f->num_h_slices ||
f->num_v_slices > (unsigned)f->height || !f->num_v_slices
) {
@@ -544,8 +550,11 @@ static int read_extra_header(FFV1Context *f)
}
f->quant_table_count = get_symbol(c, state, 0);
if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES)
if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES || !f->quant_table_count) {
av_log(f->avctx, AV_LOG_ERROR, "quant table count %d is invalid\n", f->quant_table_count);
f->quant_table_count = 0;
return AVERROR_INVALIDDATA;
}
for (i = 0; i < f->quant_table_count; i++) {
f->context_count[i] = read_quant_tables(c, f->quant_tables[i]);
@@ -622,31 +631,37 @@ static int read_header(FFV1Context *f)
f->state_transition[i] = get_symbol(c, state, 1) + c->one_state[i];
}
colorspace = get_symbol(c, state, 0); //YUV cs type
colorspace = get_symbol(c, state, 0); //YUV cs type
bits_per_raw_sample = f->version > 0 ? get_symbol(c, state, 0) : f->avctx->bits_per_raw_sample;
chroma_planes = get_rac(c, state);
chroma_h_shift = get_symbol(c, state, 0);
chroma_v_shift = get_symbol(c, state, 0);
transparency = get_rac(c, state);
chroma_planes = get_rac(c, state);
chroma_h_shift = get_symbol(c, state, 0);
chroma_v_shift = get_symbol(c, state, 0);
transparency = get_rac(c, state);
if (f->plane_count) {
if ( colorspace != f->colorspace
|| bits_per_raw_sample != f->avctx->bits_per_raw_sample
|| chroma_planes != f->chroma_planes
|| chroma_h_shift!= f->chroma_h_shift
|| chroma_v_shift!= f->chroma_v_shift
|| transparency != f->transparency) {
if (colorspace != f->colorspace ||
bits_per_raw_sample != f->avctx->bits_per_raw_sample ||
chroma_planes != f->chroma_planes ||
chroma_h_shift != f->chroma_h_shift ||
chroma_v_shift != f->chroma_v_shift ||
transparency != f->transparency) {
av_log(f->avctx, AV_LOG_ERROR, "Invalid change of global parameters\n");
return AVERROR_INVALIDDATA;
}
}
f->colorspace = colorspace;
if (chroma_h_shift > 4U || chroma_v_shift > 4U) {
av_log(f->avctx, AV_LOG_ERROR, "chroma shift parameters %d %d are invalid\n",
chroma_h_shift, chroma_v_shift);
return AVERROR_INVALIDDATA;
}
f->colorspace = colorspace;
f->avctx->bits_per_raw_sample = bits_per_raw_sample;
f->chroma_planes = chroma_planes;
f->chroma_h_shift = chroma_h_shift;
f->chroma_v_shift = chroma_v_shift;
f->transparency = transparency;
f->chroma_planes = chroma_planes;
f->chroma_h_shift = chroma_h_shift;
f->chroma_v_shift = chroma_v_shift;
f->transparency = transparency;
f->plane_count = 2 + f->transparency;
}
@@ -748,6 +763,7 @@ static int read_header(FFV1Context *f)
av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n");
return AVERROR_INVALIDDATA;
}
f->slice_count = f->max_slice_count;
} else if (f->version < 3) {
f->slice_count = get_symbol(c, state, 0);
} else {
@@ -762,8 +778,8 @@ static int read_header(FFV1Context *f)
p -= size + trailer;
}
}
if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0) {
av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid\n", f->slice_count);
if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0 || f->slice_count > f->max_slice_count) {
av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid (max=%d)\n", f->slice_count, f->max_slice_count);
return AVERROR_INVALIDDATA;
}
@@ -986,6 +1002,7 @@ static int init_thread_copy(AVCodecContext *avctx)
f->picture.f = NULL;
f->last_picture.f = NULL;
f->sample_buffer = NULL;
f->max_slice_count = 0;
f->slice_count = 0;
for (i = 0; i < f->quant_table_count; i++) {
@@ -1056,7 +1073,7 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
av_assert0(!fdst->sample_buffer);
}
av_assert1(fdst->slice_count == fsrc->slice_count);
av_assert1(fdst->max_slice_count == fsrc->max_slice_count);
ff_thread_release_buffer(dst, &fdst->picture);

View File

@@ -955,6 +955,7 @@ slices_ok:
if ((ret = ffv1_init_slice_contexts(s)) < 0)
return ret;
s->slice_count = s->max_slice_count;
if ((ret = ffv1_init_slices_state(s)) < 0)
return ret;
@@ -964,7 +965,7 @@ slices_ok:
if (!avctx->stats_out)
return AVERROR(ENOMEM);
for (i = 0; i < s->quant_table_count; i++)
for (j = 0; j < s->slice_count; j++) {
for (j = 0; j < s->max_slice_count; j++) {
FFV1Context *sf = s->slice_context[j];
av_assert0(!sf->rc_stat2[i]);
sf->rc_stat2[i] = av_mallocz(s->context_count[i] *
@@ -1188,6 +1189,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
for (i = 0; i < f->quant_table_count; i++)
memset(f->rc_stat2[i], 0, f->context_count[i] * sizeof(*f->rc_stat2[i]));
av_assert0(f->slice_count == f->max_slice_count);
for (j = 0; j < f->slice_count; j++) {
FFV1Context *fs = f->slice_context[j];
for (i = 0; i < 256; i++) {

View File

@@ -166,6 +166,10 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
if (memcmp(src, fic_header, 7))
av_log(avctx, AV_LOG_WARNING, "Invalid FIC Header.\n");
/* Is it a skip frame? */
if (src[17])
goto skip;
nslices = src[13];
if (!nslices) {
av_log(avctx, AV_LOG_ERROR, "Zero slices found.\n");
@@ -242,10 +246,11 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
ctx->slice_data[slice].y_off = y_off;
}
if (ret = avctx->execute(avctx, fic_decode_slice, ctx->slice_data,
NULL, nslices, sizeof(ctx->slice_data[0])) < 0)
if ((ret = avctx->execute(avctx, fic_decode_slice, ctx->slice_data,
NULL, nslices, sizeof(ctx->slice_data[0]))) < 0)
return ret;
skip:
*got_frame = 1;
if ((ret = av_frame_ref(data, ctx->frame)) < 0)
return ret;

View File

@@ -685,7 +685,7 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
handle_error:
*poutbuf = NULL;
*poutbuf_size = 0;
return read_end - buf;
return buf_size ? read_end - buf : 0;
}
static av_cold int flac_parse_init(AVCodecParserContext *c)

View File

@@ -471,10 +471,10 @@ static int decode_frame(FLACContext *s)
ret = allocate_buffers(s);
if (ret < 0)
return ret;
ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
s->got_streaminfo = 1;
dump_headers(s->avctx, (FLACStreaminfo *)s);
}
ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
// dump_headers(s->avctx, (FLACStreaminfo *)s);

View File

@@ -287,7 +287,7 @@ static int write_header(FlashSV2Context * s, uint8_t * buf, int buf_size)
if (buf_size < 5)
return -1;
init_put_bits(&pb, buf, buf_size * 8);
init_put_bits(&pb, buf, buf_size);
put_bits(&pb, 4, (s->block_width >> 4) - 1);
put_bits(&pb, 12, s->image_width);

View File

@@ -151,7 +151,7 @@ static int encode_bitstream(FlashSVContext *s, const AVFrame *p, uint8_t *buf,
int buf_pos, res;
int pred_blocks = 0;
init_put_bits(&pb, buf, buf_size * 8);
init_put_bits(&pb, buf, buf_size);
put_bits(&pb, 4, block_width / 16 - 1);
put_bits(&pb, 12, s->image_width);

View File

@@ -87,6 +87,7 @@ typedef struct G2MContext {
int compression;
int width, height, bpp;
int orig_width, orig_height;
int tile_width, tile_height;
int tiles_x, tiles_y, tile_x, tile_y;
@@ -691,6 +692,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
}
switch (chunk_type) {
case DISPLAY_INFO:
got_header =
c->got_header = 0;
if (chunk_size < 21) {
av_log(avctx, AV_LOG_ERROR, "Invalid display info size %d\n",
@@ -699,8 +701,8 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
}
c->width = bytestream2_get_be32(&bc);
c->height = bytestream2_get_be32(&bc);
if (c->width < 16 || c->width > avctx->width ||
c->height < 16 || c->height > avctx->height) {
if (c->width < 16 || c->width > c->orig_width ||
c->height < 16 || c->height > c->orig_height) {
av_log(avctx, AV_LOG_ERROR,
"Invalid frame dimensions %dx%d\n",
c->width, c->height);
@@ -717,12 +719,15 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR,
"Unknown compression method %d\n",
c->compression);
return AVERROR_PATCHWELCOME;
ret = AVERROR_PATCHWELCOME;
goto header_fail;
}
c->tile_width = bytestream2_get_be32(&bc);
c->tile_height = bytestream2_get_be32(&bc);
if (!c->tile_width || !c->tile_height ||
((c->tile_width | c->tile_height) & 0xF)) {
if (c->tile_width <= 0 || c->tile_height <= 0 ||
((c->tile_width | c->tile_height) & 0xF) ||
c->tile_width * 4LL * c->tile_height >= INT_MAX
) {
av_log(avctx, AV_LOG_ERROR,
"Invalid tile dimensions %dx%d\n",
c->tile_width, c->tile_height);
@@ -737,7 +742,8 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
(chunk_size - 21) < 16 ) {
av_log(avctx, AV_LOG_ERROR,
"Display info: missing bitmasks!\n");
return AVERROR_INVALIDDATA;
ret = AVERROR_INVALIDDATA;
goto header_fail;
}
r_mask = bytestream2_get_be32(&bc);
g_mask = bytestream2_get_be32(&bc);
@@ -746,11 +752,13 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR,
"Invalid or unsupported bitmasks: R=%X, G=%X, B=%X\n",
r_mask, g_mask, b_mask);
return AVERROR_PATCHWELCOME;
ret = AVERROR_PATCHWELCOME;
goto header_fail;
}
} else {
avpriv_request_sample(avctx, "bpp=%d", c->bpp);
return AVERROR_PATCHWELCOME;
ret = AVERROR_PATCHWELCOME;
goto header_fail;
}
if (g2m_init_buffers(c)) {
ret = AVERROR(ENOMEM);
@@ -862,6 +870,10 @@ static av_cold int g2m_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_RGB24;
// store original sizes and check against those if resize happens
c->orig_width = avctx->width;
c->orig_height = avctx->height;
return 0;
}

View File

@@ -2285,7 +2285,8 @@ static int pack_bitstream(G723_1_Context *p, unsigned char *frame, int size)
if (p->cur_rate == RATE_6300) {
info_bits = 0;
put_bits(&pb, 2, info_bits);
}
}else
av_assert0(0);
put_bits(&pb, 8, p->lsp_index[2]);
put_bits(&pb, 8, p->lsp_index[1]);

View File

@@ -105,7 +105,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
/* skip common columns */
while (x_start < x_end) {
int same_column = 1;
for (y = y_start; y < y_end; y++) {
for (y = y_start; y <= y_end; y++) {
if (ref[y*ref_linesize + x_start] != buf[y*linesize + x_start]) {
same_column = 0;
break;
@@ -117,7 +117,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
}
while (x_end > x_start) {
int same_column = 1;
for (y = y_start; y < y_end; y++) {
for (y = y_start; y <= y_end; y++) {
if (ref[y*ref_linesize + x_end] != buf[y*linesize + x_end]) {
same_column = 0;
break;

View File

@@ -258,26 +258,21 @@ static int gif_read_image(GifState *s, AVFrame *frame)
case 1:
y1 += 8;
ptr += linesize * 8;
if (y1 >= height) {
y1 = pass ? 2 : 4;
ptr = ptr1 + linesize * y1;
pass++;
}
break;
case 2:
y1 += 4;
ptr += linesize * 4;
if (y1 >= height) {
y1 = 1;
ptr = ptr1 + linesize;
pass++;
}
break;
case 3:
y1 += 2;
ptr += linesize * 2;
break;
}
while (y1 >= height) {
y1 = 4 >> pass;
ptr = ptr1 + linesize * y1;
pass++;
}
} else {
ptr += linesize;
}

View File

@@ -58,7 +58,7 @@ int main(void)
}
}
#define EXTEND(i) (i << 3 | i & 7)
#define EXTEND(i) ((i) << 3 | (i) & 7)
init_put_bits(&pb, temp, SIZE);
for (i = 0; i < COUNT; i++)
set_ue_golomb(&pb, EXTEND(i));

Some files were not shown because too many files have changed in this diff Show More