29454 Commits

Author SHA1 Message Date
Laurent Aimar
d57d039e04 tiertexseqv: Check for out of bound reads
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 64263dd526ec25ede1591fc1144715a20cc7bc4e)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:31 +01:00
Laurent Aimar
97a1ab4bce quickdraw: Check for out of bound reads
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 4fd56f842cbaecf74df94c38f9c10452342f436a)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:31 +01:00
Laurent Aimar
914b9b0b2b dsicinav: Check for out of bounds reads
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit e3ca9b93d9f464861638dda3280fcf65e402466a)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:31 +01:00
Laurent Aimar
39de0e008d motionpixels: Fix the size of workspace buffers
Some buffers must be mod 4 in width and/or height.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 210c80331e0604edf9c800865c26ba06ed3c2082)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:31 +01:00
Laurent Aimar
f2f2a00d39 motionpixels: Clear FF_INPUT_BUFFER_PADDING_SIZE bytes at the end of the temporary buffer
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit d337dd3a907110b32c6305bb65e4beca5b830c5d)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:31 +01:00
Laurent Aimar
905d0633a6 wmavoice: Check for corrupted extra data
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit d99427cb8ba099375d8cce6df808d4acf045ab43)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:31 +01:00
Laurent Aimar
95605595b5 wmavoice: Check for out of bound writes
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 1c1449b548a2a0bf0295a522051b04107286653c)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:31 +01:00
Laurent Aimar
fb20141563 xan: Prevent NULL dereferences with missing reference frame
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 06be075cda0a6ba8bab8f543571b380884f562ac)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:31 +01:00
Laurent Aimar
c5766b55c4 bink: Prevent NULL dereferences with missing reference frame
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit c7e631986b4a326a71a20a1a51000f3fbf6e64e7)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Laurent Aimar
d646cce15f wavpack: Reset internal state on corrupted blocks
wavpack_decode_block() supposes that it is called back with the exact
same buffer unless it has returned with an error. With multi-channels
files, wavpack_decode_frame() was breaking this assumption.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 2c6cf1394096d08396faadc6e7c0b404fd6df006)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Laurent Aimar
04b71cdedd wmapro: Validate the number of audio channels before using it
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 2c1ba7994190fa2f1ad430594551070a49353bd1)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Laurent Aimar
fce03f8783 mpc8: Fix return value on EOF
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 1e3336de69d1c4c28a5e306fab20555f4078f2d7)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Laurent Aimar
22949c42ed shorten: Prevent block size from increasing
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 95010d18b2d808db9a49377e41bc2f7cf4dfa03e)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Laurent Aimar
8751941030 xan: Prevent out of bound accesses
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 124a16f678ddcffe8f1825efb29a6e8da1d580ac)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Laurent Aimar
3e1b5981ba vp56: Release old pictures after a resolution changes
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 3d09d0017d10a0d738141a955c75c555133e41b2)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Laurent Aimar
efe3fb13a7 vp56: Check for missing reference frame data
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 0ec6d6e9b682318b5b5b5457e09fbf3c4ca41335)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Laurent Aimar
987f5dc55e cinepak: Fix invalid read access on extra data
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit d239d4b447885cb7c5eee9ce359f34ad6b64f373)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Laurent Aimar
5bb9ce755b cook: Fix js_vlc_bits value validation for joint stereo
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 3a742470a845c24e7c3a40c0a228705ca951e673)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Laurent Aimar
ea5a5f0908 segafilm: Check for memory allocation failures in segafilm demuxer.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 1775b92fee43f0527e2f5892a5a30450fa929722)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Laurent Aimar
619aab2f41 Fixed deference of NULL pointer in motionpixels decoder.
Some of the arguments given to init_vlc() come from the stream
and can be corrupted.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 69a0bce753a5d5556d5bc0888afe390e22611dd8)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Ronald S. Bultje
8099d77ca4 mpegvideo: set correct offset for edge emulation buffer.
Using the old code, half of it was unused and the other half was too
small for e.g. >8bpp interlaced data, causing random buffer overruns.
(cherry picked from commit 330deb75923675224fb9aed311d3d6ce3ec52420)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Ronald S. Bultje
bb7fd94eeb mpegvideo: fix position of bottom edge.
It was wrong in colorspaces where horizontal and vertical chroma
subsampling are not the same, e.g. 422.
(cherry picked from commit 0884dd5a1b87aff6c8a06e6492dece5cef8f3978)

Conflicts:

	libavcodec/mpegvideo.c

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Chris Rankin
ea311af23d qcelpdec: fix the return value of qcelp_decode_frame().
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
(cherry picked from commit bde25700134b98068e2ad21c1f92955a4b489cdc)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:30 +01:00
Justin Ruggles
4562f95ba8 sipr: fix the output data size check and only calculate it once.
(cherry picked from commit 1b5a189f06879338088809b3049ea7620f4e7e78)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:27 +01:00
Justin Ruggles
fc0e151cdc mpc8: check output buffer size before decoding
(cherry picked from commit 5674d4b0a35a34b75e3533a8580e0b5a0a8895a7)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:25 +01:00
Justin Ruggles
56fe62ec94 mpc7: return error if packet is too small.
(cherry picked from commit 8290d1f38b438f1b070de67645c8b4a42014c7ac)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:22 +01:00
Justin Ruggles
ce3e0d48f8 mpc7: check output buffer size before decoding
(cherry picked from commit c8b5c4d27409dfdcec80868686b173ba446c998b)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:20 +01:00
Justin Ruggles
d46efbebe7 nellymoser: check output buffer size before decoding
(cherry picked from commit 8b31c086b6065084644b86a63c9171f3094cf6ad)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:17 +01:00
Martin Storsjö
151aaf539f lavf: Avoid using av_malloc(0) in av_dump_format
On OS X, av_malloc(0) returns pointers that cause crashes when
freed.

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:17 +01:00
Stefano Sabatini
f74a4b621f avfiltergraph: use meaningful error codes
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 59cef18c24ab21de4e652e130ac25905c1141f62)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:17 +01:00
Justin Ruggles
7fc9aa6d35 flacdec: fix buffer size checking in get_metadata_size()
Adds an additional check before reading the next block header and avoids a
potential integer overflow when checking the metadata size against the
remaining buffer size.
(cherry picked from commit 4c5e7b27d57dd2be777780e840eef9be63242158)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:17 +01:00
Justin Ruggles
ce80957cf1 sol: return error if av_get_packet() fails.
This prevents sending a packet with data=NULL size=AVERROR_EOF.
(cherry picked from commit b15a9888a8f8e8cc9784ffd8d5d0307900fb78bb)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:17 +01:00
Laurent Aimar
74f4c1358c flvdec: Fix invalid pointer deferences when parsing index
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 2b4e49d4281690db67073ba644ad2ffc17767cdf)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:17 +01:00
Peter Ross
8475df8158 permit decoding of multichannel ADPCM_EA_XAS
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3a549eb82be709d633a0ba964b037ee2f700e0c9)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:17 +01:00
Reimar Döffinger
282a1a960a Fix input buffer size check in adpcm_ea decoder.
Unfortunately the output buffer size check assumes that the
input buffer is never over-consumed, thus this actually
also allowed to write outside the output buffer if "lucky".

Based on:
git.videolan.org/ffmpeg.git
commit 701d0eb185192542c4a17f296e39e37cedf7abc6
(cherry picked from commit ffe92ff9f0c7f390d895de12c8ffef959ced3cd8)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:17 +01:00
Sean McGovern
2ba86066be fft: avoid a signed overflow
As a signed integer, 1<<31 overflows, so force it to unsigned.

