Compare commits

..

77 Commits

Author SHA1 Message Date
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
40 changed files with 305 additions and 154 deletions

View File

@@ -1,6 +1,23 @@
Entries are sorted chronologically from oldest to youngest within each release, Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest. releases are sorted from youngest to oldest.
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: version 2.2:
- HNM version 4 demuxer and video decoder - HNM version 4 demuxer and video decoder
- Live HDS muxer - Live HDS muxer

View File

@@ -1 +1 @@
2.2.5 2.2.7

View File

@@ -1 +0,0 @@
2.2.5

View File

@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
# This could be handy for archiving the generated documentation or # This could be handy for archiving the generated documentation or
# if some version control system is used. # if some version control system is used.
PROJECT_NUMBER = 2.2.5 PROJECT_NUMBER = 2.2.7
# With the PROJECT_LOGO tag one can specify a logo or icon that is included # 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 # in the documentation. The maximum height of the logo should not exceed 55

View File

@@ -828,6 +828,12 @@ static int configure_input_filter(FilterGraph *fg, InputFilter *ifilter,
av_freep(&ifilter->name); av_freep(&ifilter->name);
DESCRIBE_FILTER_LINK(ifilter, in, 1); 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)) { 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_VIDEO: return configure_input_video_filter(fg, ifilter, in);
case AVMEDIA_TYPE_AUDIO: return configure_input_audio_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 */ /* pick the "best" stream of each type */
/* video: highest resolution */ /* 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 area = 0, idx = -1;
int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0); int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0);
for (i = 0; i < nb_input_streams; i++) { 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 */ /* 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; int channels = 0, idx = -1;
for (i = 0; i < nb_input_streams; i++) { for (i = 0; i < nb_input_streams; i++) {
ist = input_streams[i]; ist = input_streams[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 (j = 0; j < nb_input_files; j++) {
for (i = 0; i < input_files[j]->nb_streams; i++) { for (i = 0; i < input_files[j]->nb_streams; i++) {
AVCodecContext *c = input_files[j]->ctx->streams[i]->codec; 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; continue;
fr = c->time_base.den * 1000 / c->time_base.num; fr = c->time_base.den * 1000 / c->time_base.num;
if (fr == 25000) { if (fr == 25000) {

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); AVDictionaryEntry *entry = av_dict_get(stream->metadata, "title", NULL, 0);
int i; int i;
*pbuffer = NULL;
avc = avformat_alloc_context(); avc = avformat_alloc_context();
if (avc == NULL || !rtp_format) { if (avc == NULL || !rtp_format) {
return -1; return -1;
@@ -3025,7 +3027,7 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
av_free(avc); av_free(avc);
av_free(avs); av_free(avs);
return strlen(*pbuffer); return *pbuffer ? strlen(*pbuffer) : AVERROR(ENOMEM);
} }
static void rtsp_cmd_options(HTTPContext *c, const char *url) static void rtsp_cmd_options(HTTPContext *c, const char *url)

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(); 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; c->h264_find_start_code_candidate = ff_h264_find_start_code_candidate_armv6;
}
if (have_neon(cpu_flags)) if (have_neon(cpu_flags))
h264dsp_init_neon(c, bit_depth, chroma_format_idc); h264dsp_init_neon(c, bit_depth, chroma_format_idc);
} }

View File

@@ -261,7 +261,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data,
static int cdg_decode_frame(AVCodecContext *avctx, static int cdg_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame, AVPacket *avpkt) void *data, int *got_frame, AVPacket *avpkt)
{ {
const uint8_t *buf = avpkt->data; GetByteContext gb;
int buf_size = avpkt->size; int buf_size = avpkt->size;
int ret; int ret;
uint8_t command, inst; uint8_t command, inst;
@@ -278,6 +278,8 @@ static int cdg_decode_frame(AVCodecContext *avctx,
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
bytestream2_init(&gb, avpkt->data, avpkt->size);
if ((ret = ff_reget_buffer(avctx, cc->frame)) < 0) if ((ret = ff_reget_buffer(avctx, cc->frame)) < 0)
return ret; return ret;
if (!avctx->frame_number) { if (!avctx->frame_number) {
@@ -285,13 +287,11 @@ static int cdg_decode_frame(AVCodecContext *avctx,
memset(cc->frame->data[1], 0, AVPALETTE_SIZE); memset(cc->frame->data[1], 0, AVPALETTE_SIZE);
} }
command = bytestream_get_byte(&buf); command = bytestream2_get_byte(&gb);
inst = bytestream_get_byte(&buf); inst = bytestream2_get_byte(&gb);
inst &= CDG_MASK; inst &= CDG_MASK;
buf += 2; /// skipping 2 unneeded bytes bytestream2_skip(&gb, 2);
bytestream2_get_buffer(&gb, cdg_data, sizeof(cdg_data));
if (buf_size > CDG_HEADER_SIZE)
bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
if ((command & CDG_MASK) == CDG_COMMAND) { if ((command & CDG_MASK) == CDG_COMMAND) {
switch (inst) { switch (inst) {
@@ -353,10 +353,9 @@ static int cdg_decode_frame(AVCodecContext *avctx,
*got_frame = 1; *got_frame = 1;
} else { } else {
*got_frame = 0; *got_frame = 0;
buf_size = 0;
} }
return buf_size; return avpkt->size;
} }
static av_cold int cdg_decode_end(AVCodecContext *avctx) static av_cold int cdg_decode_end(AVCodecContext *avctx)

View File

@@ -45,8 +45,11 @@ static int dvdsub_parse(AVCodecParserContext *s,
DVDSubParseContext *pc = s->priv_data; DVDSubParseContext *pc = s->priv_data;
if (pc->packet_index == 0) { if (pc->packet_index == 0) {
if (buf_size < 2) if (buf_size < 2 || AV_RB16(buf) && buf_size < 6) {
return 0; 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); pc->packet_len = AV_RB16(buf);
if (pc->packet_len == 0) /* HD-DVD subpicture packet */ if (pc->packet_len == 0) /* HD-DVD subpicture packet */
pc->packet_len = AV_RB32(buf+2); pc->packet_len = AV_RB32(buf+2);

View File

@@ -29,6 +29,7 @@
*/ */
#include "avcodec.h" #include "avcodec.h"
#include "bytestream.h"
#include "get_bits.h" #include "get_bits.h"
#include "aandcttab.h" #include "aandcttab.h"
#include "eaidct.h" #include "eaidct.h"
@@ -237,30 +238,32 @@ static int decode_frame(AVCodecContext *avctx,
{ {
const uint8_t *buf = avpkt->data; const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size; int buf_size = avpkt->size;
const uint8_t *buf_end = buf+buf_size;
MadContext *s = avctx->priv_data; MadContext *s = avctx->priv_data;
AVFrame *frame = data; AVFrame *frame = data;
GetByteContext gb;
int width, height; int width, height;
int chunk_type; int chunk_type;
int inter, ret; int inter, ret;
if (buf_size < 26) { bytestream2_init(&gb, buf, buf_size);
av_log(avctx, AV_LOG_ERROR, "Input buffer too small\n");
*got_frame = 0;
return AVERROR_INVALIDDATA;
}
chunk_type = AV_RL32(&buf[0]); chunk_type = bytestream2_get_le32(&gb);
inter = (chunk_type == MADm_TAG || chunk_type == MADe_TAG); 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_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]); width = bytestream2_get_le16(&gb);
height = AV_RL16(&buf[10]); height = bytestream2_get_le16(&gb);
calc_quant_matrix(s, buf[13]); bytestream2_skip(&gb, 1);
buf += 16; 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) { if (width < 16 || height < 16) {
av_log(avctx, AV_LOG_ERROR, "Dimensions too small\n"); av_log(avctx, AV_LOG_ERROR, "Dimensions too small\n");
@@ -269,7 +272,7 @@ static int decode_frame(AVCodecContext *avctx,
if (avctx->width != width || avctx->height != height) { if (avctx->width != width || avctx->height != height) {
av_frame_unref(s->last_frame); 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; return AVERROR_INVALIDDATA;
if ((ret = ff_set_dimensions(avctx, width, height)) < 0) if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
return ret; return ret;
@@ -292,12 +295,13 @@ static int decode_frame(AVCodecContext *avctx,
} }
av_fast_padded_malloc(&s->bitstream_buf, &s->bitstream_buf_size, av_fast_padded_malloc(&s->bitstream_buf, &s->bitstream_buf_size,
buf_end - buf); bytestream2_get_bytes_left(&gb));
if (!s->bitstream_buf) if (!s->bitstream_buf)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
s->dsp.bswap16_buf(s->bitstream_buf, (const uint16_t*)buf, (buf_end-buf)/2); s->dsp.bswap16_buf(s->bitstream_buf, (const uint16_t *)(buf + bytestream2_tell(&gb)),
memset((uint8_t*)s->bitstream_buf + (buf_end-buf), 0, FF_INPUT_BUFFER_PADDING_SIZE); bytestream2_get_bytes_left(&gb) / 2);
init_get_bits(&s->gb, s->bitstream_buf, 8*(buf_end-buf)); 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_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++) for (s->mb_x=0; s->mb_x < (avctx->width +15)/16; s->mb_x++)

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) static void imdct_ref(FFTSample *out, FFTSample *in, int nbits)
{ {
int n = 1<<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); output[k] = REF_SCALE(s, nbits - 1);
} }
} }
#endif /* CONFIG_MDCT */
#if FFT_FLOAT #if FFT_FLOAT
#if CONFIG_DCT
static void idct_ref(FFTSample *output, FFTSample *input, int nbits) static void idct_ref(FFTSample *output, FFTSample *input, int nbits)
{ {
int n = 1<<nbits; int n = 1<<nbits;
@@ -185,6 +188,7 @@ static void dct_ref(FFTSample *output, FFTSample *input, int nbits)
output[k] = s; output[k] = s;
} }
} }
#endif /* CONFIG_DCT */
#endif #endif
@@ -310,6 +314,7 @@ int main(int argc, char **argv)
tab2 = av_malloc(fft_size * sizeof(FFTSample)); tab2 = av_malloc(fft_size * sizeof(FFTSample));
switch (transform) { switch (transform) {
#if CONFIG_MDCT
case TRANSFORM_MDCT: case TRANSFORM_MDCT:
av_log(NULL, AV_LOG_INFO,"Scale factor is set to %f\n", scale); av_log(NULL, AV_LOG_INFO,"Scale factor is set to %f\n", scale);
if (do_inverse) if (do_inverse)
@@ -318,6 +323,7 @@ int main(int argc, char **argv)
av_log(NULL, AV_LOG_INFO,"MDCT"); av_log(NULL, AV_LOG_INFO,"MDCT");
ff_mdct_init(m, fft_nbits, do_inverse, scale); ff_mdct_init(m, fft_nbits, do_inverse, scale);
break; break;
#endif /* CONFIG_MDCT */
case TRANSFORM_FFT: case TRANSFORM_FFT:
if (do_inverse) if (do_inverse)
av_log(NULL, AV_LOG_INFO,"IFFT"); av_log(NULL, AV_LOG_INFO,"IFFT");
@@ -327,6 +333,7 @@ int main(int argc, char **argv)
fft_ref_init(fft_nbits, do_inverse); fft_ref_init(fft_nbits, do_inverse);
break; break;
#if FFT_FLOAT #if FFT_FLOAT
# if CONFIG_RDFT
case TRANSFORM_RDFT: case TRANSFORM_RDFT:
if (do_inverse) if (do_inverse)
av_log(NULL, AV_LOG_INFO,"IDFT_C2R"); 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); ff_rdft_init(r, fft_nbits, do_inverse ? IDFT_C2R : DFT_R2C);
fft_ref_init(fft_nbits, do_inverse); fft_ref_init(fft_nbits, do_inverse);
break; break;
# endif /* CONFIG_RDFT */
# if CONFIG_DCT # if CONFIG_DCT
case TRANSFORM_DCT: case TRANSFORM_DCT:
if (do_inverse) if (do_inverse)
@@ -343,7 +351,7 @@ int main(int argc, char **argv)
av_log(NULL, AV_LOG_INFO,"DCT_II"); av_log(NULL, AV_LOG_INFO,"DCT_II");
ff_dct_init(d, fft_nbits, do_inverse ? DCT_III : DCT_II); ff_dct_init(d, fft_nbits, do_inverse ? DCT_III : DCT_II);
break; break;
# endif # endif /* CONFIG_DCT */
#endif #endif
default: default:
av_log(NULL, AV_LOG_ERROR, "Requested transform not supported\n"); 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"); av_log(NULL, AV_LOG_INFO,"Checking...\n");
switch (transform) { switch (transform) {
#if CONFIG_MDCT
case TRANSFORM_MDCT: case TRANSFORM_MDCT:
if (do_inverse) { if (do_inverse) {
imdct_ref((FFTSample *)tab_ref, (FFTSample *)tab1, fft_nbits); 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); err = check_diff((FFTSample *)tab_ref, tab2, fft_size / 2, scale);
} }
break; break;
#endif /* CONFIG_MDCT */
case TRANSFORM_FFT: case TRANSFORM_FFT:
memcpy(tab, tab1, fft_size * sizeof(FFTComplex)); memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
s->fft_permute(s, tab); 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); err = check_diff((FFTSample *)tab_ref, (FFTSample *)tab, fft_size * 2, 1.0);
break; break;
#if FFT_FLOAT #if FFT_FLOAT
#if CONFIG_RDFT
case TRANSFORM_RDFT: case TRANSFORM_RDFT:
fft_size_2 = fft_size >> 1; fft_size_2 = fft_size >> 1;
if (do_inverse) { 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); err = check_diff((float *)tab_ref, (float *)tab2, fft_size, 1.0);
} }
break; break;
#endif /* CONFIG_RDFT */
#if CONFIG_DCT
case TRANSFORM_DCT: case TRANSFORM_DCT:
memcpy(tab, tab1, fft_size * sizeof(FFTComplex)); memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
d->dct_calc(d, (FFTSample *)tab); 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); err = check_diff((float *)tab_ref, (float *)tab, fft_size, 1.0);
break; break;
#endif /* CONFIG_DCT */
#endif #endif
} }
@@ -476,21 +490,25 @@ int main(int argc, char **argv)
} }
switch (transform) { switch (transform) {
#if CONFIG_MDCT
case TRANSFORM_MDCT: case TRANSFORM_MDCT:
ff_mdct_end(m); ff_mdct_end(m);
break; break;
#endif /* CONFIG_MDCT */
case TRANSFORM_FFT: case TRANSFORM_FFT:
ff_fft_end(s); ff_fft_end(s);
break; break;
#if FFT_FLOAT #if FFT_FLOAT
# if CONFIG_RDFT
case TRANSFORM_RDFT: case TRANSFORM_RDFT:
ff_rdft_end(r); ff_rdft_end(r);
break; break;
# endif /* CONFIG_RDFT */
# if CONFIG_DCT # if CONFIG_DCT
case TRANSFORM_DCT: case TRANSFORM_DCT:
ff_dct_end(d); ff_dct_end(d);
break; break;
# endif # endif /* CONFIG_DCT */
#endif #endif
} }

View File

@@ -87,6 +87,7 @@ typedef struct G2MContext {
int compression; int compression;
int width, height, bpp; int width, height, bpp;
int orig_width, orig_height;
int tile_width, tile_height; int tile_width, tile_height;
int tiles_x, tiles_y, tile_x, tile_y; int tiles_x, tiles_y, tile_x, tile_y;
@@ -700,8 +701,8 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
} }
c->width = bytestream2_get_be32(&bc); c->width = bytestream2_get_be32(&bc);
c->height = bytestream2_get_be32(&bc); c->height = bytestream2_get_be32(&bc);
if (c->width < 16 || c->width > avctx->width || if (c->width < 16 || c->width > c->orig_width ||
c->height < 16 || c->height > avctx->height) { c->height < 16 || c->height > c->orig_height) {
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"Invalid frame dimensions %dx%d\n", "Invalid frame dimensions %dx%d\n",
c->width, c->height); c->width, c->height);
@@ -867,6 +868,10 @@ static av_cold int g2m_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_RGB24; 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; return 0;
} }

View File

@@ -2142,10 +2142,10 @@ static void decode_postinit(H264Context *h, int setup_finished)
stereo->type = AV_STEREO3D_CHECKERBOARD; stereo->type = AV_STEREO3D_CHECKERBOARD;
break; break;
case 1: case 1:
stereo->type = AV_STEREO3D_LINES; stereo->type = AV_STEREO3D_COLUMNS;
break; break;
case 2: case 2:
stereo->type = AV_STEREO3D_COLUMNS; stereo->type = AV_STEREO3D_LINES;
break; break;
case 3: case 3:
if (h->quincunx_subsampling) if (h->quincunx_subsampling)

