1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

19849 Commits

Author SHA1 Message Date
Vittorio Giovara
c01ccccbb1 ituh263dec: use macro instead of #if 2015-01-29 17:33:34 +00:00
Vittorio Giovara
302ca6b20e mpegvideo_enc: initialize the encoding context
This prevents several uninitialized variable uses that take
place towards the end of encoding.

CC: libav-stable@libav.org
Bug-Id: CID 700760
2015-01-29 15:26:33 +00:00
Vittorio Giovara
1a07df3112 DNxHD: Add support for id 1258 (DNx100 960x720@8)
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-01-29 15:04:57 +00:00
Vittorio Giovara
598f7d046c DNxHD: Simplify pixel format detection
Error out in case of unknown values.
2015-01-29 15:04:46 +00:00
Vittorio Giovara
41e03e284e DNxHD: More verbose error messages 2015-01-29 15:04:35 +00:00
Martin Storsjö
6996fd204a libopenh264: Log debug messages to a non-null context
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-29 09:16:35 +02:00
Michael Niedermayer
61928b68dc h264: Do not share rbsp_buffer across threads
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

CC: libav-stable@libav.org
2015-01-28 16:28:58 +01:00
Vittorio Giovara
607ad990d3 dvbsubdec: check memory allocations and propagate errors 2015-01-27 15:26:37 +00:00
Anton Khirnov
a536a4e4bc lavc: support extracting audio service type from side data 2015-01-27 09:22:33 +01:00
Anton Khirnov
728685f37a Add a side data type for audio service type.
Currently, audio service type is a field in AVCodecContext. However,
side data is more appropriate for this kind of information.
2015-01-27 09:17:48 +01:00
Anton Khirnov
e44b58924f lavc: deprecate unused AVCodecContext.stream_codec_tag 2015-01-27 09:14:39 +01:00
Anton Khirnov
f771b3ab5d avidec: do not export stream_codec_tag
Handle its only existing use case internally.
2015-01-27 09:13:45 +01:00
Anton Khirnov
167e004e1a h264: drop any pretense of support for data partitioning
It does not work correctly and apparently never did. There is no
indication that this (mis)feature is ever used in the wild or even that
any software other than the reference supports it.

Since the code that attempts to support it adds some nontrivial
complexity and has resulted in several bugs in the past, it is better to
just drop it.
2015-01-27 09:10:12 +01:00
Anton Khirnov
58ae8d5957 h264_parser: restore a comment lost in 0268a54 2015-01-27 09:09:56 +01:00
Anton Khirnov
ecab21ac47 h264: do not reset the ref lists in flush_change()
They are always constructed anew when needed, so there is no need to
reset them explicitly.
2015-01-27 09:09:29 +01:00
Anton Khirnov
9404a47a2d h264: move parser-only variables to their own context 2015-01-27 09:08:31 +01:00
Anton Khirnov
cf1e0786ed error_resilience: move the MECmpContext initialization into ER code
Currently, it needs to be initialized by the ER caller (which is
currently either a mpegvideo decoder or h264dec). However, since none of
those decoders use MECmpContext for anything except ER, it makes more
sense to handle it purely inside ER.
2015-01-27 09:07:59 +01:00
Hendrik Leppkes
7e850fa67e Add DXVA2 HEVC HWAccel
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-01-27 09:05:31 +01:00
Hendrik Leppkes
b82722df9b hevc: reindent after previous commit
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-01-27 09:05:25 +01:00
Hendrik Leppkes
e72e8c5a1d hevc: add hwaccel hooks
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-01-27 09:05:08 +01:00
Hendrik Leppkes
4b95e95dba hevc: store the short term rps flag and size in the context
For future use by hardware accelerators.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-01-27 09:04:59 +01:00
Hendrik Leppkes
36779a8405 hevc: store the escaped/raw bitstream in HEVCNAL
Hardware Accelerators require access to the escaped bitstream.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-01-27 09:04:44 +01:00
Hendrik Leppkes
b0593a4bca hevc: pass the full HEVCNAL struct to decode_nal_unit
This enables decode_nal_unit to access additional fields added in
subsequent commits.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-01-27 09:04:29 +01:00
Anton Khirnov
443b71928b hevc: unref the current frame if frame_start() fails
Prevents DPB from filling up with damaged input.
2015-01-27 08:34:56 +01:00
Anton Khirnov
1dd021929f hevc: clear unused refs on failure 2015-01-27 08:34:46 +01:00
Anton Khirnov
f9f883af4f h264: simplify code in flush_dpb()
There is no point in clearing reference explicitly, since that will be
done as a part of ff_h264_unref_picture() right below.
2015-01-27 08:34:24 +01:00
Michael Niedermayer
2a06c2a03e mpegvideo_enc: Draw edges on input for non-multiple of 16 resolutions
This improves motion estimation and avoids using uninitialized data
for resolutions that aren't a multiple of 16.

Prior to d2a25c40, the edges used to be initialized so that encoding
was deterministic, but after that commit it started using uninitialized
data (for non multiple of 16 resolutions).

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-23 15:05:49 +02:00
Derek Buitenhuis
6341ab0ad3 libx265: Pass through user-set frame type
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-01-22 16:29:30 +00:00
Martin Storsjö
440119b188 libopenh264enc: Move a declaration of a variable into an ifdef
This avoids needing an attribute for silencing warnings about
it being unused.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-20 15:02:50 +01:00
Martin Storsjö
bba0247926 libopenh264enc: Remove a workaround for silencing warnings about unused variables in the OpenH264 header
The 1.3 release branch of OpenH264 (as well as the master branch)
have been updated so that GCC no longer warns about this variable
as being unused.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-20 15:02:38 +01:00
Michael Niedermayer
def69553e7 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-01-15 10:17:01 +02:00
Vittorio Giovara
402fb5550e opus_parser: drop unused variable 2015-01-15 01:25:16 +01:00
Vittorio Giovara
8a9641a652 bsf: check memory allocations 2015-01-15 01:25:16 +01:00
Vittorio Giovara
014b6b416f vp8: improve memory allocation checks
Check memory earlier, check one more allocation and clean up on error.

CC: libav-stable@libav.org
Bug-Id: CID 1257773
2015-01-15 01:25:07 +01:00
Paul B Mahol
f86f39cb9b tiff: support decoding GBRP and GBRAP formats
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-01-14 17:17:24 +01:00
Paul B Mahol
9a4aaae3b2 lavc: add GBRAP to avcodec_align_dimensions2 2015-01-14 17:17:24 +01:00
Stefano Sabatini
e2ad0b66fa imgutils: create misc functions for dealing with buffers
Move the lavc/imgconvert functions and rename them as follows:
  avpicture_get_size -> av_image_get_buffer_size()
  avpicture_fill     -> av_image_fill_arrays()
  avpicture_layout   -> av_image_copy_to_buffer()

The new functions have an align parameter, which allows to define the
linesize alignment assumed in the buffer (which is set or read).

The names of the functions are consistent with the lavu/samples API
(av_samples_get_buffer_size(), av_samples_fill_arrays()).

A redundant check has been dropped from av_image_fill_arrays().

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-01-14 17:17:24 +01:00
Vittorio Giovara
1e76345432 png: improve signature check
Return proper error code, print an error message and add missing
parentheses.
2015-01-14 17:10:19 +01:00
Anton Khirnov
7e4e010b80 mpeg4audio: check the init_get_bits() return value
Fixes possible invalid reads.

CC:libav-stable@libav.org
2015-01-09 15:44:31 +01:00
Martin Storsjö
2dbd35b00c libfdk-aacdec: Make sure decoding doesn't add any extra delay in the latest version of fdk-aac
The latest version added support for a new option for enabling
a signal level limiter, which adds some extra delay. In fdk-aac, this
is enabled by default, but disable it by default here since we'd rather
have zero-delay decoding.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-08 13:58:43 +02:00
Martin Storsjö
3852e2c926 libopenh264enc: Fix a typo and some nitpicks
Also move the .long_name entry to below the .name entry.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-08 13:53:25 +02:00
Alexandre Colucci
5a1addd7c1 xsub: Support DXSA subtitles
These have a DXSA tag and contain alpha in addition to
color values for palette.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-07 13:51:30 +01:00
Martin Storsjö
8a3d9ca603 libavcodec: Add an OpenH264 encoder wrapper
Compared to existing, common opensource H264 encoders, this can be
useful since it has got a different license (BSD instead of GPL).

Performance- and qualitywise it is comparable to x264 in ultrafast
mode.

Hooking it up as an encoder in libavcodec also simplifies comparing
it against other common encoders.

This requires OpenH264 1.3 or newer. Since the OpenH264 API and ABI
changes frequently, only releases are supported.

To take advantage of the OpenH264 patent offer, the OpenH264 library
must not be redistributed, but downloaded at runtime at the end-user's
system.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-06 19:58:44 +02:00
Vittorio Giovara
1c6183233d msmpeg4: check memory allocations and propagate errors
Bug-Id: CID 1257781
2015-01-06 16:43:54 +01:00
Vittorio Giovara
ed97963bdb ulti: invert the order of parameters of ulti_decode_frame()
This is the order that the caller uses in the rest of the file.
Variables are modified to reflect the order above too and their
initialization is merged with their declarationt. No behavioral
change.

Bug-Id: CID 732286
2015-01-06 16:43:53 +01:00
Stefano Pigozzi
2cef68da69 vda: error out if decoded CVPixelBuffer is empty
On some video samples, VDA silently fails to decode frames and returns
kVDADecoderNoErr. Error out in these cases to avoid producing AVFrames with
empty planes.

Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
2015-01-05 15:35:39 +01:00
Diego Biurrun
0352ff102d ffv1: const correctness for encode_rgb_frame()
libavcodec/ffv1enc.c:922:53: warning: passing argument 5 of ‘encode_rgb_frame’ discards ‘const’ qualifier from pointer target type
2015-01-05 15:35:39 +01:00
Diego Biurrun
ca09effb01 ffv1: Drop unnecessary casts and const qualifiers to match function signatures
libavcodec/ffv1dec.c:898:36: warning: cast discards ‘const’ qualifier from pointer target type
2015-01-05 15:35:39 +01:00
Anton Khirnov
60d4c6ff76 h264: restore a block mistakenly removed in e10fd08a
CC: libav-stable@libav.org
Bug-ID: 781
2014-12-27 10:44:48 +01:00
Rémi Denis-Courmont
737d35e334 vdpau: add support for the H.264 High 4:4:4 Predictive profile
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-25 20:47:49 +01:00
Rémi Denis-Courmont
ebd5320afd vdpau: add support for 4:2:2 and 4:4:4 chroma sampling
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-25 20:47:49 +01:00
Rémi Denis-Courmont
c220a60f92 vdpau: add helper for surface chroma type and size
Since the VDPAU pixel format does not distinguish between different
VDPAU video surface chroma types, we need another way to pass this
data to the application.

Originally VDPAU in libavcodec only supported decoding to 8-bits YUV
with 4:2:0 chroma sampling. Correspondingly, applications assumed that
libavcodec expected VDP_CHROMA_TYPE_420 video surfaces for output.
However some of the new HEVC profiles proposed for addition to VDPAU
would require different depth and/or sampling:
http://lists.freedesktop.org/archives/vdpau/2014-July/000167.html
...as would lossless AVC profiles:
http://lists.freedesktop.org/archives/vdpau/2014-November/000241.html

To preserve backward binary compatibility with existing applications,
a new av_vdpau_bind_context() flag is introduced in a further change.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-25 20:47:49 +01:00
Rémi Denis-Courmont
6c99c92a42 libavcodec: add AV_HWACCEL_ALLOW_HIGH_DEPTH flag
This can be used by the application to signal its ability to cope with
video surface of types other than 8-bits YUV 4:2:0.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-25 20:47:49 +01:00
Rémi Denis-Courmont
57b6704ecd avcodec: add AVCodecContext.sw_pix_fmt
This carries the pixel format that would be used if it were not for
hardware acceleration. This is equal to AVCodecContext.pix_fmt if
hardware acceleration is not in use.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-25 20:47:49 +01:00
Rémi Denis-Courmont
4cfbeef31d h264: factor hwaccel pixel formats list
This is to avoid proliferation of similar tables in following changes.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-25 20:47:48 +01:00
Kieran Kunhya
9cfa68c560 mpegts: add support for Opus
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 11:29:19 +01:00
Michael Niedermayer
cee4490b52 on2avc: check number of channels
Fixes invalid memory access.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8549
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-19 08:01:47 +01:00
Michael Niedermayer
d423dd72be 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>
2014-12-19 08:01:47 +01:00
Michael Niedermayer
0b39ac6f54 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>
2014-12-19 08:01:47 +01:00
Anton Khirnov
17ba719d9b 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
2014-12-19 08:01:46 +01:00
Anton Khirnov
88626e5af8 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
2014-12-19 08:01:46 +01:00
Anton Khirnov
809c3023b6 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
2014-12-19 08:01:46 +01:00
Vittorio Giovara
210461c0a8 imgconvert: check memory allocations and propagate errors 2014-12-18 23:27:14 +01:00
Vittorio Giovara
596b5c488f wma: check memory allocations and propagate errors 2014-12-18 23:27:14 +01:00
Vittorio Giovara
5ac06633cb takdec: check av_samples_get_buffer_size() return value
CC: libav-stable@libav.org
Bug-Id: CID 747734
2014-12-18 23:27:14 +01:00
Vittorio Giovara
16c7a8a142 aacps: invert the order of parameters of ipdopd_reset()
This is the order that the caller uses in the rest of the file. The
same operation is applied to both parameters, so this change is only
done for consistency, it doesn't change the actual behaviour.

Bug-Id: CID 732285 / CID 732286
2014-12-18 23:27:14 +01:00
Vittorio Giovara
9745f19ffc assdec: check the right variable
CC: libav-stable@libav.org
Bug-Id: CID 1257815
2014-12-18 23:27:14 +01:00
Vittorio Giovara
971099ff5a aacenc: correctly check returned value
CC: libav-stable@libav.org
2014-12-18 23:27:14 +01:00
Vittorio Giovara
ac467d94fa lcl: return an appropriate error code 2014-12-18 23:27:14 +01:00
Vittorio Giovara
c63dd3f0a4 a64multi: check elbg return values 2014-12-18 23:22:59 +01:00
Vittorio Giovara
3beb9cbad3 roqvideo: check memory allocations and propagate errors 2014-12-18 23:22:59 +01:00
Vittorio Giovara
ae2d41ec87 elbg: check memory allocations and propagate errors 2014-12-18 23:22:59 +01:00
Vittorio Giovara
67fc8a15e4 theora: support different visible and coded frame size
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-12-18 23:22:59 +01:00
Paul B Mahol
87bd298abe DPX parser
Additional improvements and fixes by Michael Niedermayer <michaelni@gmx.at>.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-12-18 23:22:59 +01:00
Carl Eugen Hoyos
3a3790b8f8 tiff: support encoding and decoding 64bit images 2014-12-18 23:22:59 +01:00
Michael Niedermayer
3bb465245f h261dec: Fix context initialization sequence
ff_mpv_common_init sets s->context_initialized.

This fixes decoding of h261 in the cases where the demuxer
hasn't already set the frame size.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-18 23:10:24 +02:00
Martin Storsjö
91bfac759d h261enc: Disallow sliced encoding
This avoids trying to do sliced encoding, even if a slice/packet
size is requested (via the -ps option or the rtp_payload_size
field), since the encoder currently doesn't support it (or at least
our decoder can't decode it, even if the h261_encode_gob_header
function is hooked up to be called from the slicing part in
mpegvideo_enc.c).

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-18 12:00:01 +02:00
Vittorio Giovara
10d4c5e55e tiff: set the correct return value when check_size() fails
Only one instance affected and solved as other occurences.
2014-12-15 15:46:34 +01:00
Luca Barbato
3c27275c13 tiff: Check the check_size() return value and forward it
Also use the same type for add_entry and check_size.

Bug-Id: CID 700699
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Vittorio Giovara <vittorio.giovarao@gmail.com>
2014-12-15 15:46:34 +01:00
Luca Barbato
4690e01c3a prores: Evaluate all the quantizers
Prevent an uninitialized data access.

CC: libav-stable@libav.org
Bug-Id: CID 703824 / CID 703825
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-12-15 15:46:34 +01:00
Vittorio Giovara
d75190aa93 mpegvideo: move REBASE_PICTURE where it is used
Drop an unused #undef from h264 decoder.
2014-12-15 15:46:34 +01:00
Vittorio Giovara
63fcedcf01 mpegvideo: remove unused function declaration 2014-12-15 15:46:34 +01:00
Vittorio Giovara
b2bece5e9a hevc: always clip luma_log2_weight_denom
Its value shall be between 0 and 7 according to the specifications.

CC: libav-stable@libav.org
Bug-Id: CID 1257502
2014-12-15 15:46:34 +01:00
Thiago Santos
bab8d73765 vaapi: wrap codec specific functions in appropiate #ifs
Fix linking when only a subset of vaapi decoders is enabled.

Bug-Id: 760
CC: libav-stable@libav.org

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-12-14 22:04:38 +01:00
Michael Niedermayer
5a82ad644f svq1dec: Unbreak the scratch buffer allocation
The input packets are always assumed to be padded and
the av_fast_ family of function takes a pointer to a pointer.

Thanks to Nicolas Dufresne <nicolas.dufresne@collabora.com> for
a similar patch.

Introduced in 7b588bb691.

Bug-Id: 766
CC: libav-stable@libav.org
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-12-14 22:03:58 +01:00
Luca Barbato
bcbdeb318e asvenc: Forward the error instead of asserting on it
Bug-Id: CID 732997
CC: libav-stable@libav.org
2014-12-14 22:03:22 +01:00
Rémi Denis-Courmont
559fa0d41b vdpau: add mapping for H.264 Constrained Baseline profile and fallback
Old VDPAU drivers do not support this newly defined profile, so falling
back to Main profile is necessary for backward binary compatibility.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-14 18:30:03 +01:00
Rémi Denis-Courmont
8502c1e9ff vdpau: add mapping for H.264 Extended profile
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-14 18:29:27 +01:00
Rémi Denis-Courmont
8b51bcfed7 vdpau: revector macro to reduce line span
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-14 18:29:07 +01:00
Martin Storsjö
c7921a4804 libfdk-aacdec: Fix a boundary check
This avoids potential out of bounds writes, with potential future
versions of the library.

Bug-Id: CID 1254945
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-10 22:51:42 +02:00
Janne Grunau
4c81613df4 arm: mlpdsp: handle pic offset calculation in a macro
Makes the code easier to read since it hides different offset
calculations for arm and thumb mode.
2014-12-09 22:00:08 +01:00
Janne Grunau
581c7f0e12 arm: make ff_mlp_filter_channel_arm and ff_mlp_rematrix_channel_arm position independent
No significant difference in used cpu cycles on a cortex-a9.
2014-12-09 22:00:08 +01:00
Martin Storsjö
780cd20b00 aarch64: Use .data.rel.ro for const data with relocations
This reverts commit c00365b46d
in addition to using a different section.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-09 11:43:31 +02:00
Martin Storsjö
f963f80399 arm: Use .data.rel.ro for const data with relocations
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-09 11:43:25 +02:00
Vittorio Giovara
6fd91fa119 h264: increase MAX_SLICES to 32
H264 streams from CounterPath Bria and some Cisco phones need an
increased pool for correct decoding.

Bug-Id: 645
Sample-Id: bria-h264.mka
2014-12-08 13:30:38 +00:00
Zoltan Kovacs
4843a9c74f dpx: always write the image offset
According to the DPX file format description found at
http://www.fileformat.info/format/dpx/egff.htm the ImageElement part of
the GenericImageHeader also contains an an offset to the real image data
beside the same member that can be found in the GenericFileHeader.

Libav keeps this member empty (=0) while some applications expects it to
be filled properly. FATE test updated accordingly.

Bug-Id: 742
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-12-08 13:29:18 +00:00
Martin Storsjö
b280c6202b arm: fft_vfp: Unify the behaviour in ff_fft_calc_vfp between arm/thumb
Don't include the function pointer table in the code segment
in arm mode.

This shouldn't have any significant performance effect. It does
end up as a few more instructions than before, for ARM, but
only at the entry to this function, not within the fft functions
themselves.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-08 12:29:53 +02:00
Martin Storsjö
ae81576414 arm: fft_vfp: Add a missing "endconst" when building in thumb mode
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-08 12:29:49 +02:00
Kieran Kunhya
9a738c27dc v210enc: Add SIMD optimised 8-bit and 10-bit encoders
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-12-05 13:03:49 +00:00
Vittorio Giovara
b72727a524 lavc: mention that the parser callback never returns an error 2014-12-05 00:44:42 +00:00
Michael Niedermayer
894545cb71 mpegvideo: exit cleanly when ff_mpv_common_frame_size_change() fails
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-12-03 12:52:53 +00:00
Michael Niedermayer
7a38987f24 mpegvideo: free_context_frame() cannot fail, make it return void
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-03 12:52:04 +00:00
Michael Niedermayer
c45eeb2dbf mpegvideo: replace assert about interlaced EC with debug av_log()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-03 12:51:43 +00:00
Michael Niedermayer
3a56bcee7c mpeg12dec: Use more specific error codes
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-12-03 12:50:52 +00:00
Michael Niedermayer
b56afb48ae mpeg12dec: Print error/warning messages on issues in mpeg1_decode_sequence()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-03 12:44:58 +00:00
Gonzalo Garramuno
e0bb74a140 exr: Add a gamma flag to exr loader to avoid banding
This is needed to avoid banding artifacts when gammaing the picture.
Currently, if done with a video filter, the process is done on uints
instead of full float.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-12-03 02:55:40 +00:00
Michael Niedermayer
d69d787dad h264: proper cleanup in ff_h264_alloc_tables() if DPB alloc fails
CC: libav-devel@libav.org
2014-12-03 02:51:27 +00:00
Dale Curtis
56de2897a6 h264: Fix memory leak on ff_h264_decode_init() failure
CC: libav-devel@libav.org
2014-12-03 02:51:18 +00:00
Jon Morley
26e20dfd06 options_table: fix colorspace minimum option value
The min value for colorspace should be zero and not one since the first
valid index into the frame colorspace array is AVCOL_SPC_RGB which is 0.
2014-12-02 15:28:22 +00:00
Luca Barbato
7464e98f74 aac: Simplify decode_mid_side_stereo
Might spare few cycles if the compiler is naive and
makes the function more readable.
2014-12-02 15:28:22 +00:00
Anton Khirnov
1973079417 opusdec: make sure all substreams have the same number of coded samples
Fixes invalid writes with invalid multichannel streams.

CC:libav-stable@libav.org
2014-11-27 14:06:03 +01:00
Martin Storsjö
f20141d73f vorbis_parser: Include stdint.h in the header, to make it work standalone
This fixes "make checkheaders".

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-25 14:01:46 +02:00
Michael Niedermayer
57ed5a64fe hnm4: change width/height to int to fix hypothetical integer overflows
CC: libav-stable@libav.org
Bug-Id: CID 1135770 / CID 1135771
2014-11-25 02:00:06 +00:00
Luca Barbato
16158da960 hnm4: Use av_image_check_size
As done for all the other codecs not calling it indirectly.

CC: libav-stable@libav.org
Bug-Id: CID 1135770 / CID 1135771
2014-11-25 02:00:06 +00:00
Michael Niedermayer
51946d2de8 vc1: Use the correct shift amount
`is_intra` is a 6bits bitfield.

CC: libav-stable@libav.org
Bug-Id: CID 1194380 / CID 1194381

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-11-25 02:00:06 +00:00
Luca Barbato
d25afb579f vc1: Set the is_intra bitfield to all 1 when needed
Keep the code as similar as possible across the codepaths to
ease spotting it for factorization.

Based on a patch from Michael Niedermayer <michaelni@gmx.at>.
2014-11-25 02:00:06 +00:00
Luca Barbato
b67138598c vc1: Simplify a little setting the intra variables
The code currently set the information in at least 4 places, spare
some pointless loops.

Make the code in the loop a little uniform to make easier factorize
it out later.
2014-11-25 02:00:06 +00:00
Michael Niedermayer
62e52b94e6 vorbis_parser: Move vp check to avoid a null pointer dereference
CC: libav-stable@libav.org
Bug-Id: CID 1251347
2014-11-25 02:00:06 +00:00
Michael Niedermayer
c117da9d3e lpc: remove unneeded {}
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-25 02:00:06 +00:00
Vittorio Giovara
bc75b64cff vc1pred: remove logically dead code
CC: libav-stable@libav.org
Bug-Id: CID 1245699 / CID 1245700
2014-11-25 02:00:06 +00:00
Vittorio Giovara
208f3abb91 aacsbr: always initialize max_qmf_subbands
Fixes a wordly warning from clang -Wsometimes-uninitialized.
2014-11-24 01:30:15 +00:00
Michael Niedermayer
55b59fab88 roqaudio: Always use the frame buffer on flush
Prevent NULL dereference.

CC: libav-stable@libav.org
Bug-Id: CID 703669
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-11-24 01:30:15 +00:00
Vittorio Giovara
0562887a98 tiffenc: initialize return value
'ret' can only be used without initialization if s->height <= 0, which can
only happen if avctx->height <= 0, which is validated elsewhere. Doesn't hurt
to still initialize it though.

CC: libav-stable@libav.org
Bug-Id: CID 732296
2014-11-24 01:30:15 +00:00
Luca Barbato
299d8ab104 cook: Make sure there is enough extradata
At least 8 bytes are needed (Mono audio).

Bug-Id: CID 741418
CC: libav-stable@libav.org
2014-11-24 01:30:15 +00:00
Vittorio Giovara
b99ca86350 aacdec: avoid an out-of-bounds write
Also move the check in the case it is actually used.

CC: libav-stable@libav.org
Bug-Id: CID 1087090
2014-11-24 01:30:15 +00:00
Vittorio Giovara
277ff7f5dc lavu: move internal define to the only places where it is used 2014-11-24 01:30:14 +00:00
Vittorio Giovara
9c12c6ff95 motion_est: convert stride to ptrdiff_t
CC: libav-stable@libav.org
Bug-Id: CID 700556 / CID 700557 / CID 700558
2014-11-24 01:30:10 +00:00
Luca Barbato
cd975d5658 hevc: Spin the mv_mpv_mode calls in a stand alone function
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-11-21 23:17:37 +01:00
Vittorio Giovara
1f80742f49 qdm2: avoid integer overflow
CC: libav-stable@libav.org
Bug-Id: CID 700555
2014-11-21 12:37:50 +00:00
Luca Barbato
312daa1589 vp9: Use the correct upper bound for seg_id
And use a macro to make apparent why the value.

Bug-Id: CID 1108595
2014-11-21 12:37:05 +00:00
Luca Barbato
d466d82faa dvdsubdec: Do not leak on failure path
CC: libav-stable@libav.org
Bug-Id: CID 1198262
2014-11-21 12:36:19 +00:00
Vittorio Giovara
a42d5c861f libtwolame: prevent a NULL pointer dereference
CC: libav-stable@libav.org
Bug-Id: CID 1250330 / CID 1250335
2014-11-21 12:27:07 +00:00
Martin Storsjö
aa8b39d999 lavc: Move the libtwolame encoder registration to the list for external libraries
This makes sure the default behaviour of using the internal encoder
stays the same regardless if libtwolame is enabled or not (as for
any external library).

This fixes fate-lavf-mpg if libav is built with libtwolame enabled.

CC: libav-stable@libav.org
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-11-21 12:27:07 +00:00
Vittorio Giovara
85dc006b1a lavc: fix bitshifts amount bigger than the type
CC: libav-stable@libav.org
Bug-Id: CID 1194387 / CID 1194389 / CID 1194393 / CID 1206638
2014-11-18 00:39:23 +01:00
Vittorio Giovara
771656bd85 libvpxenc: clean memory on error
CC: libav-stable@libav.org
Bug-Id: CID 733795
2014-11-18 00:38:56 +01:00
Anton Khirnov
8b573ddda7 hevc: remove superfluous assignments and checks 2014-11-17 09:26:45 +01:00
Anton Khirnov
eac3ac1fe0 hevc: eliminate an unneeded intermediate variable 2014-11-17 09:26:45 +01:00
Anton Khirnov
eb335f3c5c hevc: reduce variable scope
Also, collapse the array into a scalar, since only one value is needed
at a time.
2014-11-17 09:26:45 +01:00
Anton Khirnov
84c0ece5fd hevc: further reduce code duplication in hls_prediction_unit() 2014-11-17 09:25:15 +01:00
Anton Khirnov
a7b365ae19 hevc: reduce code duplication in hls_prediction_unit() 2014-11-17 09:25:12 +01:00
Anton Khirnov
de1f8ead89 hevcdsp_template: templatize transquant_bypass 2014-11-17 09:25:12 +01:00
Anton Khirnov
16c01fb434 hevc: remove an unused function parameter 2014-11-17 09:25:12 +01:00
Anton Khirnov
84b9463984 hevc: remove a redundant line
pred_mode is overwritten a few lines immediately below.
2014-11-17 09:25:12 +01:00
Anton Khirnov
2c6a7f9348 hevc: do not store rqt_root_cbf in the context
It does not need to be accessed outside of hls_coding_unit().
2014-11-17 09:25:12 +01:00
Anton Khirnov
920bca3e23 hevc: do not store pcm_flag in the context
It does not need to be accessed outside of hls_coding_unit().
2014-11-17 09:25:12 +01:00
Martin Storsjö
c00365b46d aarch64: Make the function pointer tables position independent
This allows running the code on android, where 64 bit binaries with
text relocations aren't allowed to be loaded.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-16 01:07:24 +02:00
Michael Niedermayer
2fa6d21124 on2avc: Fix out of array access
CC: libav-stable@libav.org
Bug-Id: CID 1206648
2014-11-15 12:50:05 +01:00
Luca Barbato
74d7db586a dv: Drop a spurious check
The buffer is always valid.

Bug-Id: CID 700682
2014-11-15 12:49:37 +01:00
Vittorio Giovara
d16ec1b6db atrac3plus: always initialize refwaves
CC: libav-stable@libav.org
Bug-Id: CID 1163851
2014-11-14 20:26:32 +01:00
Vittorio Giovara
60e0ee7ca2 lpc: always initialize ref and err
CC: libav-stable@libav.org
Bug-Id: CID 29585 / CID 700759
2014-11-14 20:25:52 +01:00
Vittorio Giovara
3a6ddfb874 exr: check return value
CC: libav-stable@libav.org
Bug-Id: CID 1198259
2014-11-14 20:25:21 +01:00
Thilo Borgmann
e4cb6abb2f bgmc: fix sizeof arguments
CC: libav-devel@libav.org
Bug-Id: CID 608084 / CID 700724
2014-11-14 20:25:02 +01:00
Vittorio Giovara
a2448cfe16 jpeg2000: do not compute the same value twice
CC: libav-stable@libav.org
Bug-Id: CID 1026771 / CID 1026772 / CID 1026773
2014-11-13 01:41:27 +01:00
Vittorio Giovara
59846452af svq1enc: check ff_get_buffer return value
CC: libav-stable@libav.org
Bug-Id: CID 747723
2014-11-13 01:41:27 +01:00
Vittorio Giovara
994ab1804b ansi: check ff_set_dimensions return value
CC: libav-stable@libav.org
Bug-Id: CID 1135737
2014-11-13 01:41:27 +01:00
Vittorio Giovara
c7384664ba avs: check ff_set_dimensions return value
CC: libav-stable@libav.org
Bug-Id: CID 1135738
2014-11-13 01:41:27 +01:00
Vittorio Giovara
2b5c1efa14 g2meet: check ff_set_dimensions return value
CC: libav-stable@libav.org
Bug-Id: CID 1135739
2014-11-13 01:41:26 +01:00
Vittorio Giovara
c6d7c201df indeo3: check ff_set_dimensions return value
CC: libav-stable@libav.org
Bug-Id: CID 1135740
2014-11-13 01:41:26 +01:00
Vittorio Giovara
8e104619a6 shorten: check for return value
Avoid a possible negative bitshift.

CC: libav-stable@libav.org
Bug-Id: CID 1194400
2014-11-13 01:41:26 +01:00
Vittorio Giovara
d5d2d6c3b8 dcadec: initialize variables before use
CC: libav-stable@libav.org
Bug-Id: CID 700751 / CID 700752
2014-11-13 01:41:26 +01:00
Vittorio Giovara
1a9c1333b5 escape124: explicitly set get_bits1 variable
Makes coverity less confused.

CC: libav-stable@libav.org
Bug-Id: CID 1203487
2014-11-13 01:41:26 +01:00
Vittorio Giovara
2ffb0598db mlpdec: check for negative index
CC: libav-stable@libav.org
Bug-Id: CID 970924
2014-11-13 01:41:26 +01:00
Vittorio Giovara
6abe7edabb ffv1: fix out-of-bounds read
CC: libav-stable@libav.org
Bug-Id: CID 1047234
2014-11-13 01:41:26 +01:00
Vittorio Giovara
5aa710f461 vorbisenc: add missing parenthesis
Bug-Id: CID 1238791
2014-11-13 01:41:26 +01:00
Vittorio Giovara
e9a6ae775d dpxenc: mention missing break
Bug-Id: CID 732229
2014-11-13 01:41:26 +01:00
Vittorio Giovara
4dda5e9b08 sunrastenc: mention missing break
Bug-Id: CID 732231
2014-11-13 01:41:26 +01:00
Vittorio Giovara
28d82b7675 vc1dec: refactor check with missing parenthesis
FATE tests updated accordingly, no visual difference.

CC: libav-stable@libav.org
Bug-Id: CID 1087087
2014-11-13 01:41:25 +01:00
Vittorio Giovara
2c98dc75f2 vc1dec: always initialize tx and ty
CC: libav-stable@libav.org
Bug-Id: CID 1245702 / CID 1245703
2014-11-13 01:41:25 +01:00
Vittorio Giovara
e3f50f2471 dnxhdenc: check negative index
CC: libav-stable@libav.org
Bug-Id: CID 700464
2014-11-13 01:41:25 +01:00
Vittorio Giovara
b1b1a7370e display: fix order of operands
CC: libav-stable@libav.org
Bug-Id: CID 1238828 / CID 1238832
2014-11-13 01:41:25 +01:00
Vittorio Giovara
bdcb5794f0 nellymoserenc: fix array index
CC: libav-stable@libav.org
Bug-Id: CID 732258
2014-11-13 01:41:25 +01:00
Michael Niedermayer
aa7c429c4e nellymoserenc: fix array element ordering
Fixes assertion failures and valgrind warnings in trellis encoder.

CC: libav-stable@libav.org
Bug-Id: CID 732256 / CID 732257
2014-11-13 01:41:25 +01:00
Vittorio Giovara
8dd0a2c5cf libopusenc: prevent an out-of-bounds read by returning early
CC: libav-stable@libav.org
Bug-Id: CID 1244188
2014-11-13 01:41:25 +01:00
Vittorio Giovara
b09cf8afc5 libopusenc: check return value
CC: libav-stable@libav.org
Bug-Id: CID 739870
2014-11-13 01:41:25 +01:00
Michael Niedermayer
29234f5681 vp7: fix checking vp7_feature_value_size()
CC: libav-stable@libav.org
Bug-Id: CID 1197061
2014-11-13 01:41:25 +01:00
Vittorio Giovara
68a35473ed 4xm: more thorought check for negative index and negative shift
CC: libav-stable@libav.org
Bug-Id: CID 1087094
2014-11-13 01:18:09 +01:00
Luca Barbato
c9c7d59b7d tiff: Use av_mallocz_array
CC: libav-stable@libav.org
2014-11-11 12:01:00 +01:00
John Stebbins
1b66726906 h264_parser: don't stop on SPS_EXT in split
Add SPS_EXT, SEI, and subset SPS to codes that are skipped during split.
These codes can come before the PPS and results in incomplete extradata.
2014-11-11 11:49:55 +01:00
Michael Niedermayer
4cb9f1a774 h264_cabac: fix one fill_rectangle() indentation level
Bug-Id: CID 1087088
2014-11-11 11:49:54 +01:00
Vittorio Giovara
60b0551334 png_parser: fix size of chunk_lenght
Fixes the comparison against constant value 0x7fffffff.

CC: libav-stable@libav.org
Bug-Id: CID 1198260
2014-11-11 11:49:54 +01:00
Vittorio Giovara
443502aed8 dvbsubdec: move shared codepath
CC: libav-stable@libav.org
Bug-Id: CID 1238839
2014-11-11 11:49:54 +01:00
Vittorio Giovara
2383323661 dvbsubdec: improve error checking
Use av_mallocz_array instead of iterating and check the returned memory.
Check returned memory and cleanly exit in case of error during the loop.
Avoid a null pointer dereference for invalid data.

CC: libav-stable@libav.org
Bug-Id: CID 29575
2014-11-11 11:49:54 +01:00
Jernej Fijačko
1bdd21d975 dvbsubdec: add missing break
Fix a memory leak too.

CC: libav-stable@libav.org
Bug-Id: CID 732230
2014-11-11 11:49:54 +01:00
Michael Niedermayer
a6defd1f5b hevc_cabac: decrease CABAC_MAX_BIN
Prevents shifts with undefined behavior, as no syntax element has a valid
value greater than 1 << 31.

Bug-Id: CID 1206635
2014-11-11 11:49:54 +01:00
Vittorio Giovara
9e9be5a20c hevc_mvs: prevent unitialized use
CC: libav-stable@libav.org
Bug-Id: CID 1244202
2014-11-11 11:49:47 +01:00
Vittorio Giovara
0e1ebfebc8 4xm: drop unnecessary check
data_size is always >= 0 in this case.

CC: libav-stable@libav.org
Bug-Id: CID 1238788
2014-11-11 11:41:49 +01:00
Michael Niedermayer
7c61e4b1a0 hpeldsp: Increase put_no_rnd_pixels_tab[][] size
CC: libav-stable@libav.org
Bug-Id: CID 991852
2014-11-11 11:41:49 +01:00
Vittorio Giovara
db71c4926d mjpegenc: fix argument size in encode_mb
CC: libav-stable@libav.org
Bug-Id: CID 1047235
2014-11-11 11:41:49 +01:00
Vittorio Giovara
f349f4b550 mpegvideo: fix size of array
CC: libav-stable@libav.org
Bug-Id: CID 1238789
2014-11-11 11:26:02 +01:00
Vittorio Giovara
898e9a24ef mpegvideo: check mpv return value
CC: libav-stable@libav.org
Bug-Id: CID 1238786
2014-11-11 11:26:02 +01:00
Michael Niedermayer
fe27aeaeab mpeg12enc: increase declared size of block function argument
CC: libav-stable@libav.org
Bug-Id: CID 1047236
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-11-11 11:26:02 +01:00
Martin Storsjö
52f954da75 libavcodec: Unconditionally build xiph.o
vorbis_parser.o is built unconditionally since 5e80fb7ff, and the
unconditionally built parts of it depend on xiph.o.

This fixes builds with --disable-everything.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-11 12:01:16 +02:00
Martin Storsjö
28396d17ff libfdk-aacdec: Support building with the latest version of fdk-aac
The latest fdk-aac code drop (from android 5.0) changed the channel
layout enums (changing the value of existing enum constants), and
renamed the option for downmixing.

The failsafe comparison between ctype and FF_ARRAY_ELEMS(channel_counts)
can trigger warnings (-Wtautological-constant-out-of-range-compare)
when building with the old FDK AAC releases, where it can't be
out of range with the enum values used there.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-10 09:43:57 +02:00
Luca Barbato
e3e317e0c0 lavc: Compact the side-data passthrough 2014-11-09 12:29:59 +01:00
Vittorio Giovara
199d9f995d mjpegdec: fix undefined shift
Add a comment to explain the code.

CC: libav-stable@libav.org
Bug-Id: CID 1194388
2014-11-06 10:44:46 -05:00
Luca Barbato
ac4a5e3abd pthreads_frame: Do not leak on failure path
CC: libav-stable@libav.org
Bug-Id: CID 1135767
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-11-06 10:44:46 -05:00
Vittorio Giovara
5d29efe4b0 mpeg12dec: simplify context duplication
CC: libav-stable@libav.org
Bug-Id: CID 717453 / CID 717454 / CID 717915
2014-11-06 10:44:46 -05:00
Vittorio Giovara
37b3361e75 mpeg12enc: factor out check in encode_dc
Makes coverity less confused and the code more readable.

CC: libav-stable@libav.org
Bug-Id: CID 751744
2014-11-06 10:44:46 -05:00
Vittorio Giovara
0a66647061 mpegvideo_enc: factor out denominator and explicitly cast operands
CC: libav-stable@libav.org
Bug-Id: CID 608053
2014-11-06 10:44:46 -05:00
Vittorio Giovara
e0a1d0a2b0 mpegvideo_enc: rework direct mode check
Remove stray semicolon and share codepaths.

CC: libav-stable@libav.org
Bug-Id: CID 991857
2014-11-06 10:44:46 -05:00