oggenc: fix condition when not to flush due to keyframe granule.

The previous condition of 0 page size was wrong,
that would disable the mechanism for all frames at
a start of a page, thus some keyframes still would not
get their own granule.
The real problem is that header packets must not be flushed,
but they have (and must have) 0 granule and thus would
be detected as keyframes.
Add a separate parameter to mark header packets.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
dcttest: put ff_prores_idct_put_10_sse2_wrap under HAVE_YASM

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avfilter: allow freeing NULL.

this way avfilter_free() can be called without NULL checks.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
vsrc_buffer: Store allocated scale filter and free it later.

Fixes a memleak.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
MOV: bail out to toplevel when encountering a trak or mdat chunk.

This patch fixes the sample from trac issue #733.
The issue is that the size of the trak elements is coded
too large, so that the next trak element would be parsed
as part of the first and truncated incorrectly.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
MOV: Fix old-style muxed raw-audio data.

This patch fixes the sample from trac issue #522.
The issue is that the mov demuxer insists on using its
calculated sample_size (which is nonsense for old-style tracks)
instead of the one encoded in the track.
The old raw audio code should be using the value in stsz, because
the size of a single sample never makes sense for the size of
a full audio packet, whereas the new code will multiply the
sample size by the chunk size, so it should use the calculated value.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
movenc: add some default cases.

This fixes crashes when copying a data track as in trac
issue #236.
No proper timecode tracks will be written though.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
lxfdec: support version 1 files, too.

Fixes trac issue #656.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
lavfi/fade: fix black level for non studio-level pixel formats

Fix trac ticket #1139, regression introduced in 8c1fb50d077d5f954.
fate: update regression checksum due to 95ce0ddcfe99182365e0e57f5f41d7f1a01c57eb

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
indeo5: change AVCodecContext w/h when internal ones change.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ividsp: zero pitch so as not to overread

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ividsp: prevent pointers from going outside and overreading.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
cavs: Remove unused code.

The square is always passed as 1 whenever the function is called and
thus the if block never gets executed.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
tm2dec: fix overread

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
apedec: check bits <= 32.

Fixes a floating-point exception further down.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
indeo4: check that num_mbs matches

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
FATE: Add RALF decoding test

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
indeo4: fix null ptr dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Merge remote-tracking branch 'qatar/master'

* qatar/master:
  apedec: check bits <= 32.
  cavs: Remove unused code.
  oggenc: fix condition when not to flush due to keyframe granule.
  oggenc: add pagesize option to set preferred page size
  libspeexdec: set frame size in libspeex_decode_init()
  smacker audio: sign-extend the initial 16-bit predicted value

Conflicts:
	libavcodec/apedec.c
	libavcodec/libspeexdec.c
	libavformat/oggenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>