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
Michael Niedermayer
970a8f1c25
avcodec/mjpegdec: Fix integer overflow in shift
...
Fixes: signal_sigabrt_7ffff6ac7bb9_2683_cov_4120310995_m_ijpg.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
0eecf40935
avcodec/mjpegdec: Fix context fields becoming inconsistent
...
Fixes out of array access
Fixes: asan_heap-oob_1ca4f85_2760_cov_144449187_miss_congeniality_pegasus_ljpg.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
172d22a071
avcodec/mjpegdec: Add YUVA420 formats to *scale asserts
...
Fixes assertion failure
Fixes: signal_sigabrt_7ffff6ac7bb9_2042_cov_2593130068_ef1f8a057bb6056674fad92f6b8c0acd.jpg
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
03a17f2bbf
avcodec/mjpegdec: Print the number of bits in the unsupported pixel format error
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
0bf416f262
avcodec/mjpegdec: Check for pixfmtid 0x42111100 || 0x24111100 with more than 8 bits
...
These cases are not supported yet
Fixes assertion failure
Fixes: signal_sigabrt_7ffff6ac7bb9_1_cov_1553101927_00.jpg
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
2f6550bb9a
avcodec/mjpegdec: fix pixfmtid 0x14111100
...
Fixes part of Ticket 2004
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
4243415741
avcodec/mjpegdec: Support some subsampled GBR variants
...
Fixes Ticket4045
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
960c573cc5
avcodec/mjpegdec: support pix fmt id 0x22111111
...
Fixes: 4163724_300.jpg
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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
Michael Niedermayer
c5ffd7aee5
avcodec/mjpegdec: use FF_CEIL_RSHIFT() for width
...
No testcase known
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
d5a3a20d1e
avcodec/mjpegdec: simplify chroma_height calculation
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
059c842818
avcodec/mjpegdec: Support 24111100 pix fmt id
...
Fixes 129533924_640.jpg
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
0db1f2c2c7
avcodec/mjpegdec: sanity check bits
...
Fixes undefined shift
Fixes: asan_heap-oob_16668e9_2_asan_heap-oob_16668e9_346_miss_congeniality_pegasus_mjpg.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
5c378d6a6d
avcodec/mjpegdec: check bits per pixel for changes similar to dimensions
...
Fixes out of array accesses
Fixes: asan_heap-oob_16668e9_2_asan_heap-oob_16668e9_346_miss_congeniality_pegasus_mjpg.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Clément Bœsch
b96d864fd6
avcodec/mjpegdec: Fix chroma width rounding
...
Fixes vertical line at the right side
Fixes Ticket 3929
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
1654ca7d4e
avcodec/mjpegdec: fix rounding of chroma_height
...
Fixes green line at the bottom
Fixes Ticket3913
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
f0d4f00f24
avcodec/mjpegdec: fix green line at the bottom with upscale v
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
63a52ca134
avcodec/mjpegdec: fix green vertical line at the right with upscale h
...
Fixes Ticket3891
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
5c7899a483
avcodec/mjpegdec: Support AV_PIX_FMT_YUV420P16 with upscale_h
...
Fixes assertion failure
Fixes: test42f.jpg
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Przemysław Sobala
c68098ba4a
avcodec/mjpegdec: add pix_fmt: 0x14121200
...
Fixes: _15801_F.jpg
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
ef7e8425e8
avcodec/mjpegdec: factorize some parts of the pix_fmt_id switch()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
784e1cf76b
avcodec/mjpegdec: handle luma upscale detection generically
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
64d98dadc7
avcodec/mjpegdec: set upscale_h/upscale_v using generic code instead of hardcoding a list
...
Some code is left to handle corner cases
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
7558e55345
avcodec/mjpegdec: Support pix_fmt_id==0x11222200
...
Fixes: 4858286_300.jpg
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
cd417d947e
avcodec/mjpegdec: fix width for non chroma in rescaling
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
4e09300ffa
mjpegdec: Support pix_fmt_id == 0x22112200
...
Fixes 4780490_300.jpg
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 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
Derek Buitenhuis
c11043aca7
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
Michael Niedermayer
0545ef7116
avcodec/mjpegdec: Improve intel jpeg flip heuristic
...
Fixes Ticket3698
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
149be91374
avcodec/mjpegdec: request a AMV sample with non mod 16 height
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
ec33f59fed
avcodec/mjpegdec: Support pix_fmt_id== 0x42111100
...
Fixes: 538782_300.jpg
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
aff352be63
avcodec/mjpegdec: zero gb to silence warning about it being possibly uninitialized
...
The code is not speed relevant, also its more robust if the pointers are NULL instead of random.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
8532566e80
avcodec/mjpegdec: use av_mallocz_array()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
e31727bd53
avcodec/mjpegdec: make type of shift unsigned to avoid undefined behavior
...
Found-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
b432960528
avcodec/mjpegdec: Fix undefined shift
...
Fixes CID1194388
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Carl Eugen Hoyos
ced0d6c14d
Use correct msvc type specifiers for ptrdiff_t and size_t.
...
The Windows runtime aborts if it finds %t or %z.
Fixes ticket #3472 .
Reviewed-by: Ronald Bultje
11 years ago
Justin Ruggles
591c0c26b5
mjpeg: cosmetics: indentation
...
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
11 years ago
Justin Ruggles
39ef000e19
mjpeg: Do not fail jpeg decoding on bad EXIF data.
...
It is not required to correctly decode the image.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
11 years ago
Thilo Borgmann
8c161d7884
lavc/exif: Make EXIF IFD decoding part of private API/ABI.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
254f653b24
avcodec/jpeglsdec: add PAL8 support
...
Fixes Ticket3478
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
d56c373391
avcodec/mjpegdec: fix cmyk 420 with adobe_transform == 2
...
Fixes Ticket3516
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
559c8b9ee9
avcodec/mjpegdec: support subsampled 420 CMYK
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
798490812a
avcodec/mjpegdec: upgrade upscale_v to support multiple planes
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
f9059ce794
avcodec/mjpegdec: upgrade upscale_h to support multiple planes
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
dde16f5aae
avcodec/mjpegdec: Switch default interlaced polarity for MJPG to 1
...
Fixes Ticket3229
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
493296800c
avcodec/mjpegdec: parse avid data from extradata
...
Makes no difference for any file tested but is needed
for following bug-fix
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago