platform/upstream/libav.git
11 years agoqdm2: Conceal broken samples
Luca Barbato [Tue, 9 Jul 2013 12:59:33 +0000 (14:59 +0200)]
qdm2: Conceal broken samples

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agoqdm2: refactor joined stereo support
Luca Barbato [Tue, 9 Jul 2013 12:44:02 +0000 (14:44 +0200)]
qdm2: refactor joined stereo support

qdm2 does support only two channels. Loop over the run once.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agoadpcm: Write the correct number of samples for ima-dk4
Luca Barbato [Sun, 7 Jul 2013 10:56:12 +0000 (12:56 +0200)]
adpcm: Write the correct number of samples for ima-dk4

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agoimc: Catch a division by zero
Luca Barbato [Tue, 9 Jul 2013 07:18:16 +0000 (09:18 +0200)]
imc: Catch a division by zero

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agoatrac3: Error on impossible encoding/channel combinations
Luca Barbato [Tue, 9 Jul 2013 02:44:26 +0000 (04:44 +0200)]
atrac3: Error on impossible encoding/channel combinations

Joint stereo encoded mono is impossible.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agoatrac3: set the getbits context the right buffer_end
Luca Barbato [Tue, 9 Jul 2013 02:20:23 +0000 (04:20 +0200)]
atrac3: set the getbits context the right buffer_end

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agoatrac3: fix error handling
Luca Barbato [Mon, 8 Jul 2013 23:03:13 +0000 (01:03 +0200)]
atrac3: fix error handling

decode_tonal_components returns a proper AVERROR.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agomovenc: Rename the timestamp parameter to dts in write_hint_packets
Martin Storsjö [Sun, 7 Jul 2013 14:03:00 +0000 (17:03 +0300)]
movenc: Rename the timestamp parameter to dts in write_hint_packets

This matches its actual intended use better.

Signed-off-by: Martin Storsjö <martin@martin.st>
11 years agomovenc: Make sure the RTP hint tracks have nondecreasing DTS
Martin Storsjö [Sun, 7 Jul 2013 13:55:26 +0000 (16:55 +0300)]
movenc: Make sure the RTP hint tracks have nondecreasing DTS

The RTP timestamps can be decreasing for codecs with B-frames. For
these cases, make sure the timestamps in the MP4 file track itself
are nondecreasing, and add an offset to the RTP packet hint instead
to produce the intended RTP timestamp.

Signed-off-by: Martin Storsjö <martin@martin.st>
11 years agoqdm2: check and reset dithering index per channel
Luca Barbato [Thu, 27 Jun 2013 00:50:52 +0000 (02:50 +0200)]
qdm2: check and reset dithering index per channel

Checking per subband would have the index exceed the
dithering noise table size.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agoqdm2: formatting cosmetics
Luca Barbato [Thu, 27 Jun 2013 00:49:15 +0000 (02:49 +0200)]
qdm2: formatting cosmetics

Apply the usual style plus drop few unnecessary return at the end
of void functions.

11 years agoqdm2: use init_static_data
Luca Barbato [Thu, 27 Jun 2013 00:20:59 +0000 (02:20 +0200)]
qdm2: use init_static_data

11 years agowestwood_vqa: do not free extradata on error in read_header
Luca Barbato [Thu, 27 Jun 2013 02:30:20 +0000 (04:30 +0200)]
westwood_vqa: do not free extradata on error in read_header

The extradata is already freed by avformat_open_input on
failure.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agovqavideo: check the version
Luca Barbato [Thu, 27 Jun 2013 01:19:05 +0000 (03:19 +0200)]
vqavideo: check the version

Prevent out of buffer write.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agocmdutils: wrap exit explicitly
Luca Barbato [Sat, 6 Jul 2013 23:52:51 +0000 (01:52 +0200)]
cmdutils: wrap exit explicitly

Some C runtime implementations deadlock when calling threading functions
on the atexit() handler.

Use a simpler wrapper similar to av_log to call the cleanup function
before exit.

Bug-Id: 523

11 years agomovenc: K&R formatting cosmetics
Martin Storsjö [Sun, 7 Jul 2013 11:59:47 +0000 (14:59 +0300)]
movenc: K&R formatting cosmetics

