Michael Niedermayer
1486ed0815
avcodec/shorten: clear bitstream buffer
...
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f3ca95606fb_6393_luckynight-partial.shn
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Alexandra Khirnova
9b8d11a76a
avcodec: Use av_reallocp where suitable
...
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Tim Walker
5f5ada3dbf
shorten: Fix out-of-array read
...
pred_order == FF_ARRAY_ELEMS(fixed_coeffs) is invalid too.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years ago
Luca Barbato
b2148faca9
shorten: Extend fixed_coeffs to properly support pred_order 0
...
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Martin Storsjö
b26742cc30
shorten: Break out of loop looking for fmt chunk if none is found
...
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Martin Storsjö
49568851bf
shorten: Use a checked bytestream reader for the wave header
...
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Michael Niedermayer
ad22767cb6
shorten: fix "off by padding" bug
...
Fixes array overread
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
89d998f1c1
shorten: allocate space for padding
...
Fixes array overread
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Clément Bœsch
1ec94b0f06
lavc: factorize ff_{thread_,re,}get_buffer error messages.
...
Coccinelle profile used:
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_get_buffer(ctx, f, flags)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str;
@@
-if ((r = ff_reget_buffer(ctx, f)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_reget_buffer(ctx, f)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0)
+ return r;
...along with some manual patches for the remaining ones.
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
12 years ago
Luca Barbato
4c364eb2b8
shorten: report meaningful errors
12 years ago
Luca Barbato
a2ad554def
shorten: K&R formatting cosmetics
12 years ago
Luca Barbato
5cf7c72757
shorten: use the unsigned type where needed
...
get_uint returns an unsigned value, use an unsigned to store
blocksize to make sure the comparison logic is correct and report
correctly the error for the channel count not supported.
12 years ago
Michael Niedermayer
c10da30d84
shorten: set invalid channels count to 0
...
Prevent the loop shorten_decode_close from writing and freeing out of
the array boundary.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Michael Niedermayer
a5153b1d16
shorten: Fix signedness of comparission
...
Fixes out of array accessed
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
4f1279154e
shorten: dont leave invalid channel counts in the context.
...
Fixes freeing invalid addresses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Justin Ruggles
fed74c0ae4
shorten: decode directly to the user-provided AVFrame
12 years ago
Luca Barbato
4839fbe2d1
shorten: fix array subscript is below array bounds warning
...
Incidentally fixes alpha builds.
12 years ago
Diego Biurrun
511cf612ac
miscellaneous typo fixes
12 years ago
Anton Khirnov
594d4d5df3
lavc: add a wrapper for AVCodecContext.get_buffer().
...
It will be useful in the upcoming transition to refcounted AVFrames.
12 years ago
Paul B Mahol
694dc6251e
shorten: update .sample_fmts
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
6b11ae7112
shorten: return more meaningful error codes
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Justin Ruggles
4c53f4aed3
shorten: validate that the channel count in the header is not <= 0
12 years ago
Michael Niedermayer
5bac83dae8
shorten: fix U8 to be planar too
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Justin Ruggles
977eb7d567
shorten: use planar sample format
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago
Michael Niedermayer
e6b9903d82
shorten: fix cmd type
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Lou Logan
6851130fd6
cosmetics: minor libavcodec spelling errors
...
Also update some common misspelled words in patcheck
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Paul B Mahol
672f8226bb
shorten: fix lossy decoding
...
Closes #1299 , #1300 and #1301 .
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Michael Niedermayer
b4b5848513
shorten: increase max_frame_size.
...
Fixes Ticket1250
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Paul B Mahol
b7159877b1
shorten: unsigned 8bit support
13 years ago
Carl Eugen Hoyos
ae0591f913
Add missing newline in shorten decoder.
13 years ago
Martin Storsjö
00c3b67b8a
cosmetics: Align codec declarations
...
Also break some long lines, remove codec function placeholder comments
and add spaces in sample/pixel format lists.
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Michael Niedermayer
204cb29b3c
shorten: Use separate pointers for the allocated memory for decoded samples.
...
Fixes invalid free() if any of the buffers are not allocated due to either
not decoding a header or an error prior to allocating all buffers.
Fixes CVE-2012-0858
CC: libav-stable@libav.org
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
13 years ago
Michael Niedermayer
5e9a56a035
shorten: validate values in fmt chunk search
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
18bcfc912e
shorten: Fix invalid free()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
John Brooks
8562d9bd6c
shorten: avoid abort() on unknown audio types
...
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
13 years ago
Paul B. Mahol
eda8731285
shorten: remove dead initialization
...
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
13 years ago
Justin Ruggles
0eea212943
Add avcodec_decode_audio4().
...
Deprecate avcodec_decode_audio3().
Implement audio support in avcodec_default_get_buffer().
Implement the new audio decoder API in all audio decoders.
13 years ago
Justin Ruggles
5c210e2cb9
shorten: do not modify samples pointer when interleaving
13 years ago
Justin Ruggles
1baa25c7da
shorten: fix end-of-stream decoding.
...
enable CODEC_CAP_DELAY to flush any remaining frames in the buffer.
Stop decoding when the FN_QUIT command is found so that a trailing seek table
isn't decoded as a normal frame.
decode all channels in the same call to avcodec_decode_audio3() so that
decoding will not stop after the first channel of the last frame.
Updated FATE reference. More valid audio is now decoded.
13 years ago
Justin Ruggles
d03f9f65c0
shorten: do not use block size to determine whether to read the header.
13 years ago
Justin Ruggles
882dafe9b6
shorten: check output buffer size before decoding
13 years ago
Justin Ruggles
bd7f7d6c78
shorten: use av_clip_int16() for output sample clipping
13 years ago
Justin Ruggles
069ada46c1
shorten: use bytestream functions to decode the embedded WAVE header
13 years ago
Justin Ruggles
c25762fcf1
shorten: add some comments
13 years ago
Justin Ruggles
15d146c958
shorten: merge decoding of FN_DIFF* subblocks into decode_subframe_lpc()
13 years ago
Justin Ruggles
034f42dfce
cosmetics: remove some needless commented-out stuff
13 years ago
Justin Ruggles
cfa317f67d
shorten: validate block size
13 years ago