View File

@@ -691,7 +691,7 @@ typedef struct H264Context {
int16_t slice_row[MAX_SLICES]; ///< to detect when MAX_SLICES is too low int16_t slice_row[MAX_SLICES]; ///< to detect when MAX_SLICES is too low
uint8_t parse_history[4]; uint8_t parse_history[6];
int parse_history_count; int parse_history_count;
int parse_last_mb; int parse_last_mb;
uint8_t *edge_emu_buffer; uint8_t *edge_emu_buffer;

View File

@@ -28,6 +28,7 @@
typedef struct H264BSFContext { typedef struct H264BSFContext {
uint8_t length_size; uint8_t length_size;
uint8_t first_idr; uint8_t first_idr;
uint8_t idr_sps_pps_seen;
int extradata_parsed; int extradata_parsed;
} H264BSFContext; } H264BSFContext;
@@ -155,6 +156,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
return ret; return ret;
ctx->length_size = ret; ctx->length_size = ret;
ctx->first_idr = 1; ctx->first_idr = 1;
ctx->idr_sps_pps_seen = 0;
ctx->extradata_parsed = 1; ctx->extradata_parsed = 1;
} }
@@ -174,8 +176,17 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
if (buf + nal_size > buf_end || nal_size < 0) if (buf + nal_size > buf_end || nal_size < 0)
goto fail; goto fail;
/* prepend only to the first type 5 NAL unit of an IDR picture */ if (ctx->first_idr && (unit_type == 7 || unit_type == 8))
if (ctx->first_idr && (unit_type == 5 || unit_type == 7 || unit_type == 8)) { ctx->idr_sps_pps_seen = 1;
/* if this is a new IDR picture following an IDR picture, reset the idr flag.
* Just check first_mb_in_slice to be 0 as this is the simplest solution.
* This could be checking idr_pic_id instead, but would complexify the parsing. */
if (!ctx->first_idr && unit_type == 5 && (buf[1] & 0x80))
ctx->first_idr = 1;
/* prepend only to the first type 5 NAL unit of an IDR picture, if no sps/pps are already present */
if (ctx->first_idr && unit_type == 5 && !ctx->idr_sps_pps_seen) {
if ((ret=alloc_and_copy(poutbuf, poutbuf_size, if ((ret=alloc_and_copy(poutbuf, poutbuf_size,
avctx->extradata, avctx->extradata_size, avctx->extradata, avctx->extradata_size,
buf, nal_size)) < 0) buf, nal_size)) < 0)
@@ -185,8 +196,10 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
if ((ret=alloc_and_copy(poutbuf, poutbuf_size, if ((ret=alloc_and_copy(poutbuf, poutbuf_size,
NULL, 0, buf, nal_size)) < 0) NULL, 0, buf, nal_size)) < 0)
goto fail; goto fail;
if (!ctx->first_idr && unit_type == 1) if (!ctx->first_idr && unit_type == 1) {
ctx->first_idr = 1; ctx->first_idr = 1;
ctx->idr_sps_pps_seen = 0;
}
} }
buf += nal_size; buf += nal_size;

View File

@@ -91,7 +91,7 @@ static int h264_find_frame_end(H264Context *h, const uint8_t *buf,
state = 7; state = 7;
} else { } else {
h->parse_history[h->parse_history_count++]= buf[i]; h->parse_history[h->parse_history_count++]= buf[i];
if (h->parse_history_count>3) { if (h->parse_history_count>5) {
unsigned int mb, last_mb= h->parse_last_mb; unsigned int mb, last_mb= h->parse_last_mb;
GetBitContext gb; GetBitContext gb;
@@ -119,7 +119,7 @@ found:
pc->frame_start_found = 0; pc->frame_start_found = 0;
if (h->is_avc) if (h->is_avc)
return next_avc; return next_avc;
return i - (state & 5) - 3 * (state > 7); return i - (state & 5) - 5 * (state > 7);
} }
static int scan_mmco_reset(AVCodecParserContext *s) static int scan_mmco_reset(AVCodecParserContext *s)

View File

@@ -2818,6 +2818,8 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
for (i = 0; i < FF_ARRAY_ELEMS(s->pps_list); i++) for (i = 0; i < FF_ARRAY_ELEMS(s->pps_list); i++)
av_buffer_unref(&s->pps_list[i]); av_buffer_unref(&s->pps_list[i]);
av_buffer_unref(&s->current_sps);
av_freep(&s->sh.entry_point_offset); av_freep(&s->sh.entry_point_offset);
av_freep(&s->sh.offset); av_freep(&s->sh.offset);
av_freep(&s->sh.size); av_freep(&s->sh.size);
@@ -2939,6 +2941,13 @@ static int hevc_update_thread_context(AVCodecContext *dst,
} }
} }
av_buffer_unref(&s->current_sps);
if (s0->current_sps) {
s->current_sps = av_buffer_ref(s0->current_sps);
if (!s->current_sps)
return AVERROR(ENOMEM);
}
if (s->sps != s0->sps) if (s->sps != s0->sps)
ret = set_sps(s, s0->sps); ret = set_sps(s, s0->sps);

View File

@@ -776,6 +776,8 @@ typedef struct HEVCContext {
AVBufferRef *sps_list[MAX_SPS_COUNT]; AVBufferRef *sps_list[MAX_SPS_COUNT];
AVBufferRef *pps_list[MAX_PPS_COUNT]; AVBufferRef *pps_list[MAX_PPS_COUNT];
AVBufferRef *current_sps;
AVBufferPool *tab_mvf_pool; AVBufferPool *tab_mvf_pool;
AVBufferPool *rpl_tab_pool; AVBufferPool *rpl_tab_pool;

View File

@@ -331,6 +331,9 @@ static void hevc_close(AVCodecParserContext *s)
for (i = 0; i < FF_ARRAY_ELEMS(h->pps_list); i++) for (i = 0; i < FF_ARRAY_ELEMS(h->pps_list); i++)
av_buffer_unref(&h->pps_list[i]); av_buffer_unref(&h->pps_list[i]);
av_buffer_unref(&h->current_sps);
h->sps = NULL;
for (i = 0; i < h->nals_allocated; i++) for (i = 0; i < h->nals_allocated; i++)
av_freep(&h->nals[i].rbsp_buffer); av_freep(&h->nals[i].rbsp_buffer);
av_freep(&h->nals); av_freep(&h->nals);

View File

@@ -956,6 +956,12 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
if (s->pps_list[i] && ((HEVCPPS*)s->pps_list[i]->data)->sps_id == sps_id) if (s->pps_list[i] && ((HEVCPPS*)s->pps_list[i]->data)->sps_id == sps_id)
av_buffer_unref(&s->pps_list[i]); av_buffer_unref(&s->pps_list[i]);
} }
if (s->sps_list[sps_id] && s->sps == (HEVCSPS*)s->sps_list[sps_id]->data) {
av_buffer_unref(&s->current_sps);
s->current_sps = av_buffer_ref(s->sps_list[sps_id]);
if (!s->current_sps)
s->sps = NULL;
}
av_buffer_unref(&s->sps_list[sps_id]); av_buffer_unref(&s->sps_list[sps_id]);
s->sps_list[sps_id] = sps_buf; s->sps_list[sps_id] = sps_buf;
} }

View File