Signed-off-by: Martin Storsjö <martin@martin.st>
11 years agoMakefile: Remove stray tabs
Michael Niedermayer [Sun, 7 Jul 2013 09:56:02 +0000 (11:56 +0200)]
Makefile: Remove stray tabs

Signed-off-by: Martin Storsjö <martin@martin.st>
11 years agovp8: Wait for prev_frame to parse segment_map before reading it
Ronald S. Bultje [Sun, 23 Jun 2013 04:16:11 +0000 (21:16 -0700)]
vp8: Wait for prev_frame to parse segment_map before reading it

This fixes occasional failures of vp8-test-vector-010 with frame-level
multithreading enabled.

Signed-off-by: Martin Storsjö <martin@martin.st>
11 years agoyuv4mpeg: Correctly round chroma up for odd luma sizes
Ronald S. Bultje [Mon, 24 Jun 2013 23:13:58 +0000 (19:13 -0400)]
yuv4mpeg: Correctly round chroma up for odd luma sizes

Signed-off-by: Martin Storsjö <martin@martin.st>
11 years agormdec: Use the AVIOContext given as parameter in rm_read_metadata()
Michael Niedermayer [Mon, 1 Jul 2013 21:38:08 +0000 (23:38 +0200)]
rmdec: Use the AVIOContext given as parameter in rm_read_metadata()

This fixes crashes when playing back certain RealRTSP streams.

When invoked from the RTP depacketizer, the full realmedia
demuxer isn't invoked, but only certain functions from it, where
a separate AVIOContext is passed in as parameter (for the buffer
containing the data to parse). The functions called from within
those entry points should only be using that parameter, not
s->pb. In the depacketizer case, s is the RTSP context, where ->pb
is null.

Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years agoavio: Handle AVERROR_EOF in the same way as the return value 0
Michael Niedermayer [Mon, 24 Jun 2013 12:23:44 +0000 (14:23 +0200)]
avio: Handle AVERROR_EOF in the same way as the return value 0

This makes sure the ffurl_read_complete function actually
returns the number of bytes read, as the documentation of the
function says, even if the underlying protocol uses AVERROR_EOF
instead of 0.

Signed-off-by: Martin Storsjö <martin@martin.st>
11 years agowtv: Mark attachment with a negative stream id
Luca Barbato [Mon, 24 Jun 2013 16:12:24 +0000 (18:12 +0200)]
wtv: Mark attachment with a negative stream id

A sid 0 would be mismatched to the attachment.

Prevent NULL pointer dereference.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agoavprobe: rename the prettyprint structures
Luca Barbato [Fri, 21 Jun 2013 12:47:01 +0000 (14:47 +0200)]
avprobe: rename the prettyprint structures

11 years agotools: Wording and formatting cosmetics
Diego Biurrun [Fri, 5 Jul 2013 15:42:37 +0000 (17:42 +0200)]
tools: Wording and formatting cosmetics

11 years agotests: Only run noproxy test if networking is enabled
Diego Biurrun [Tue, 2 Jul 2013 15:16:18 +0000 (17:16 +0200)]
tests: Only run noproxy test if networking is enabled

11 years agofifo: K&R formatting cosmetics
Luca Barbato [Sat, 6 Jul 2013 10:05:27 +0000 (12:05 +0200)]
fifo: K&R formatting cosmetics

11 years agokmvc: Clip pixel position to valid range
Luca Barbato [Mon, 1 Jul 2013 01:05:41 +0000 (03:05 +0200)]
kmvc: Clip pixel position to valid range

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agokmvc: use fixed sized arrays in the context
Luca Barbato [Mon, 1 Jul 2013 01:04:15 +0000 (03:04 +0200)]
kmvc: use fixed sized arrays in the context

Avoid some boilerplate code to dynamically allocate and then free the
buffers.

11 years agobitstream_filter: K&R formatting cosmetics
Luca Barbato [Fri, 5 Jul 2013 13:35:30 +0000 (15:35 +0200)]
bitstream_filter: K&R formatting cosmetics

11 years agocompat: wrap math.h to avoid AIX-specific clashes
Luca Barbato [Thu, 4 Jul 2013 19:53:08 +0000 (21:53 +0200)]
compat: wrap math.h to avoid AIX-specific clashes

AIX defines a class() function in its math.h header without any
guard.

