Commit Graph

38710 Commits

Author SHA1 Message Date
Justin Ruggles
8ed7488ea3 wmaenc: return s->block_align instead of recalculating it 2012-03-03 18:20:10 -05:00
Justin Ruggles
5d652e063b wmaenc: check final frame size against output packet size
Currently we have an assert() that prevents the frame from being too large,
but it is more user-friendly to give an error message instead of aborting on
assert(). This condition is quite unlikely due to the minimum bit rate check
in encode_init(), but it is still worth having.
2012-03-03 18:20:10 -05:00
Justin Ruggles
dfc4fdedf8 wmaenc: require a large enough output buffer to prevent overwrites
The maximum theoretical frame size is around 17000 bytes. Although in
practice it will generally be much smaller, we require a larger buffer
just to be safe.

CC: libav-stable@libav.org
2012-03-03 18:20:10 -05:00
Justin Ruggles
1ec075cfec wmaenc: limit allowed sample rate to 48kHz
ff_wma_init() allows up to 50kHz, but this generates an exponent band
size table that requires 65 bands. The code assumes 25 bands in many
places, and using sample rates higher than 48kHz will lead to buffer
overwrites.

CC:libav-stable@libav.org
2012-03-03 18:20:10 -05:00
Justin Ruggles
c2b8dea182 wmaenc: limit block_align to MAX_CODED_SUPERFRAME_SIZE
This is near the theoretical limit for wma frame size and is the most that
our decoder can handle. Allowing higher bit rates will just end up padding
each frame with empty bytes.

Fixes invalid writes for avconv when using very high bit rates.

CC:libav-stable@libav.org
2012-03-03 18:20:09 -05:00
Michael Niedermayer
8f1bb3d598 wc4: fix out of chroma LUT reads
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-04 00:13:52 +01:00
Michael Niedermayer
cd0cfdc0a7 pcm-mpeg: Check for valid bps.
The code only supports 16 and 24 bps currently, 20bps causes
out of array reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 23:55:16 +01:00
Justin Ruggles
b7beabab4b tiertexseq: set correct block_align for audio 2012-03-03 17:03:27 -05:00
Justin Ruggles
f9cf91d822 tiertexseq: set audio stream start time to 0
Update FATE test to reflect delayed video due to the file having audio-only
frames prior to the first frame with video.
2012-03-03 17:03:27 -05:00
Justin Ruggles
0883109b27 voc/avs: Do not change the sample rate mid-stream.
Also, set the time base based on the sample rate.
lavf-voc seek test updated to reflect slightly different seek points.
2012-03-03 17:03:27 -05:00
Justin Ruggles
4da374f8a9 segafilm: use the sample rate as the time base for audio streams 2012-03-03 17:03:27 -05:00
Justin Ruggles
ea289186f0 ea: fix audio pts
The time base is 1 / sample_rate, not 90000.
Several more codecs encode the sample count in the first 4 bytes of the
chunk, so we set the durations accordingly. Also, we can set start_time and
packet duration instead of keeping track of the sample count in the demuxer.
2012-03-03 17:03:27 -05:00
Justin Ruggles
01be6fa926 psx-str: fix audio pts
Each packet has 18 sectors with 224/channels samples in each sector.
2012-03-03 17:03:27 -05:00
Justin Ruggles
d0ab585074 vqf: set packet duration
Fixes timestamp calculation.
The FATE reference is updated because timestamp calculations are now more
accurate. Previous timestamps were based on average bit rate.
2012-03-03 17:03:26 -05:00
Justin Ruggles
101c369b7c tta demuxer: set packet duration 2012-03-03 17:03:26 -05:00
Justin Ruggles
0b8b7db01b mpegaudio_parser: do not ignore information from the first parsed frame
Update some demuxing and seeking fate tests.
2012-03-03 17:03:26 -05:00
Michael Niedermayer
6776a8f189 mpegaudio_parser: be less picky about the start position
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-03-03 17:03:26 -05:00
Justin Ruggles
5a9b952201 thp: set audio packet durations 2012-03-03 16:58:45 -05:00
Justin Ruggles
5602a464c9 avcodec: add a Vorbis parser to get packet duration
This also allows for removing some of the Vorbis-related hacks.
2012-03-03 16:43:11 -05:00
Justin Ruggles
737ca4482b vorbisdec: read the previous window flag for long windows
When reading sequentially, we are using the actual flag from the previous
frame, but when seeking we do not know what the previous window flag was, so
we need to read it from the bitstream.
2012-03-03 16:43:11 -05:00
Michael Niedermayer
f83687bc78 mpegts: fix stack array overread in read_sl_header()
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 21:03:11 +01:00
Michael Niedermayer
4a310a19de mpegts: prevent get_bits64() from reading nonsense at the end.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 21:02:17 +01:00
Michael Niedermayer
d629f3edaa cook: check that category is smaller than 8
This fixes some out of global array accesses of dither_tab.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 18:35:46 +01:00
Michael Niedermayer
e732d0f608 mpeg-ts: fix handling of size=0 SL headers.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 18:35:46 +01:00
Michael Niedermayer
c6810d98a5 MAINTAINERS: add 0.10 to the releases, seems ive forgotten it.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 18:35:46 +01:00
Nicolas George
b2792a436b lavc: unify similar code merged from both branches. 2012-03-03 15:56:45 +01:00
Nicolas George
07fb7682d1 vsrc_testsrc: free option values. 2012-03-03 13:17:39 +01:00
Nicolas George
eb6b6d7f8a vsrc_life: free option values. 2012-03-03 12:33:54 +01:00
Nicolas George
f8210f892e vf_fade: free type when overwriting it. 2012-03-03 12:33:54 +01:00
Anton Khirnov
7fb6c9225c lavc: free the output packet when encoding failed or produced no output. 2012-03-03 06:31:41 +01:00
Anton Khirnov
e42e9b0e4d lavc: preserve avpkt->destruct in ff_alloc_packet().
Also, don't bother with saving/restoring data, av_init_packet doesn't
touch it.
2012-03-03 06:31:41 +01:00
Anton Khirnov
c179c9e19d lavc: clarify the meaning of AVCodecContext.frame_number. 2012-03-03 06:31:41 +01:00
Michael Niedermayer
c266eb1928 arm: Fix 10l typo
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 04:35:15 +01:00
Petri Hintukainen
23a5bf9db0 bluray protocol
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 04:30:49 +01:00
Michael Niedermayer
70b5583baa kvmc: Fix out of reference frame reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 04:14:37 +01:00
Michael Niedermayer
81d4b3af81 qpeg: fix overreads.
qpeg should probably be changed to use the checked bytestream reader.
But for now this fixes it and is significantly less work.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 03:50:05 +01:00
Michael Niedermayer
4299dfa5de qpeg: Fix out of array writes.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 03:37:52 +01:00
Fabian Greffrath
aaa1173de7 srtdec: fix a format string vulnerability.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 02:35:27 +01:00
Dale Curtis
e42b5362f1 Remove duplicate initializers for VDA_VLD and GBR24P.
Noticed by the Chromium Mac clang build, http://crbug.com/116599

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 00:46:40 +01:00
Alex Converse
1aa708988a mpegts: Pad the packet buffer in handle_packet().
This allows it to be used with get_bits without the thread of overreads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-02 15:44:42 -08:00
Alex Converse
4df369692e mpegts: Do not call read_sl_header() when no bytes remain in the buffer.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-02 15:44:42 -08:00
Michael Niedermayer
268098d8b2 Merge remote-tracking branch 'qatar/master'
* qatar/master: (29 commits)
  amrwb: remove duplicate arguments from extrapolate_isf().
  amrwb: error out early if mode is invalid.
  h264: change underread for 10bit QPEL to overread.
  matroska: check buffer size for RM-style byte reordering.
  vp8: disable mmx functions with sse/sse2 counterparts on x86-64.
  vp8: change int stride to ptrdiff_t stride.
  wma: fix invalid buffer size assumptions causing random overreads.
  Windows Media Audio Lossless decoder
  rv10/20: Fix slice overflow with checked bitstream reader.
  h263dec: Disallow width/height changing with frame threads.
  rv10/20: Fix a buffer overread caused by losing track of the remaining buffer size.
  rmdec: Honor .RMF tag size rather than assuming 18.
  g722: Fix the QMF scaling
  r3d: don't set codec timebase.
  electronicarts: set timebase for tgv video.
  electronicarts: parse the framerate for cmv video.
  ogg: don't set codec timebase
  electronicarts: don't set codec timebase
  avs: don't set codec timebase
  wavpack: Fix an integer overflow
  ...

Conflicts:
	libavcodec/arm/vp8dsp_init_arm.c
	libavcodec/fraps.c
	libavcodec/h264.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/msmpeg4.c
	libavcodec/pnmdec.c
	libavcodec/qpeg.c
	libavcodec/rawenc.c
	libavcodec/ulti.c
	libavcodec/vcr1.c
	libavcodec/version.h
	libavcodec/wmalosslessdec.c
	libavformat/electronicarts.c
	libswscale/ppc/yuv2rgb_altivec.c
	tests/ref/acodec/g722
	tests/ref/fate/ea-cmv

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 00:23:10 +01:00
Michael Niedermayer
689f65126b simple_idct: idct_4col_put: Fix out of array reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-02 22:09:44 +01:00
Michael Niedermayer
422e3a74b9 rawdec: fix input overread.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-02 22:04:00 +01:00
Ronald S. Bultje
9d87374ec0 amrwb: remove duplicate arguments from extrapolate_isf().
Prevents warnings because the dst and src overlap (are the same) in the
memcpy() inside the function.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-02 12:50:00 -08:00
Michael Niedermayer
e7b43e8e84 truemotion1: Check input buffer size against header size.
Fixes overread.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-02 21:36:42 +01:00
Michael Niedermayer
a3f5ee297a mjpeg: Check for interlaced progressive frames
Fixes null pointer dereference.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-02 21:35:58 +01:00
Michael Niedermayer
0af48e29f5 snow: check reference frame indices.
Fixes NULL ptr dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-02 20:53:00 +01:00
Ronald S. Bultje
154b8bb800 amrwb: error out early if mode is invalid.
Prevents using the invalid mode as an index in a static array, which
would generate invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-02 10:34:50 -08:00
Ronald S. Bultje
291c9b6285 h264: change underread for 10bit QPEL to overread.
This prevents us from reading before the start of the buffer, and thus
prevents crashes resulting from this behaviour. Fixes bug 237.
2012-03-02 10:33:05 -08:00