@@ -186,7 +186,8 @@ static int generate_joint_tables(HYuvContext *s)
} }
} }
ff_free_vlc(&s->vlc[4]); ff_free_vlc(&s->vlc[4]);
if ((ret = init_vlc(&s->vlc[4], VLC_BITS, i, len, 1, 1, bits, 2, 2, 0)) < 0) if ((ret = init_vlc(&s->vlc[4], VLC_BITS, i, len, 1, 1,
bits, 2, 2, 0)) < 0)
return ret; return ret;
} }
return 0; return 0;
@@ -195,21 +196,20 @@ static int generate_joint_tables(HYuvContext *s)
static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length) static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length)
{ {
GetBitContext gb; GetBitContext gb;
int i; int i, ret;
int ret;
int count = 3; int count = 3;
init_get_bits(&gb, src, length * 8); if ((ret = init_get_bits(&gb, src, length * 8)) < 0)
return ret;
if (s->version > 2) if (s->version > 2)
count = 1 + s->alpha + 2*s->chroma; count = 1 + s->alpha + 2*s->chroma;
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
if (read_len_table(s->len[i], &gb, s->vlc_n) < 0) if ((ret = read_len_table(s->len[i], &gb, s->vlc_n)) < 0)
return -1; return ret;
if (ff_huffyuv_generate_bits_table(s->bits[i], s->len[i], s->vlc_n) < 0) { if ((ret = ff_huffyuv_generate_bits_table(s->bits[i], s->len[i], s->vlc_n)) < 0)
return -1; return ret;
}
ff_free_vlc(&s->vlc[i]); ff_free_vlc(&s->vlc[i]);
if ((ret = init_vlc(&s->vlc[i], VLC_BITS, s->vlc_n, s->len[i], 1, 1, if ((ret = init_vlc(&s->vlc[i], VLC_BITS, s->vlc_n, s->len[i], 1, 1,
s->bits[i], 4, 4, 0)) < 0) s->bits[i], 4, 4, 0)) < 0)
@@ -225,18 +225,17 @@ static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length)
static int read_old_huffman_tables(HYuvContext *s) static int read_old_huffman_tables(HYuvContext *s)
{ {
GetBitContext gb; GetBitContext gb;
int i; int i, ret;
int ret;
init_get_bits(&gb, classic_shift_luma, init_get_bits(&gb, classic_shift_luma,
classic_shift_luma_table_size * 8); classic_shift_luma_table_size * 8);
if (read_len_table(s->len[0], &gb, 256) < 0) if ((ret = read_len_table(s->len[0], &gb, 256)) < 0)
return -1; return ret;
init_get_bits(&gb, classic_shift_chroma, init_get_bits(&gb, classic_shift_chroma,
classic_shift_chroma_table_size * 8); classic_shift_chroma_table_size * 8);
if (read_len_table(s->len[1], &gb, 256) < 0) if ((ret = read_len_table(s->len[1], &gb, 256)) < 0)
return -1; return ret;
for(i=0; i<256; i++) s->bits[0][i] = classic_add_luma [i]; for(i=0; i<256; i++) s->bits[0][i] = classic_add_luma [i];
for(i=0; i<256; i++) s->bits[1][i] = classic_add_chroma[i]; for(i=0; i<256; i++) s->bits[1][i] = classic_add_chroma[i];
@@ -264,6 +263,7 @@ static int read_old_huffman_tables(HYuvContext *s)
static av_cold int decode_init(AVCodecContext *avctx) static av_cold int decode_init(AVCodecContext *avctx)
{ {
HYuvContext *s = avctx->priv_data; HYuvContext *s = avctx->priv_data;
int ret;
memset(s->vlc, 0, 4 * sizeof(VLC)); memset(s->vlc, 0, 4 * sizeof(VLC));
@@ -313,10 +313,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->interlaced = (interlace == 1) ? 1 : (interlace == 2) ? 0 : s->interlaced; s->interlaced = (interlace == 1) ? 1 : (interlace == 2) ? 0 : s->interlaced;
s->context = ((uint8_t*)avctx->extradata)[2] & 0x40 ? 1 : 0; s->context = ((uint8_t*)avctx->extradata)[2] & 0x40 ? 1 : 0;
if ( read_huffman_tables(s, ((uint8_t*)avctx->extradata) + 4, if ((ret = read_huffman_tables(s, avctx->extradata + 4,
avctx->extradata_size - 4) < 0) avctx->extradata_size - 4)) < 0)
return AVERROR_INVALIDDATA; return ret;
}else{ } else {
switch (avctx->bits_per_coded_sample & 7) { switch (avctx->bits_per_coded_sample & 7) {
case 1: case 1:
s->predictor = LEFT; s->predictor = LEFT;
@@ -342,8 +342,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->bitstream_bpp = avctx->bits_per_coded_sample & ~7; s->bitstream_bpp = avctx->bits_per_coded_sample & ~7;
s->context = 0; s->context = 0;
if (read_old_huffman_tables(s) < 0) if ((ret = read_old_huffman_tables(s)) < 0)
return AVERROR_INVALIDDATA; return ret;
} }
if (s->version <= 2) { if (s->version <= 2) {
@@ -520,13 +520,16 @@ static av_cold int decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "width must be even for this colorspace\n"); av_log(avctx, AV_LOG_ERROR, "width must be even for this colorspace\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if (s->predictor == MEDIAN && avctx->pix_fmt == AV_PIX_FMT_YUV422P && avctx->width%4) { if (s->predictor == MEDIAN && avctx->pix_fmt == AV_PIX_FMT_YUV422P &&
av_log(avctx, AV_LOG_ERROR, "width must be a multiple of 4 this colorspace and predictor\n"); avctx->width % 4) {
av_log(avctx, AV_LOG_ERROR, "width must be a multiple of 4 "
"for this combination of colorspace and predictor type.\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if (ff_huffyuv_alloc_temp(s)) {
if ((ret = ff_huffyuv_alloc_temp(s)) < 0) {
ff_huffyuv_common_end(s); ff_huffyuv_common_end(s);
return AVERROR(ENOMEM); return ret;
} }
return 0; return 0;
@@ -535,23 +538,23 @@ static av_cold int decode_init(AVCodecContext *avctx)
static av_cold int decode_init_thread_copy(AVCodecContext *avctx) static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
{ {
HYuvContext *s = avctx->priv_data; HYuvContext *s = avctx->priv_data;
int i; int i, ret;
if (ff_huffyuv_alloc_temp(s)) { if ((ret = ff_huffyuv_alloc_temp(s)) < 0) {
ff_huffyuv_common_end(s); ff_huffyuv_common_end(s);
return AVERROR(ENOMEM); return ret;
} }
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
s->vlc[i].table = NULL; s->vlc[i].table = NULL;
if (s->version >= 2) { if (s->version >= 2) {
if (read_huffman_tables(s, ((uint8_t*)avctx->extradata) + 4, if ((ret = read_huffman_tables(s, avctx->extradata + 4,
avctx->extradata_size) < 0) avctx->extradata_size)) < 0)
return AVERROR_INVALIDDATA; return ret;
} else { } else {
if (read_old_huffman_tables(s) < 0) if ((ret = read_old_huffman_tables(s)) < 0)
return AVERROR_INVALIDDATA; return ret;
} }
return 0; return 0;
@@ -798,14 +801,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (s->context) { if (s->context) {
table_size = read_huffman_tables(s, s->bitstream_buffer, buf_size); table_size = read_huffman_tables(s, s->bitstream_buffer, buf_size);
if (table_size < 0) if (table_size < 0)
return AVERROR_INVALIDDATA; return table_size;
} }
if ((unsigned)(buf_size-table_size) >= INT_MAX / 8) if ((unsigned)(buf_size-table_size) >= INT_MAX / 8)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
init_get_bits(&s->gb, s->bitstream_buffer+table_size, if ((ret = init_get_bits(&s->gb, s->bitstream_buffer + table_size,
(buf_size-table_size) * 8); (buf_size - table_size) * 8)) < 0)
return ret;
fake_ystride = s->interlaced ? p->linesize[0] * 2 : p->linesize[0]; fake_ystride = s->interlaced ? p->linesize[0] * 2 : p->linesize[0];
fake_ustride = s->interlaced ? p->linesize[1] * 2 : p->linesize[1]; fake_ustride = s->interlaced ? p->linesize[1] * 2 : p->linesize[1];

View File

@@ -847,9 +847,9 @@ static int decode_frame(AVCodecContext *avctx,
break; break;
case 4: case 4:
bytestream2_init(&gb, buf, buf_size); bytestream2_init(&gb, buf, buf_size);
if (avctx->codec_tag == MKTAG('R', 'G', 'B', '8')) if (avctx->codec_tag == MKTAG('R', 'G', 'B', '8') && avctx->pix_fmt == AV_PIX_FMT_RGB32)
decode_rgb8(&gb, s->frame->data[0], avctx->width, avctx->height, s->frame->linesize[0]); decode_rgb8(&gb, s->frame->data[0], avctx->width, avctx->height, s->frame->linesize[0]);
else if (avctx->codec_tag == MKTAG('R', 'G', 'B', 'N')) else if (avctx->codec_tag == MKTAG('R', 'G', 'B', 'N') && avctx->pix_fmt == AV_PIX_FMT_RGB444)
decode_rgbn(&gb, s->frame->data[0], avctx->width, avctx->height, s->frame->linesize[0]); decode_rgbn(&gb, s->frame->data[0], avctx->width, avctx->height, s->frame->linesize[0]);
else else
return unsupported(avctx); return unsupported(avctx);

View File

@@ -202,10 +202,10 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
case AV_STEREO3D_CHECKERBOARD: case AV_STEREO3D_CHECKERBOARD:
fpa_type = 0; fpa_type = 0;
break; break;
case AV_STEREO3D_LINES: case AV_STEREO3D_COLUMNS:
fpa_type = 1; fpa_type = 1;
break; break;
case AV_STEREO3D_COLUMNS: case AV_STEREO3D_LINES:
fpa_type = 2; fpa_type = 2;
break; break;
case AV_STEREO3D_SIDEBYSIDE: case AV_STEREO3D_SIDEBYSIDE:

View File

@@ -1878,6 +1878,14 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
} else } else
goto eos; goto eos;
} }
if (s->mb_y >= ((s->height + 15) >> 4) &&
s->progressive_frame &&
!s->progressive_sequence &&
get_bits_left(&s->gb) <= 8 &&
get_bits_left(&s->gb) >= 0 &&
s->mb_skip_run == -1 &&
show_bits(&s->gb, 8) == 0)
goto eos;
ff_init_block_index(s); ff_init_block_index(s);
} }

View File

@@ -214,6 +214,13 @@ static int parse_picture_segment(AVCodecContext *avctx,
/* Decode rle bitmap length, stored size includes width/height data */ /* Decode rle bitmap length, stored size includes width/height data */
rle_bitmap_len = bytestream_get_be24(&buf) - 2*2; rle_bitmap_len = bytestream_get_be24(&buf) - 2*2;
if (buf_size > rle_bitmap_len) {
av_log(avctx, AV_LOG_ERROR,
"Buffer dimension %d larger than the expected RLE data %d\n",
buf_size, rle_bitmap_len);
return AVERROR_INVALIDDATA;
}
/* Get bitmap dimensions from data */ /* Get bitmap dimensions from data */
width = bytestream_get_be16(&buf); width = bytestream_get_be16(&buf);
height = bytestream_get_be16(&buf); height = bytestream_get_be16(&buf);
@@ -224,11 +231,6 @@ static int parse_picture_segment(AVCodecContext *avctx,
return -1; return -1;
} }
if (buf_size > rle_bitmap_len) {
av_log(avctx, AV_LOG_ERROR, "too much RLE data\n");
return AVERROR_INVALIDDATA;
}
ctx->pictures[picture_id].w = width; ctx->pictures[picture_id].w = width;
ctx->pictures[picture_id].h = height; ctx->pictures[picture_id].h = height;

View File

@@ -472,7 +472,6 @@ static void put_alpha_run(PutBitContext *pb, int run)
// todo alpha quantisation for high quants // todo alpha quantisation for high quants
static int encode_alpha_plane(ProresContext *ctx, PutBitContext *pb, static int encode_alpha_plane(ProresContext *ctx, PutBitContext *pb,
const uint16_t *src, int linesize,
int mbs_per_slice, uint16_t *blocks, int mbs_per_slice, uint16_t *blocks,
int quant) int quant)
{ {
@@ -567,11 +566,16 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic,
get_alpha_data(ctx, src, linesize, xp, yp, get_alpha_data(ctx, src, linesize, xp, yp,
pwidth, avctx->height / ctx->pictures_per_frame, pwidth, avctx->height / ctx->pictures_per_frame,
ctx->blocks[0], mbs_per_slice, ctx->alpha_bits); ctx->blocks[0], mbs_per_slice, ctx->alpha_bits);
sizes[i] = encode_alpha_plane(ctx, pb, src, linesize, sizes[i] = encode_alpha_plane(ctx, pb,
mbs_per_slice, ctx->blocks[0], mbs_per_slice, ctx->blocks[0],
quant); quant);
} }
total_size += sizes[i]; total_size += sizes[i];
if (put_bits_left(pb) < 0) {
av_log(avctx, AV_LOG_ERROR, "Serious underevaluation of"
"required buffer size");
return AVERROR_BUFFER_TOO_SMALL;
}
} }
return total_size; return total_size;
} }
@@ -942,9 +946,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1; avctx->coded_frame->key_frame = 1;
pkt_size = ctx->frame_size_upper_bound + FF_MIN_BUFFER_SIZE; pkt_size = ctx->frame_size_upper_bound;
if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size)) < 0) if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size + FF_MIN_BUFFER_SIZE)) < 0)
return ret; return ret;
orig_buf = pkt->data; orig_buf = pkt->data;
@@ -1021,7 +1025,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
slice_hdr = buf; slice_hdr = buf;
buf += slice_hdr_size - 1; buf += slice_hdr_size - 1;
init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)) * 8); init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)) * 8);
encode_slice(avctx, pic, &pb, sizes, x, y, q, mbs_per_slice); ret = encode_slice(avctx, pic, &pb, sizes, x, y, q, mbs_per_slice);
if (ret < 0)
return ret;
bytestream_put_byte(&slice_hdr, q); bytestream_put_byte(&slice_hdr, q);
slice_size = slice_hdr_size + sizes[ctx->num_planes - 1]; slice_size = slice_hdr_size + sizes[ctx->num_planes - 1];

View File

@@ -689,7 +689,7 @@ av_cold void ff_snow_common_end(SnowContext *s)
for(i=0; i<MAX_REF_FRAMES; i++){ for(i=0; i<MAX_REF_FRAMES; i++){
av_freep(&s->ref_mvs[i]); av_freep(&s->ref_mvs[i]);
av_freep(&s->ref_scores[i]); av_freep(&s->ref_scores[i]);
if(s->last_picture[i]->data[0]) { if(s->last_picture[i] && s->last_picture[i]->data[0]) {
av_assert0(s->last_picture[i]->data[0] != s->current_picture->data[0]); av_assert0(s->last_picture[i]->data[0] != s->current_picture->data[0]);
} }
av_frame_free(&s->last_picture[i]); av_frame_free(&s->last_picture[i]);

View File

@@ -60,6 +60,10 @@ typedef struct SVQ1Context {
HpelDSPContext hdsp; HpelDSPContext hdsp;
GetBitContext gb; GetBitContext gb;
AVFrame *prev; AVFrame *prev;
uint8_t *pkt_swapped;
int pkt_swapped_allocated;
int width; int width;
int height; int height;
int frame_code; int frame_code;
@@ -624,7 +628,24 @@ static int svq1_decode_frame(AVCodecContext *avctx, void *data,
/* swap some header bytes (why?) */ /* swap some header bytes (why?) */
if (s->frame_code != 0x20) { if (s->frame_code != 0x20) {
uint32_t *src = (uint32_t *)(buf + 4); uint32_t *src;
if (buf_size < 9 * 4) {
av_log(avctx, AV_LOG_ERROR, "Input packet too small\n");
return AVERROR_INVALIDDATA;
}
av_fast_padded_malloc(&s->pkt_swapped, &s->pkt_swapped_allocated,
buf_size);
if (!s->pkt_swapped)
return AVERROR(ENOMEM);
memcpy(s->pkt_swapped, buf, buf_size);
buf = s->pkt_swapped;
init_get_bits(&s->gb, buf, buf_size * 8);
skip_bits(&s->gb, 22);
src = (uint32_t *)(s->pkt_swapped + 4);
if (buf_size < 36) if (buf_size < 36)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
@@ -796,6 +817,8 @@ static av_cold int svq1_decode_end(AVCodecContext *avctx)
SVQ1Context *s = avctx->priv_data; SVQ1Context *s = avctx->priv_data;
av_frame_free(&s->prev); av_frame_free(&s->prev);
av_freep(&s->pkt_swapped);
s->pkt_swapped_allocated = 0;
return 0; return 0;
} }

View File

@@ -6005,7 +6005,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
/* skip B-frames if we don't have reference frames */ /* skip B-frames if we don't have reference frames */
if (s->last_picture_ptr == NULL && (s->pict_type == AV_PICTURE_TYPE_B || s->droppable)) { if (s->last_picture_ptr == NULL && (s->pict_type == AV_PICTURE_TYPE_B || s->droppable)) {
goto err; goto end;
} }
if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) || if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||
(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) ||

View File

@@ -638,7 +638,7 @@ static uint32_t log2sample(uint32_t v, int limit, uint32_t *result)
if ((v += v >> 9) < (1 << 8)) { if ((v += v >> 9) < (1 << 8)) {
dbits = nbits_table[v]; dbits = nbits_table[v];
result += (dbits << 8) + wp_log2_table[(v << (9 - dbits)) & 0xff]; *result += (dbits << 8) + wp_log2_table[(v << (9 - dbits)) & 0xff];
} else { } else {
if (v < (1L << 16)) if (v < (1L << 16))
dbits = nbits_table[v >> 8] + 8; dbits = nbits_table[v >> 8] + 8;
@@ -647,7 +647,7 @@ static uint32_t log2sample(uint32_t v, int limit, uint32_t *result)
else else
dbits = nbits_table[v >> 24] + 24; dbits = nbits_table[v >> 24] + 24;
result += dbits = (dbits << 8) + wp_log2_table[(v >> (dbits - 9)) & 0xff]; *result += dbits = (dbits << 8) + wp_log2_table[(v >> (dbits - 9)) & 0xff];
if (limit && dbits >= limit) if (limit && dbits >= limit)
return 1; return 1;

View File

@@ -22,6 +22,7 @@
#include "avdevice.h" #include "avdevice.h"
typedef struct { typedef struct {
AVClass *class;
int fd; int fd;
} V4L2Context; } V4L2Context;

View File

@@ -308,6 +308,7 @@ static void select_frame(AVFilterContext *ctx, AVFrame *frame)
select->var_values[VAR_PTS] = TS2D(frame->pts); select->var_values[VAR_PTS] = TS2D(frame->pts);
select->var_values[VAR_T ] = TS2D(frame->pts) * av_q2d(inlink->time_base); select->var_values[VAR_T ] = TS2D(frame->pts) * av_q2d(inlink->time_base);
select->var_values[VAR_POS] = av_frame_get_pkt_pos(frame) == -1 ? NAN : av_frame_get_pkt_pos(frame); select->var_values[VAR_POS] = av_frame_get_pkt_pos(frame) == -1 ? NAN : av_frame_get_pkt_pos(frame);
select->var_values[VAR_KEY] = frame->key_frame;
switch (inlink->type) { switch (inlink->type) {
case AVMEDIA_TYPE_AUDIO: case AVMEDIA_TYPE_AUDIO:
@@ -337,21 +338,20 @@ static void select_frame(AVFilterContext *ctx, AVFrame *frame)
select->var_values[VAR_N], select->var_values[VAR_N],
select->var_values[VAR_PTS], select->var_values[VAR_PTS],
select->var_values[VAR_T], select->var_values[VAR_T],
(int)select->var_values[VAR_KEY]); frame->key_frame);
switch (inlink->type) { switch (inlink->type) {
case AVMEDIA_TYPE_VIDEO: case AVMEDIA_TYPE_VIDEO:
av_log(inlink->dst, AV_LOG_DEBUG, " interlace_type:%c pict_type:%c scene:%f", av_log(inlink->dst, AV_LOG_DEBUG, " interlace_type:%c pict_type:%c scene:%f",
select->var_values[VAR_INTERLACE_TYPE] == INTERLACE_TYPE_P ? 'P' : (!frame->interlaced_frame) ? 'P' :
select->var_values[VAR_INTERLACE_TYPE] == INTERLACE_TYPE_T ? 'T' : frame->top_field_first ? 'T' : 'B',
select->var_values[VAR_INTERLACE_TYPE] == INTERLACE_TYPE_B ? 'B' : '?', av_get_picture_type_char(frame->pict_type),
av_get_picture_type_char(select->var_values[VAR_PICT_TYPE]),
select->var_values[VAR_SCENE]); select->var_values[VAR_SCENE]);
break; break;
case AVMEDIA_TYPE_AUDIO: case AVMEDIA_TYPE_AUDIO:
av_log(inlink->dst, AV_LOG_DEBUG, " samples_n:%d consumed_samples_n:%d", av_log(inlink->dst, AV_LOG_DEBUG, " samples_n:%d consumed_samples_n:%f",
(int)select->var_values[VAR_SAMPLES_N], frame->nb_samples,
(int)select->var_values[VAR_CONSUMED_SAMPLES_N]); select->var_values[VAR_CONSUMED_SAMPLES_N]);
break; break;
} }

View File

@@ -72,30 +72,33 @@ static inline uint16_t dv_audio_12to16(uint16_t sample)
return result; return result;
} }
/*
* This is the dumbest implementation of all -- it simply looks at
* a fixed offset and if pack isn't there -- fails. We might want
* to have a fallback mechanism for complete search of missing packs.
*/
static const uint8_t *dv_extract_pack(uint8_t *frame, enum dv_pack_type t) static const uint8_t *dv_extract_pack(uint8_t *frame, enum dv_pack_type t)
{ {
int offs; int offs;
int c;
switch (t) { for (c = 0; c < 10; c++) {
case dv_audio_source: switch (t) {
offs = (80 * 6 + 80 * 16 * 3 + 3); case dv_audio_source:
break; if (c&1) offs = (80 * 6 + 80 * 16 * 0 + 3 + c*12000);
case dv_audio_control: else offs = (80 * 6 + 80 * 16 * 3 + 3 + c*12000);
offs = (80 * 6 + 80 * 16 * 4 + 3); break;
break; case dv_audio_control:
case dv_video_control: if (c&1) offs = (80 * 6 + 80 * 16 * 1 + 3 + c*12000);
offs = (80 * 5 + 48 + 5); else offs = (80 * 6 + 80 * 16 * 4 + 3 + c*12000);
break; break;
case dv_timecode: case dv_video_control:
offs = (80*1 + 3 + 3); if (c&1) offs = (80 * 3 + 8 + c*12000);
break; else offs = (80 * 5 + 48 + 5 + c*12000);
default: break;
return NULL; case dv_timecode:
offs = (80*1 + 3 + 3);
break;
default:
return NULL;
}
if (frame[offs] == t)
break;
} }
return frame[offs] == t ? &frame[offs] : NULL; return frame[offs] == t ? &frame[offs] : NULL;

View File

@@ -38,6 +38,7 @@ typedef struct LibRTMPContext {
RTMP rtmp; RTMP rtmp;
char *app; char *app;
char *playpath; char *playpath;
char *temp_filename;
} LibRTMPContext; } LibRTMPContext;
static void rtmp_log(int level, const char *fmt, va_list args) static void rtmp_log(int level, const char *fmt, va_list args)
@@ -62,6 +63,7 @@ static int rtmp_close(URLContext *s)
RTMP *r = &ctx->rtmp; RTMP *r = &ctx->rtmp;
RTMP_Close(r); RTMP_Close(r);
av_freep(&ctx->temp_filename);
return 0; return 0;
} }
@@ -101,7 +103,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
if (ctx->app) len += strlen(ctx->app) + sizeof(" app="); if (ctx->app) len += strlen(ctx->app) + sizeof(" app=");
if (ctx->playpath) len += strlen(ctx->playpath) + sizeof(" playpath="); if (ctx->playpath) len += strlen(ctx->playpath) + sizeof(" playpath=");
if (!(filename = av_malloc(len))) if (!(ctx->temp_filename = filename = av_malloc(len)))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_strlcpy(filename, s->filename, len); av_strlcpy(filename, s->filename, len);
@@ -130,10 +132,9 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
} }
s->is_streamed = 1; s->is_streamed = 1;
rc = 0; return 0;
fail: fail:
if (filename != s->filename) av_freep(&ctx->temp_filename);
av_freep(&filename);
if (rc) if (rc)
RTMP_Close(r); RTMP_Close(r);