11 years agolog: pass the correct parameters to missing_feature_sample
Luca Barbato [Thu, 27 Jun 2013 01:17:32 +0000 (03:17 +0200)]
log: pass the correct parameters to missing_feature_sample

CC:libav-stable@libav.org

11 years agoindeo: reject negative array indexes
Luca Barbato [Wed, 3 Jul 2013 12:55:50 +0000 (14:55 +0200)]
indeo: reject negative array indexes

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agoindeo: Cosmetic formatting
Luca Barbato [Wed, 3 Jul 2013 12:01:32 +0000 (14:01 +0200)]
indeo: Cosmetic formatting

Trim some overly long lines.

11 years agoindeo: Refactor ff_ivi_init_tiles and ivi_decode_blocks
Luca Barbato [Wed, 3 Jul 2013 11:59:16 +0000 (13:59 +0200)]
indeo: Refactor ff_ivi_init_tiles and ivi_decode_blocks

Spin large and mostly self contained blocks into stand alone
functions.

11 years agoindeo: Refactor ff_ivi_dec_huff_desc
Luca Barbato [Wed, 3 Jul 2013 10:58:40 +0000 (12:58 +0200)]
indeo: Refactor ff_ivi_dec_huff_desc

Spare an indentation level.

11 years agoindeo: use a typedef for the mc function pointer
Luca Barbato [Wed, 3 Jul 2013 09:18:30 +0000 (11:18 +0200)]
indeo: use a typedef for the mc function pointer

11 years agocabac: x86 version of get_cabac_bypass
Jason Garrett-Glaser [Mon, 1 Jul 2013 19:06:22 +0000 (12:06 -0700)]
cabac: x86 version of get_cabac_bypass

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agoaic: use chroma scan tables while decoding luma component in progressive mode
Kostya Shishkov [Wed, 3 Jul 2013 18:46:28 +0000 (20:46 +0200)]
aic: use chroma scan tables while decoding luma component in progressive mode

For some unclear reason Apple decided to use the same scan tables for luma and
chroma in the progressive mode while using different ones for luma in the
interlaced mode.

11 years agojpeg2000: Use the matching coding style struct for transform selection
Michael Niedermayer [Mon, 1 Jul 2013 08:01:39 +0000 (10:01 +0200)]
jpeg2000: Use the matching coding style struct for transform selection

Fixes a null pointer dereference.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Merge rescaling with interleaving in 9/7 IDWT
Michael Niedermayer [Mon, 1 Jul 2013 08:01:38 +0000 (10:01 +0200)]
jpeg2000: Merge rescaling with interleaving in 9/7 IDWT

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Optimize output sample conversion
Michael Niedermayer [Mon, 1 Jul 2013 08:01:37 +0000 (10:01 +0200)]
jpeg2000: Optimize output sample conversion

67935 -> 29984 kcycles

Reviewed-by: Nicolas BERTRAND <nicoinattendu@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Reset s->numX/Ytiles on tile deallocation
Michael Niedermayer [Mon, 1 Jul 2013 08:01:36 +0000 (10:01 +0200)]
jpeg2000: Reset s->numX/Ytiles on tile deallocation

Keep the structure fields more consistent after cleanup.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Optimize dequantization
Michael Niedermayer [Mon, 1 Jul 2013 08:01:35 +0000 (10:01 +0200)]
jpeg2000: Optimize dequantization

Float:   4700 -> 2700 cycles
Integer: 4400 -> 2800 cycles

(sandybridge  i7)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Do not assume a single tile
Michael Niedermayer [Mon, 1 Jul 2013 08:01:34 +0000 (10:01 +0200)]
jpeg2000: Do not assume a single tile

In preparation of supporting multiple tiles.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Speed up jpeg2000_decode_tile()
Michael Niedermayer [Mon, 1 Jul 2013 08:01:33 +0000 (10:01 +0200)]
jpeg2000: Speed up jpeg2000_decode_tile()

Skip processing bands with dimension set to 0.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Use EBCOT's CAUSAL and BYPASS mode in decode_cblk()
Michael Niedermayer [Mon, 1 Jul 2013 08:01:32 +0000 (10:01 +0200)]
jpeg2000: Use EBCOT's CAUSAL and BYPASS mode in decode_cblk()

Speed it up a bit.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Simplify jpeg2000_decode_packets()
Michael Niedermayer [Mon, 1 Jul 2013 08:01:31 +0000 (10:01 +0200)]
jpeg2000: Simplify jpeg2000_decode_packets()

