James Almer
51e329918d
avcodec/rawdec: check for side data before checking its size
...
Fixes valgrind warnings about usage of uninitialized values.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
8 years ago
Michael Niedermayer
5f0bc0215a
avcodec/rawdec: Check side data size before use
...
Fixes out of array read
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
237207645b
avcodec/rawdec: Fix bits_per_coded_sample checks
...
Fixes assertion failure
Fixes: 9eb9cf5b8c26dd0fa7107ed0348dcc1f/signal_sigabrt_7ffff6ae7c37_8926_4609a5c3f071d555d2d557625f9687b1.swf
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Carl Eugen Hoyos
ceab04fb5d
lavc/raw: Support QT b64a ARGB64 rawvideo.
...
Decoder based on a patch by v0lt, v0lt rambler ru
Fixes ticket #5657 .
9 years ago
Michael Niedermayer
6aa39080cc
avcodec/rawdec: Fix palette handling with changing palettes
...
Fixes out of array access
Fixes: poc.swf
Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Mats Peterson
cf85a20d92
lavc/rawdec: Align AV_PIX_FMT_RGB24 correctly
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Mats Peterson
100167451a
lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Mats Peterson
b86ba37096
lavc/rawdec: Retrieve nut palette from packets
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Mats Peterson
4e5db87174
avcodec/rawdec: Print stride and packet size at debug level
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Mats Peterson
efcea77996
avcodec/rawdec: Fix nut pal8 test
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Mats Peterson
bbb45773b0
avcodec/rawdec: Initialize default mono palette only for bits_per_coded_sample == 1
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Mats Peterson
9556446623
lavc/rawdec: Use 16-byte line alignment for B1W0 and B0W1 video in nut
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
6ffac5d33d
avcodec/rawdec: Switch to monowhite if there is no palette & bpp=1
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Mats Peterson
191ec55c9f
lavc/rawdec: Use 16-byte line alignment for AV_PIX_FMT_MONOWHITE
...
The line alignment for 1 bpp raw AV_PIX_FMT_MONOWHITE video (currently
used for AVI) was previously 4 bytes, which generated alignment warning
messages, not only for odd-width files. The alignment is now 16 bytes.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
46f67f4a34
avcodec/rawdec: Check height and packet size
...
Avoids potential division by 0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Mats Peterson
82325dbec1
lavc/rawdec: Use 16-byte line alignment for 1, 2, 4 and 8 bpp
...
This patch aligns the lines of 1 bpp depth for QuickTime, and 2, 4 and 8
bpp depths for AVI and QuickTime, on 16-byte boundaries. At the same
time, the packet row stride is properly catered for.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Mats Peterson
fe7639b1c8
avcodec/rawdec: initialize palette for mono
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Mats Peterson
5da1477fa0
lavc/rawdec: Use AV_PIX_FMT_PAL8 for 1-bit raw QuickTime video
...
Match the use of AV_PIX_FMT_PAL8 for 1-bit QuickTime Animation in
lavc/qtrle. To reiterate, 1-bit video is not necessary black & white in
QuickTime, merely bi-level. The two colors can be any color. The palette,
either included in the sample description, or the default Macintosh
palette (black & white for 1-bit video) will be set in lavf/qtpalette.
See the QuickTime File Format Specification for details.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Andreas Cadhalpun
699e68371e
rawdec: only exempt BIT0 with need_copy from buffer sanity check
...
Otherwise the too small buffer is directly used in the frame, causing
segmentation faults, when trying to use the frame.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
9 years ago
Clément Bœsch
fb99ef0bd3
avcodec: use AV_OPT_TYPE_BOOL in a bunch of places
9 years ago
Luca Barbato
ef3a3519c1
rawdec: Replace avpicture functions with imgutils
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Michael Niedermayer
1d3a3b9f89
avcodec/rawdec: Check the return code of avpicture_get_size()
...
Fixes out of array access
Fixes: asan_heap-oob_22388d0_3435_cov_3297128910_small_roll5_FlashCine1.cine
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
1587989518
avcodec/rawdec: Support CODEC_CAP_PARAM_CHANGE
...
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
James Almer
8dfb8190d7
libavcodec/rawdec: remove old ff_find_pix_fmt() function
...
It's been dead code for more than a year
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Carl Eugen Hoyos
8b122937af
Warn if rawvideo and an unreadable pix_fmt are written.
...
Print an error if a combination of rawvideo and an unusual pix_fmt
that will be impossible to decode are written to avi or mov.
Fixes ticket #3545 .
11 years ago
Carl Eugen Hoyos
ecb80fe78c
Cosmetics: Remove an outdated comment from lavc/rawdec.c.
...
The missing swscale feature was implemented in 2011.
11 years ago
Anton Khirnov
4a0f665143
libavcodec: when decoding, copy replaygain side data to decoded frames
11 years ago
Michael Niedermayer
82a90e7764
Move avpriv_find_pix_fmt() to utils.c
...
Fixes build with --disable-everything
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Peter Ross
97bb0076c5
avcodec/rawdec: decode 16-bit aligned and packed 'raw' pixel formats where bits_per_coded_sample < 16
...
The bit packing method is communicted via codec_tag:
BIT[0] big-endian packing
BIT[16] 16-bit little endian packing
BIT[32] 32-bit little-endian packing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Carl Eugen Hoyos
54bbe3e2a6
Revert "Allow stream-copying grayscale mov files."
...
This reverts commit 691dec6201
.
The commit did not fix ticket #3215 , it was fixed one commit earlier.
The revert may break other use-cases but they should be fixed differently,
the offending commit introduced too many problems.
Fixes ticket #3377 .
Fixes ticket #3378 .
11 years ago
Peter Ross
1524b0fa68
libavcodec/rawdec: avoid memcpy when performing 16-bit samples shift
...
Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Peter Ross
7e23cfba76
avcodec/rawdec: for 16-bit pix fmts, shift pixels when bits_per_coded_sample < 16
...
Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Carl Eugen Hoyos
691dec6201
Allow stream-copying grayscale mov files.
...
This reverts 0de2157f
/ r12272.
Fixes ticket #3215 .
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
da6506c607
lavc: move AVCodecContext.pkt to AVCodecInternal
...
It's a private field, not meant to be accessed from outside lavc.
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Carl Eugen Hoyos
565140da17
avcodec/rawdec: Fix 2bpp and 4bpp rawvideo in mov
...
Restores carefully the old behaviour
(and does not break decoding avi samples).
Fixes Ticket2536
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Carl Eugen Hoyos
0915b531bc
Rename "AVClass class" as "AVClass component_class".
...
The aix header math.h defines "extern int class()" for C.
12 years ago
Hendrik Leppkes
8962da9ec3
rawdec: allocate a buffer in the appropriate size in the copy case.
...
Otherwise the created buffer can be smaller than buf_size, which results
in buffer overreads if the original image has extra padding on every line.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
e6c4ac7b5f
pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_*
12 years ago
Michael Niedermayer
8e062fd169
rawdec: fix memleak
...
Fixes fate-lavf-flm under valgrind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Nicolas George
be40d6cc2b
rawdec: fix a typo -- || instead of |
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
12 years ago
Nicolas George
9cc02101ff
lavc/rawdec: set field order on decoded frame.
12 years ago
Nicolas George
6184fa2067
rawdec: work with refcounted frames.
...
Adapted from commit 759001c534
by Anton Khirnov.
Also, fix the use of || instead of | in a flags check.
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
12 years ago
Michael Niedermayer
30806ddcbc
avcodec/rawdec: use AVFrame accessor functions
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
aec50f79e7
rawdec: use AVPALETTE_SIZE instead of magic constants.
12 years ago
Carl Eugen Hoyos
a6a5101654
Fix some avi rawvideo formats on big endian.
...
Fixes ticket #2196 .
12 years ago
Anton Khirnov
0ce033f888
rawdec: cosmetics, reformat
12 years ago
Michael Niedermayer
43d6ac53f2
lavc: ff_find_pix_fmt ->avpriv
...
Found-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
86159703f5
ff_find_pix_fmt: return NONE for the "not found" case.
...
Found-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago