Derek Buitenhuis [Fri, 26 Aug 2016 13:30:06 +0000 (14:30 +0100)]
mov: Remove ancient heuristic hack
This breaks files with legitimate single-entry edit lists,
and the hack, introduced in f03a081df09f9c4798a17d7e24446ed47924b11b,
has no link to any known sample in its commit message.
Diego Biurrun [Wed, 24 Aug 2016 15:00:11 +0000 (17:00 +0200)]
libvpx: Cast a pointer to const to squelch a warning
libavcodec/libvpxdec.c:100:57: warning: passing argument 3 of 'av_image_copy' from incompatible pointer type
av_image_copy(picture->data, picture->linesize, img->planes,
libavutil/imgutils.h:116:6: note: expected 'const uint8_t **' but argument is of type 'unsigned char **'
void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
Anton Khirnov [Sun, 14 Aug 2016 08:18:39 +0000 (10:18 +0200)]
mss12: validate display dimensions
The code currently reads the coded dimensions from the extradata, but
expects the display dimensions to be set by the caller, and does not
check that they are compatible (i.e. that the displayed size is smaller
than the coded size).
Make sure that when the display dimensions are set, they are also valid.
Fixes possible invalid memory access.
CC: libav-stable@libav.org Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Anton Khirnov [Sun, 14 Aug 2016 08:18:39 +0000 (10:18 +0200)]
alac: do not return success if nothing was decoded
If we encounter an END element before anything is decoded, we would
return success even though the output frame has not been allocated,
which is invalid.
CC: libav-stable@libav.org Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Mark Thompson [Thu, 28 Jul 2016 22:28:30 +0000 (23:28 +0100)]
hwcontext_vaapi: Try the first render node as the default DRM device
If no string argument is supplied when av_hwdevice_ctx_create() is
called to create a VAAPI device, we currently only try the default
X11 display (that is, $DISPLAY) to find a device, and will therefore
fail in the absence of an X server to connect to. Change the logic
to also look for a device via the first DRM render node (that is,
"/dev/dri/renderD128"), which is probably the right thing to use in
most simple configurations which only have one DRM device.
Ronald S. Bultje [Sat, 23 Nov 2013 15:27:18 +0000 (10:27 -0500)]
vp9: split last/cur_frame from the reference buffers.
We need more information from last/cur_frame than from reference
buffers, so we can use a simplified structure for reference buffers,
and then store mvs and segmentation map information in last/cur.
This prepares the decoder for frame threading support.
Anton Khirnov [Tue, 2 Aug 2016 08:43:39 +0000 (10:43 +0200)]
h264_direct: use the reference mask from the actual reference
Not from the underlying frame. Fixes races with frame threading in
field-coded files, where decoding would wait for the wrong field (e.g.
random failures in mixed-nal-coding).
Anton Khirnov [Wed, 3 Aug 2016 07:51:06 +0000 (09:51 +0200)]
buffer: fix av_buffer_pool_init2() documentation
A non-existent av_buffer_pool_can_uninit() function is mentioned instead
of av_buffer_pool_uninit(). Also, this function is to be called by the
caller, not the pool itself.
Anton Khirnov [Tue, 2 Aug 2016 19:16:44 +0000 (21:16 +0200)]
buffer: fix av_buffer_realloc() when the data is offset wrt buffer start
In such a case behave as if the buffer was not reallocatable -- allocate a
new one and copy the data (preserving just the part described by the
reference passed to av_buffer_realloc).
Since 230b1c070, the bytewise AV_W*() macros only expand their
argument once, i.e. doing exactly the same change as was done
in the AV_COPY*U macros, so this change is no longer necessary.
Martin Storsjö [Mon, 1 Aug 2016 07:04:42 +0000 (10:04 +0300)]
intreadwrite: Use the __unaligned keyword on MSVC for ARM and x86_64
AV_WN64 is meant for unaligned data, but the existing av_alias* unions
(without a definition for the av_alias attribute - we don't have one
for MSVC) indicate to the compiler that they would have sufficient
alignment for normal access, i.e. the compiler is free to assume
8 byte alignment.
On ARM, this makes sure that AV_WN64 (or two consecutive AV_WN32) is
done with two str instructions instead of one strd.
Martin Storsjö [Mon, 1 Aug 2016 06:07:48 +0000 (09:07 +0300)]
intreadwrite: Add intermediate variables in the byteswise AV_W*() macros
This avoids issues with expanding the argument multiple times,
and makes sure that it is of the right type for the following shifts.
Even if the caller of a macro could be expected not to pass parameters
that have side effects if expanded multiple times, these fallback
codepaths are rarely, if ever, tested, so it is expected that such
issues can arise.
Thefore, for safety, make sure the fallback codepaths only expand
the arguments once.
Martin Storsjö [Thu, 28 Jul 2016 11:30:25 +0000 (14:30 +0300)]
libavutil: Use an intermediate variable in AV_COPY*U
If AV_RN and AV_WN are macros with multiple individual reads and
writes, the previous version of the AV_COPYU macro would fail if
the reads and writes overlap.
This should not be any less efficient in any case, given a
sensibly optimizing compiler.
Martin Storsjö [Thu, 28 Jul 2016 10:10:22 +0000 (13:10 +0300)]
Don't use expressions with side effects in macro parameters
AV_WB32 can be implemented as a macro that expands its parameters
multiple times (in case AV_HAVE_FAST_UNALIGNED isn't set and the
compiler doesn't support GCC attributes); make sure not to read
multiple times from the source in this case.