Raise PATCHWELCOME error in case of non-implemented progression order.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Nicolas Bertrand <nicoinattendu@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Do not crash on NULL node in tag_tree_decode
Michael Niedermayer [Mon, 1 Jul 2013 08:01:30 +0000 (10:01 +0200)]
jpeg2000: Do not crash on NULL node in tag_tree_decode

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Refactor SOT marker parsing
Michael Niedermayer [Mon, 1 Jul 2013 08:01:29 +0000 (10:01 +0200)]
jpeg2000: Refactor SOT marker parsing

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Proper cleanup on failure in decode_frame()
Luca Barbato [Mon, 1 Jul 2013 08:01:28 +0000 (10:01 +0200)]
jpeg2000: Proper cleanup on failure in decode_frame()

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Use the correct sizeof in memset for T1 data
Michael Niedermayer [Mon, 1 Jul 2013 08:01:27 +0000 (10:01 +0200)]
jpeg2000: Use the correct sizeof in memset for T1 data

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Simplify init_tile()
Michael Niedermayer [Mon, 1 Jul 2013 08:01:26 +0000 (10:01 +0200)]
jpeg2000: Simplify init_tile()

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Update pixel format support
Michael Niedermayer [Mon, 1 Jul 2013 08:01:25 +0000 (10:01 +0200)]
jpeg2000: Update pixel format support

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Compute corrections of sub-band coordinates
Michael Niedermayer [Mon, 1 Jul 2013 08:01:24 +0000 (10:01 +0200)]
jpeg2000: Compute corrections of sub-band coordinates

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Remove unneeded variable initialization
Michael Niedermayer [Mon, 1 Jul 2013 08:01:23 +0000 (10:01 +0200)]
jpeg2000: Remove unneeded variable initialization

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Use separate fields for int and float codepaths
Michael Niedermayer [Mon, 1 Jul 2013 08:01:22 +0000 (10:01 +0200)]
jpeg2000: Use separate fields for int and float codepaths

Split stepsize and data into int and float variants.
Eliminates a number of casts and simplifies spotting errors.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Split int/float codepaths depending on the DWT
Michael Niedermayer [Mon, 1 Jul 2013 08:01:21 +0000 (10:01 +0200)]
jpeg2000: Split int/float codepaths depending on the DWT

DWT53 is always int, DWT97 is always float.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Improve reduced resolution decoding
Michael Niedermayer [Mon, 1 Jul 2013 08:01:20 +0000 (10:01 +0200)]
jpeg2000: Improve reduced resolution decoding

Correctly scale down the component coordinates and
clean up some redundant code.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Compute quantization for 'scalar derived' in the correct case.
Michael Niedermayer [Mon, 1 Jul 2013 08:01:19 +0000 (10:01 +0200)]
jpeg2000: Compute quantization for 'scalar derived' in the correct case.

Scalar derived case is represented by the JPEG2K_QSTY_SI define.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Calculate code-block coord in ff_jpeg2000_init_component()
Michael Niedermayer [Mon, 1 Jul 2013 08:01:18 +0000 (10:01 +0200)]
jpeg2000: Calculate code-block coord in ff_jpeg2000_init_component()

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Nicolas Bertrand <nicoinattendu@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Fix compute precedence error in lut_gain index
Michael Niedermayer [Mon, 1 Jul 2013 08:01:17 +0000 (10:01 +0200)]
jpeg2000: Fix compute precedence error in lut_gain index

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Initialize code blocks structures in precincts to 0
Michael Niedermayer [Mon, 1 Jul 2013 08:01:16 +0000 (10:01 +0200)]
jpeg2000: Initialize code blocks structures in precincts to 0

Prevent use of uninitialized memory / valgrind failure.

Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Check that we have enough components for MCT
Michael Niedermayer [Mon, 1 Jul 2013 08:01:15 +0000 (10:01 +0200)]
jpeg2000: Check that we have enough components for MCT

Avoid overread.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Check that there is a SOT before SOD
Michael Niedermayer [Mon, 1 Jul 2013 08:01:14 +0000 (10:01 +0200)]
jpeg2000: Check that there is a SOT before SOD

