40572 Commits

Author SHA1 Message Date
Vittorio Giovara
d1ad85fc02 vf_format: check input validity
CC: libav-stable@libav.org
2015-01-13 00:01:08 +01:00
Vittorio Giovara
6cf27b550d aviobuf: check context before using it
Avoid a possible null pointer dereference.

CC: libav-stable@libav.org
Bug-Id: CID 1135769
2015-01-13 00:00:56 +01:00
Michael Niedermayer
5aceced0a0 avio: fix sizeof argument
CC: libav-stable@libav.org
Bug-Id: CID 732284
2015-01-13 00:00:43 +01:00
Vittorio Giovara
27487944ef swscale: fix sign extensions in yuv planar conversion
Casting the left-most byte to unsigned avoids an undefined
result of the shift by 24 if bit 7 is set.

yuvPlanartouyvy_c and yuvPlanartoyuy2_c are affected.

CC: libav-stable@libav.org
Bug-Id: CID 732281 / CID 732282
2015-01-13 00:00:28 +01:00
Timothy Gu
51f76e4e93 oss_audio: use a macro to simplify ioctl() error checking
Also add a note about SNDCTL_DSP_GETFMTS which may fail even if OSS is
available.

CC: libav-stable@libav.org
Bug-Id: CID 1238992
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-01-13 00:00:17 +01:00
Luca Barbato
c246b0b4c3 avresample: Make sure the even check does not overflow
CC: libav-stable@libav.org
Bug-Id: CID 732225
2015-01-12 23:59:59 +01:00
Vittorio Giovara
daef7feb09 af_resample: check av_opt_set_dict return value
CC: libav-stable@libav.org
Bug-Id: CID 1087076
2015-01-12 23:59:48 +01:00
Vittorio Giovara
2496dbd68b vf_showinfo: Forward the av_image_get_linesize error
CC: libav-stable@libav.org
Bug-Id: CID 1087086
2015-01-12 23:59:32 +01:00
Luca Barbato
608e8d8dd7 vf_drawtext: Do not leak the mmapped textfile
And validate its size while at it.

CC: libav-stable@libav.org
Bug-Id: CID 1244189
2015-01-12 23:59:15 +01:00
Luca Barbato
4d48691622 cmdutils: Use the correct guard
The OptionDef arrays are terminated with a { NULL } element not NULL.

CC: libav-stable@libav.org
Bug-Id: CID 703769
2015-01-12 23:58:58 +01:00
Luca Barbato
bb823e26b1 avformat: Make avformat_free_context handle NULL
Work as the other free()-like functions.

Bug-Id: CID 1087081
CC: libav-stable@libav.org
2015-01-12 23:58:25 +01:00
Michael Lynch
b31bb39bdd rtsp: Check a memory allocation
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-12 23:58:05 +01:00
Luca Barbato
036f5c5420 rm: Use the correct codec_data_size signedness
The function takes a size and not an offset.

CC: libav-stable@libav.org
Sample-Id: rm_deadlock.rm

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-12 23:18:01 +01:00
Luca Barbato
da35008c31 latm: Do not give a score for a single instance
Bug-Id: 773
CC: libav-stable@libav.org
2015-01-12 23:18:01 +01:00
Luca Barbato
4baee1124b mp3: Tweak the probe scores
Having more than 10 consecutive frames decoded as mp3 should be
considered a clear signal that the sample is mp3 and not mpegps.

Reported-By: Florian Iragne <florian@iragne.fr>
CC: libav-stable@libav.org
2015-01-12 23:18:01 +01:00
Vittorio Giovara
bbb86717b3 vf_frei0r: do not increment string if it reached the end
Bug-Id: 778
CC: libav-stable@libav.org
2015-01-12 23:18:01 +01:00
Michael Niedermayer
1fd55ec507 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 7b588bb691644e1b3c168b99accf74248a24e3cf.

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>
2015-01-12 23:16:05 +01:00
Thiago Santos
20f9cf744a 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>
2015-01-12 23:16:05 +01:00
Vittorio Giovara
20d6ae4626 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
2015-01-12 23:16:05 +01:00
Luca Barbato
23fe589e19 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>
2015-01-12 23:15:19 +01:00
Luca Barbato
9bd4561d74 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>
2015-01-12 23:15:03 +01:00
Martin Storsjö
cbf31d5f15 rtpdec_h263_rfc2190: Clear the stored bits if discarding buffered data
If we throw away the buffered incomplete frame, make sure to also
throw away the buffered bits of an incomplete byte at the same
time.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit df07c07b3de0a5e8890078944de1eb5cb8372ef8)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-12 23:14:38 +01:00
Michael Niedermayer
21683549ed 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>
(cherry picked from commit 3bb465245fed6069512e6821000391beae8a6066)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-12 23:14:26 +01:00
Vittorio Giovara
cbfdbba58e cmdutils: check file access functions return values
CC: libav-stable@libav.org
Bug-Id: CID 703706
(cherry picked from commit 38129c26c51b933d7db423f904ba0cd6a88ca1ed)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-12 23:14:06 +01:00
Vittorio Giovara
1411f073fd aacenc: correctly check returned value
CC: libav-stable@libav.org
(cherry picked from commit 971099ff5a85377579eb5b8d3620e283957f097e)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-12 23:12:25 +01:00
Vittorio Giovara
76e9a17f33 lavfi: always check av_expr_parse_and_eval() return value
CC: libav-stable@libav.org
Bug-Id: CID 703624
(cherry picked from commit 63be97ec403023fb664798432acedaf6e6922527)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-12 23:12:10 +01:00
Alexandre Colucci
3d0752d82f 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>
(cherry picked from commit 5a1addd7c1d8ff218ed4b84f4f02fdb83980094c)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-12 22:23:35 +01:00
Anton Khirnov
bfe18be88a mpeg4audio: check the init_get_bits() return value
Fixes possible invalid reads.

CC:libav-stable@libav.org
(cherry picked from commit 7e4e010b80e76862e83afbd41c25d50e72f0b44c)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-12 22:21:54 +01:00
Luca Barbato
f6c82b34a3 segment: Fix the failure paths
A failure in segment_end() or segment_start() would lead to freeing
a dangling pointer and in general further calls to seg_write_packet()
or to seg_write_trailer() would have the same faulty behaviour.

CC: libav-stable@libav.org
Reported-By: luodalongde@gmail.com
(cherry picked from commit b3f04657368a32a9903406395f865e230b1de348)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-12 22:21:39 +01:00
Vittorio Giovara
3280b86c85 swscale: check memory allocations
CC: libav-stable@libav.org
Bug-Id: CID 1257779
(cherry picked from commit 1dd797e3c9f179f957316a0becbec048b42df8aa)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-12 22:19:55 +01:00
Vittorio Giovara
61335ab33e opt: check memory allocation
CC: libav-stable@libav.org
Bug-Id: CID 1257771
(cherry picked from commit 07a0c0f0005072d115ace61e60f46be68582cc3a)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-12 22:19:38 +01:00
Martin Storsjö
932caa50a5 libavformat: Check for malloc failures in avformat_new_stream
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 9f810a9b374e0ff8e2a19fd8a7347afe2933e229)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-12 22:19:11 +01:00
Anton Khirnov
883795fb0f h264: restore a block mistakenly removed in e10fd08a
CC: libav-stable@libav.org
Bug-ID: 781
(cherry picked from commit 60d4c6ff76467d4d8f55c1cc61ab6c618e8ea2f3)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-27 11:07:45 +01:00
Michael Niedermayer
4895211635 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>
(cherry picked from commit cee4490b521fd0d02476d46aa2598af24fb8d686)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:51:41 +01:00
Michael Niedermayer
58dc526ebf smc: fix the bounds check
Fixes invalid writes when there are more blocks in a run than total
remaining blocks.

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

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

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

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

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

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8541
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 809c3023b699c54c90511913d3b6140dd2436550)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:51:40 +01:00
Anton Khirnov
577f1feb3f mov: avoid a memleak when multiple stss boxes are present
CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 64f7575fbd64e5b65d5c644347408588c776f1fe)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 10:51:40 +01:00
Luca Barbato
3ea49fc508 vc1: Do not assume seek happens after decoding
If a seek is requested before the decoding start there is no
current picture.

CC: libav-stable@libav.org
(cherry picked from commit 3e348ecfc6ab1830e43288a9e12e8f0a000afbcb)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-12-19 17:58:22 +01:00
Julien Ramseier
864c0c50eb avconv: Use the mpeg12 private option scan_offset
Introduced in aed790070486b1b01b48106310d9d0ca1730e459

Bug-Id: debian/773055
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit fd665f7f48fa7db89eb9a93ac33919f6adc40f9d)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-14 18:43:25 +01:00
Reinhard Tartler
1cc6fef067 Prepare for 11.1 Release 2014-12-01 21:39:37 -05:00
Reinhard Tartler
60ccc1a748 Update changelog for v11.1 2014-12-01 21:39:01 -05:00
Reinhard Tartler
b31a3c6f26 Replace lena.pnm
The new reference.pnm is a freely licensed replacement. The photo has
been taken by Reinhard Tartler on August 28 2014, and is licensed under
the expat license as stated at http://www.jclark.com/xml/copying.txt

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

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

(cherry picked from commit 0f257e29c5520b215e573e7e3abde8e5a4743309)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-12-01 08:02:37 -05:00
Anton Khirnov
ca78ee73db opusdec: make sure all substreams have the same number of coded samples
Fixes invalid writes with invalid multichannel streams.

CC:libav-stable@libav.org
(cherry picked from commit 1973079417e8701b52ba810a72cb6c7c6f7f9a56)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 14:11:51 +01:00
wm4
517ce1d09b lavu: fix memory leaks by using a mutex instead of atomics
The buffer pool has to atomically add and remove entries from the linked
list of available buffers. This was done by removing the entire list
with a CAS operation, working on it, and then setting it back again
(using a retry-loop in case another thread was doing the same thing).

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

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit fbd6c97f9ca858140df16dd07200ea0d4bdc1a83)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 13:38:29 +01:00
Anton Khirnov
46a17d886b lavu: add wrappers for the pthreads mutex API
Also add no-op fallbacks when threading is disabled.

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

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

(cherry picked from commit 2443e522f0059176ff8717c9c753eb6fe7e7bbf1)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 13:38:27 +01:00
Anton Khirnov
12700b0219 mp3enc: fix a triggerable assert
We have to check against the number of bytes actually needed, not the
theoretical maximum size.
2014-11-14 20:22:40 +01:00