Signed-off-by: Alex Converse <alex.converse@gmail.com>
(cherry picked from commit c2d3f561072132044114588a5f56b8e1974a2af7)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:17 +01:00
Alex Converse
2f62b677cc mpegps: Handle buffer exhaustion when reading packets.
(cherry picked from commit 9fba8ebe0acdc28193d37b5e1f4c0d73c589ede2)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:14 +01:00
Alex Converse
684f671f28 mp4: Don't read an empty Decoder Config Descriptor
(cherry picked from commit 1c2e07b8111b24f62b8d1bda62907848e34dfbcb)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:11 +01:00
Laurent Aimar
000bd5209f rv34: Check for invalid slices offsets
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit fe476e5a9b5a1e56e53f1fa62374778fa00ec1fd)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-18 17:50:11 +01:00
Ronald S. Bultje
047c6ad752 h264: disallow constrained intra prediction modes for luma.
Conversion of the luma intra prediction mode to one of the constrained
("alzheimer") ones can happen by crafting special bitstreams, causing
a crash because we'll call a NULL function pointer for 16x16 block intra
prediction, since constrained intra prediction functions are only
implemented for chroma (8x8 blocks).

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 45b7bd7c53b41bc5ff6fc2158831f2b1b1256113)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 248d4e461578ff327a2fd75fd0db4f38c270918a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-02-19 15:41:16 +01:00
Mans Rullgard
6362264e2d h264: fix HRD parameters parsing
The bit_rate_value_minus1 and cpb_size_value_minus1 elements
allow a wider range than get_ue_golomb() supports.  This
adds a get_ue_golomb_long() function supporting up to 31
leading zeros, which is the maximum for these syntax
elements, and uses it in decode_hrd_parameters().

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit fdba370f8a1bdfc22ecbdf3c7148c2f8680a4ac4)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:43 +01:00
Mans Rullgard
ccb3b71b42 h264: fix invalid shifts in init_cavlc_level_tab()
The level_code expression includes a shift which is invalid in
those cases where the value is not used.  Moving the calculation
to the branch where the result is used avoids these.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 8babfc033ecb6332155c1f8879e54dee41d16952)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:43 +01:00
Mans Rullgard
4ed486dc3a h264: fix detection of optional trailing PPS elements
The PPS may contain a few trailing elements whose presence is
only signalled by data remaining after the the mandatory part
has been parsed.  The current code fails to take into account
the rbsp_trailing_bits() when deciding whether to parse these
optional elements.  Assuming no unnecessary padding bytes are
passed to this function, the optional elements are present if
either more than 8 extra bits remain or the remaining bits do
not form a valid rbsp_trailing_bits() after the mandatory PPS
elements have been parsed.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit be1242a3f2b28e9cb08515bdc1db6c14403c279a)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:42 +01:00
Laurent Aimar
ba31a01681 h264: reset h->ref_count in case of errors in ff_h264_decode_ref_pic_list_reordering()
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 4c7a232fc81fdbdee279ab819a255f624a22b083)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:42 +01:00
Mans Rullgard
1e809ab887 h264pred: use unsigned types for pixel values, fix signed overflows
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 60f10e0ad37418cc697765d85b0bc22db70f726a)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:42 +01:00
Michael Niedermayer
c6bb93dcd9 H264: Only wait before triggering ff_thread_setup_complete() until the next slice that contains a start-of-field/frame macroblock
This allows concurrent decoding of the last field/frame, rather than
only the last slice, of data packets with multiple NAL units packed
together.

This will fix the slowdown reported in e.g. bug 52.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 14c21c1ff509eac97f6437aeb51202b15af3a700)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:42 +01:00
Ronald S. Bultje
485f85aa90 h264: correct implicit_weight for field-interlaced pictures.
(cherry picked from commit 4418aa9cb3b2f0b83748e37d2952560cf84b3611)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:42 +01:00
Laurent Aimar
ec2a1d91e2 h264: check for out of bounds reads in ff_h264_decode_extradata().
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit d1186ff72d75b6067770890758c4feb92abd84f7)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-19 15:08:42 +01:00
Stefano Sabatini
958e0f705d lavfi: fix realloc size computation in avfilter_add_format()
Replace sizeof((*avff)->formats)
with    sizeof(*(*avff)->formats)

as the size of the array element is given by the pointed element
rather than by its pointer.

In particular fix computation with the pending patch when
sizeof(int64_t) != sizeof(int64_t *).

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-02-08 15:04:21 +01:00
Stefano Sabatini
734a9bb05f vf_unsharp: fix out-of-buffer read
In apply_unsharp(), when y is >= height, prevent out-of-buffer reading
from src, read from the last buffer line in src2 instead.

The check was implemented in the original unsharp libmpcodecs code and
lost in the port.

This also fixes output discrepancy between the two filters.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 998e8519efbc772994c5ba19c0d39573998be9db)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-02-08 14:38:31 +01:00