Avoid overreads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Remove unneeded returns
Michael Niedermayer [Mon, 1 Jul 2013 08:01:13 +0000 (10:01 +0200)]
jpeg2000: Remove unneeded returns

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Propagate error code from get_cox()
Michael Niedermayer [Mon, 1 Jul 2013 08:01:12 +0000 (10:01 +0200)]
jpeg2000: Propagate error code from get_cox()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Check that nreslevels2decode has been initialized before use
Michael Niedermayer [Mon, 1 Jul 2013 08:01:11 +0000 (10:01 +0200)]
jpeg2000: Check that nreslevels2decode has been initialized before use

Avoid buffer overread.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Drop unused and writeonly fields
Michael Niedermayer [Mon, 1 Jul 2013 08:01:10 +0000 (10:01 +0200)]
jpeg2000: Drop unused and writeonly fields

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Correctly calculate sgnd
Michael Niedermayer [Mon, 1 Jul 2013 08:01:09 +0000 (10:01 +0200)]
jpeg2000: Correctly calculate sgnd

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: check len before parsing header
Michael Niedermayer [Mon, 1 Jul 2013 08:01:08 +0000 (10:01 +0200)]
jpeg2000: check len before parsing header

Avoid overread.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Check component number in get_coc() and get_qcc()
Michael Niedermayer [Mon, 1 Jul 2013 08:01:07 +0000 (10:01 +0200)]
jpeg2000: Check component number in get_coc() and get_qcc()

Avoid overreads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Nicolas Bertrand <nicoinattendu@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Check zero bit-plane validity
Michael Niedermayer [Mon, 1 Jul 2013 08:01:06 +0000 (10:01 +0200)]
jpeg2000: Check zero bit-plane validity

Prevent integer overflows.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Validate block lengthinc
Luca Barbato [Mon, 1 Jul 2013 08:01:05 +0000 (10:01 +0200)]
jpeg2000: Validate block lengthinc

Currently we are using an array with a static data size.

Similar to a patch with the same purpose by Michael Niedermayer.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Validate SIZ parsing
Michael Niedermayer [Mon, 1 Jul 2013 08:01:04 +0000 (10:01 +0200)]
jpeg2000: Validate SIZ parsing

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Validate SOT parsing
Michael Niedermayer [Mon, 1 Jul 2013 08:01:03 +0000 (10:01 +0200)]
jpeg2000: Validate SOT parsing

Avoid some overreads.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Use bytestream2
Michael Niedermayer [Mon, 1 Jul 2013 08:01:02 +0000 (10:01 +0200)]
jpeg2000: Use bytestream2

Prevent a number of overreads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Clean up return paths and error messages
Luca Barbato [Mon, 1 Jul 2013 08:01:01 +0000 (10:01 +0200)]
jpeg2000: Clean up return paths and error messages

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Define the maximum decomposition levels
Luca Barbato [Mon, 1 Jul 2013 08:01:00 +0000 (10:01 +0200)]
jpeg2000: Define the maximum decomposition levels

And define the resolution levels according.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Check code-block size
Michael Niedermayer [Mon, 1 Jul 2013 08:00:59 +0000 (10:00 +0200)]
jpeg2000: Check code-block size

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Nicolas Bertrand <nicoinattendu@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agojpeg2000: Validate resolution levels
Luca Barbato [Mon, 1 Jul 2013 08:00:58 +0000 (10:00 +0200)]
jpeg2000: Validate resolution levels

There are 32 maximum decomposition levels, thus 33 resolution levels.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agooggdec: do not fall back on binary search in the generic code.
Anton Khirnov [Fri, 28 Jun 2013 16:38:37 +0000 (18:38 +0200)]
oggdec: do not fall back on binary search in the generic code.

Binary search is already attempted in the format-specific seek function,
so the fallback is only reached if binary search failed already.

11 years agolls/x86: use 3-operator vaddpd in ADDPD_MEM
Loren Merritt [Tue, 2 Jul 2013 05:56:56 +0000 (07:56 +0200)]
lls/x86: use 3-operator vaddpd in ADDPD_MEM

Fixes build with yasm-1.1

Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years agoRevert "indeo5: reject negative motion vectors"
Luca Barbato [Mon, 1 Jul 2013 04:49:46 +0000 (06:49 +0200)]
Revert "indeo5: reject negative motion vectors"

Negative motion vectors are possible.

This reverts commit 1194a410807bac3eafbeb632578b937656d273e7.

11 years agoindeo: check for reference when inheriting mvs
Luca Barbato [Sun, 30 Jun 2013 08:40:37 +0000 (10:40 +0200)]
indeo: check for reference when inheriting mvs

The same is done already for qdelta.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agoindeo5: reject negative motion vectors
Luca Barbato [Sun, 30 Jun 2013 08:35:07 +0000 (10:35 +0200)]
indeo5: reject negative motion vectors

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agoindeo: use proper error code
Luca Barbato [Sun, 30 Jun 2013 08:11:05 +0000 (10:11 +0200)]
indeo: use proper error code

11 years agoindeo: Properly forward the error codes
Luca Barbato [Sun, 30 Jun 2013 07:57:56 +0000 (09:57 +0200)]
indeo: Properly forward the error codes

If the tile data size does not match the buffer size it did not
return an AVERROR_INVALIDDATA causing futher corruption later.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agox86: lpc: fix a segfault in av_evaluate_lls_sse2()
Loren Merritt [Sun, 30 Jun 2013 22:56:58 +0000 (22:56 +0000)]
x86: lpc: fix a segfault in av_evaluate_lls_sse2()

11 years agomjpeg: Check the unescaped size for overflows
Luca Barbato [Sat, 29 Jun 2013 04:07:57 +0000 (06:07 +0200)]
mjpeg: Check the unescaped size for overflows

And contextually check init_get_bits success and fix the reporting
message.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agomjpeg: Move code out of else branch
Luca Barbato [Sat, 29 Jun 2013 04:13:53 +0000 (06:13 +0200)]
mjpeg: Move code out of else branch

Simplify the control flow and spare some vertical space.

11 years agoavconv: Don't include colorspace.h
Derek Buitenhuis [Sat, 29 Jun 2013 18:20:20 +0000 (14:20 -0400)]
avconv: Don't include colorspace.h

The header is private, and avconv.c doesn't use it
for anything.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
11 years agowmapro: error out on impossible scale factor offsets
Luca Barbato [Sat, 29 Jun 2013 00:16:50 +0000 (02:16 +0200)]
wmapro: error out on impossible scale factor offsets

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agowmapro: check the min_samples_per_subframe
Luca Barbato [Fri, 28 Jun 2013 23:56:09 +0000 (01:56 +0200)]
wmapro: check the min_samples_per_subframe

Must be at least WMAPRO_BLOCK_MIN_SIZE.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years agopictor: use the correct logging context
Luca Barbato [Sat, 29 Jun 2013 03:41:58 +0000 (05:41 +0200)]
pictor: use the correct logging context

Broken in 6d97484d72e33f7dde9493a9ead1a72e2f029605

11 years agolpc: use levinson for the first pass of multipass cholesky
Loren Merritt [Sun, 16 Jun 2013 00:53:47 +0000 (00:53 +0000)]
lpc: use levinson for the first pass of multipass cholesky

Levinson is faster, and cholesky is only needed if we want to apply different
weights to different samples, which doesn't happen on the first pass.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agox86: lpc: simd av_evaluate_lls
Loren Merritt [Tue, 18 Jun 2013 21:30:43 +0000 (21:30 +0000)]
x86: lpc: simd av_evaluate_lls

1.5x-1.8x faster on sandybridge

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agox86: lpc: simd av_update_lls
Loren Merritt [Tue, 18 Jun 2013 21:30:42 +0000 (21:30 +0000)]
x86: lpc: simd av_update_lls

4x-6x faster on sandybridge

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agolpc: use function pointers, in preparation for asm
Loren Merritt [Tue, 18 Jun 2013 21:30:41 +0000 (21:30 +0000)]
lpc: use function pointers, in preparation for asm

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agolpc: remove "decay" argument
Loren Merritt [Tue, 18 Jun 2013 21:30:40 +0000 (21:30 +0000)]
lpc: remove "decay" argument

We never used the rolling-average mode, and this makes av_update_lls 15% faster.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years agowmapro: check num_vec_coeffs against the actual available buffer
Luca Barbato [Fri, 28 Jun 2013 03:23:21 +0000 (05:23 +0200)]
wmapro: check num_vec_coeffs against the actual available buffer

Prevent yet another buffer overwrite.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org