View File

@@ -468,7 +468,7 @@ static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt)
if ((ret = av_copy_packet(&pkt2, pkt)) < 0 || if ((ret = av_copy_packet(&pkt2, pkt)) < 0 ||
(ret = av_dup_packet(&pkt2))< 0) (ret = av_dup_packet(&pkt2))< 0)
if (!ret_all) { if (!ret_all) {
ret = ret_all; ret_all = ret;
continue; continue;
} }
tb = avf ->streams[s ]->time_base; tb = avf ->streams[s ]->time_base;

View File

@@ -224,6 +224,9 @@ int av_parse_cpu_caps(unsigned *flags, const char *s)
{ "vfp", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFP }, .unit = "flags" }, { "vfp", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFP }, .unit = "flags" },
{ "vfpv3", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFPV3 }, .unit = "flags" }, { "vfpv3", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFPV3 }, .unit = "flags" },
{ "neon", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_NEON }, .unit = "flags" }, { "neon", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_NEON }, .unit = "flags" },
#elif ARCH_AARCH64
{ "neon", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_NEON }, .unit = "flags" },
{ "vfp", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFP }, .unit = "flags" },
#endif #endif
{ NULL }, { NULL },
}; };

View File

@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef AVUTIL_STEREO3D_H
#define AVUTIL_STEREO3D_H
#include <stdint.h> #include <stdint.h>
#include "frame.h" #include "frame.h"
@@ -145,3 +148,5 @@ AVStereo3D *av_stereo3d_alloc(void);
* @return The AVStereo3D structure to be filled by caller. * @return The AVStereo3D structure to be filled by caller.
*/ */
AVStereo3D *av_stereo3d_create_side_data(AVFrame *frame); AVStereo3D *av_stereo3d_create_side_data(AVFrame *frame);
#endif /* AVUTIL_STEREO3D_H */

View File

@@ -1,8 +1,8 @@
define DEF_FFT define DEF_FFT
FATE_FFT += fate-fft-$(1) fate-ifft-$(1) \ FATE_FFT-$(CONFIG_DCT) += fate-dct1d-$(1) fate-idct1d-$(1)
fate-mdct-$(1) fate-imdct-$(1) \ FATE_FFT-$(CONFIG_FFT) += fate-fft-$(1) fate-ifft-$(1)
fate-rdft-$(1) fate-irdft-$(1) \ FATE_FFT-$(CONFIG_MDCT) += fate-mdct-$(1) fate-imdct-$(1)
fate-dct1d-$(1) fate-idct1d-$(1) FATE_FFT-$(CONFIG_RDFT) += fate-rdft-$(1) fate-irdft-$(1)
fate-fft-$(N): ARGS = -n$(1) fate-fft-$(N): ARGS = -n$(1)
fate-ifft-$(N): ARGS = -n$(1) -i fate-ifft-$(N): ARGS = -n$(1) -i
@@ -16,14 +16,14 @@ endef
$(foreach N, 4 5 6 7 8 9 10 11 12, $(eval $(call DEF_FFT,$(N)))) $(foreach N, 4 5 6 7 8 9 10 11 12, $(eval $(call DEF_FFT,$(N))))
fate-fft-test: $(FATE_FFT) fate-fft-float: $(FATE_FFT-yes)
$(FATE_FFT): libavcodec/fft-test$(EXESUF) $(FATE_FFT-yes): libavcodec/fft-test$(EXESUF)
$(FATE_FFT): CMD = run libavcodec/fft-test $(CPUFLAGS:%=-c%) $(ARGS) $(FATE_FFT-yes): CMD = run libavcodec/fft-test $(CPUFLAGS:%=-c%) $(ARGS)
$(FATE_FFT): REF = /dev/null $(FATE_FFT-yes): REF = /dev/null
define DEF_FFT_FIXED define DEF_FFT_FIXED
FATE_FFT_FIXED += fate-fft-fixed-$(1) fate-ifft-fixed-$(1) \ FATE_FFT_FIXED-$(CONFIG_FFT) += fate-fft-fixed-$(1) fate-ifft-fixed-$(1)
fate-mdct-fixed-$(1) fate-imdct-fixed-$(1) FATE_FFT_FIXED-$(CONFIG_MDCT) += fate-mdct-fixed-$(1) fate-imdct-fixed-$(1)
fate-fft-fixed-$(1): ARGS = -n$(1) fate-fft-fixed-$(1): ARGS = -n$(1)
fate-ifft-fixed-$(1): ARGS = -n$(1) -i fate-ifft-fixed-$(1): ARGS = -n$(1) -i
@@ -33,10 +33,10 @@ endef
$(foreach N, 4 5 6 7 8 9 10 11 12, $(eval $(call DEF_FFT_FIXED,$(N)))) $(foreach N, 4 5 6 7 8 9 10 11 12, $(eval $(call DEF_FFT_FIXED,$(N))))
fate-fft-fixed-test: $(FATE_FFT_FIXED) fate-fft-fixed: $(FATE_FFT_FIXED-yes)
$(FATE_FFT_FIXED): libavcodec/fft-fixed-test$(EXESUF) $(FATE_FFT_FIXED-yes): libavcodec/fft-fixed-test$(EXESUF)
$(FATE_FFT_FIXED): CMD = run libavcodec/fft-fixed-test $(CPUFLAGS:%=-c%) $(ARGS) $(FATE_FFT_FIXED-yes): CMD = run libavcodec/fft-fixed-test $(CPUFLAGS:%=-c%) $(ARGS)
$(FATE_FFT_FIXED): REF = /dev/null $(FATE_FFT_FIXED-yes): REF = /dev/null
define DEF_FFT_FIXED32 define DEF_FFT_FIXED32
FATE_FFT_FIXED32 += fate-fft-fixed32-$(1) fate-ifft-fixed32-$(1) \ FATE_FFT_FIXED32 += fate-fft-fixed32-$(1) fate-ifft-fixed32-$(1) \
@@ -55,5 +55,5 @@ $(FATE_FFT_FIXED32): libavcodec/fft-fixed32-test$(EXESUF)
$(FATE_FFT_FIXED32): CMD = run libavcodec/fft-fixed32-test $(CPUFLAGS:%=-c%) $(ARGS) $(FATE_FFT_FIXED32): CMD = run libavcodec/fft-fixed32-test $(CPUFLAGS:%=-c%) $(ARGS)
$(FATE_FFT_FIXED32): REF = /dev/null $(FATE_FFT_FIXED32): REF = /dev/null
FATE-$(call ALLYES, AVCODEC FFT MDCT) += $(FATE_FFT) $(FATE_FFT_FIXED) $(FATE_FFT_FIXED32) FATE-$(call ALLYES, AVCODEC FFT MDCT) += $(FATE_FFT-yes) $(FATE_FFT_FIXED-yes) $(FATE_FFT_FIXED32)
fate-fft: $(FATE_FFT) $(FATE_FFT_FIXED) $(FATE_FFT_FIXED32) fate-fft: $(FATE_FFT-yes) $(FATE_FFT_FIXED-yes) $(FATE_FFT_FIXED32)

View File

@@ -4,7 +4,11 @@
# check for git short hash # check for git short hash
if ! test "$revision"; then if ! test "$revision"; then
revision=$(cd "$1" && git describe --tags --match N 2> /dev/null) if (cd "$1" && grep git RELEASE 2> /dev/null >/dev/null) ; then
revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
else
revision=$(cd "$1" && git describe --tags --always 2> /dev/null)
fi
fi fi
# Shallow Git clones (--depth) do not have the N tag: # Shallow Git clones (--depth) do not have the N tag: