Vittorio Giovara
5a0e953c24
mjpeg: Mark decoder family as thread safe
...
No global variables are used and the VLC tables are allocated without
static elements. This will allow using a JPEG decoding context within
other decoders.
10 years ago
Anton Khirnov
809c3023b6
mjpegdec: check for pixel format changes
...
Fixes possible invalid memory access.
Based on code by Michael Niedermayer <michaelni@gmx.at>
CC: libav-stable@libav.org
Bug-ID: CVE-2014-8541
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
10 years ago
Vittorio Giovara
199d9f995d
mjpegdec: fix undefined shift
...
Add a comment to explain the code.
CC: libav-stable@libav.org
Bug-Id: CID 1194388
10 years ago
Diego Biurrun
e3fcb14347
dsputil: Split off IDCT bits into their own context
11 years ago
Derek Buitenhuis
2deb614272
mjpegdec: Properly set the context colorspace info
...
The JPEG spec requires it to be this.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
11 years ago
Justin Ruggles
9e500efdbe
Add av_image_check_sar() and use it to validate SAR
11 years ago
Diego Biurrun
e74433a8e6
dsputil: Split clear_block*/fill_block* off into a separate context
11 years ago
Vittorio Giovara
1c1fbc70ca
mjpeg: set color_range
11 years ago
Anton Khirnov
d48132b7de
mjpegdec: apply flipping after decoding, not before
...
This is simpler and removes a silly restriction on edges being present.
11 years ago
Anton Khirnov
e2274aa555
mjpegdec: use the AVFrame API properly.
11 years ago
Anton Khirnov
2cd94ad5bf
mjpegdec: stop using deprecated avcodec_set_dimensions
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Michael Niedermayer
af11fa5409
mjpegb: Detect changing number of planes in interlaced video
...
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Diego Biurrun
2a61592573
avcodec: Remove some commented-out debug cruft
11 years ago
Luca Barbato
6765ee7b9c
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
12 years ago
Luca Barbato
7520d9779c
mjpeg: Move code out of else branch
...
Simplify the control flow and spare some vertical space.
12 years ago
Luca Barbato
cfbd98abe8
mjpegdec: validate parameters in mjpeg_decode_scan_progressive_ac
...
Prevent out of buffer write when decoding broken samples.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
12 years ago
Luca Barbato
a030279a67
ljpeg: use the correct number of components in yuv
...
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
12 years ago
Luca Barbato
8aa3500905
mjpeg: Validate sampling factors
...
They must be non-zero.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
12 years ago
Luca Barbato
b25e49b187
mjpegdec: properly report unsupported disabled features
...
When JPEG-LS support is disabled the decoder would feed the
data to the JPEG Lossless decode_*_scan function resulting in
faulty decoding.
CC: libav-stable@libav.org
12 years ago
Ronald S. Bultje
28bc406c84
mjpeg: Use hpeldsp instead of dsputil for half-pel functions
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Diego Biurrun
63d744e2be
av_log_missing_feature() ---> avpriv_report_missing_feature()
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
12 years ago
Diego Biurrun
c242bbd8b6
Remove unnecessary dsputil.h #includes
12 years ago
Mans Rullgard
ed62e6e3c3
mjpegdec: use put_pixels instead of copy_block8
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Anton Khirnov
7bcaeb408e
mjpegdec: fix indentation
12 years ago
Diego Biurrun
88bd7fdc82
Drop DCTELEM typedef
...
It does not help as an abstraction and adds dsputil dependencies.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
12 years ago
Janne Grunau
6a1aa5cb26
mjpeg: initialize input padding after unescaped buffer to zero
...
Fixes valgrind --undef-value-errors=yes warnings caused by valid
overreads in the fate vsynth jpegls, cover-art-ape and cover-art-wv
tests.
12 years ago
Anton Khirnov
df9b956751
lavc: fix decode_frame() third parameter semantics for video decoders
...
It's got_frame, not data size
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
Diego Biurrun
f75f4194d1
Restructure av_log_missing_feature message
...
Some invocations include a verb in the log message, others do not. Yet
av_log_missing_feature expects callers to provide a verb. Change the
function to include a verb instead and update the callers accordingly.
The result is a more natural function API and correct English in the
function invocations.
12 years ago
Anton Khirnov
716d413c13
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
12 years ago
Diego Biurrun
1218777ffd
avcodec: Convert some commented-out printf/av_log instances to av_dlog
12 years ago
Diego Biurrun
9c6cf7f2c9
avcodec: Drop silly and/or broken printf debug output
12 years ago
Samuel Pitoiset
a0845bae49
mjpeg: Rename some symbols to avpriv_* instead of ff_*
...
These symbols will be used from the RTP/JPEG depacketizer.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Martin Storsjö
e6153f173a
avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Michael Niedermayer
ac33016158
mjpegdec: support AVRn interlaced
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Luca Barbato
0f64cd1e81
mjpegdec: more meaningful return values
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago
Ronald S. Bultje
5eec5a79da
jpeg: handle progressive in second field of interlaced.
...
Progressive data is allocated later in decode_sof(), not allocating
that data leads to NULL dereferences.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
13 years ago
Mans Rullgard
2bcbd98459
Remove lowres video decoding
...
This feature is complex, of questionable utility, and slows down
normal decoding.
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Diego Biurrun
a92be9b856
Replace memset(0) by zero initializations.
...
Also remove one pointless zero initialization in rangecoder.c.
13 years ago
Alex Converse
3574a85ce5
Replace computations of remaining bits with calls to get_bits_left().
13 years ago
Diego Biurrun
1c4717be4f
mjpegdec: use correct variable in av_log invocation
...
libavcodec/mjpegdec.c:1463: warning: format ‘%x’ expects type ‘unsigned int’, but argument 5 has type ‘const uint8_t *’
13 years ago
Ronald S. Bultje
ab492ca2ab
mjpeg: abort decoding if packet is too large.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
13 years ago
Martin Storsjö
9cf0841ef3
dsputil: Add ff_ prefix to the dsputil*_init* functions
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Martin Storsjö
e96b4a53df
vlc/rl: Add ff_ prefix to the nonstatic symbols
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Reimar Döffinger
0880503fbb
mjpegdec: use av_fast_padded_malloc()
...
also check for allocation failure
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
13 years ago
Anton Khirnov
99ace37e68
lavc: remove disabled FF_API_MJPEG_GLOBAL_OPTS cruft.
13 years ago
Daniel Huang
8549cf073b
mjpegdec: K&R formatting cosmetics
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
13 years ago