Diego Biurrun
21e500ba64
svq1dec: Change type of array pitch parameters to ptrdiff_t
...
ptrdiff_t is the correct type for array pitches and similar.
8 years ago
Vittorio Giovara
41ed7ab45f
cosmetics: Fix spelling mistakes
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
9 years ago
Diego Biurrun
0f40c90984
Drop pointless assert.h #includes
9 years ago
Michael Niedermayer
a51d4246d8
avcodec/svq1dec: Check init_get_bits8() for failure
...
Fixes: CID1322313
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Vittorio Giovara
def97856de
lavc: AV-prefix all codec capabilities
...
Express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Vittorio Giovara
7c6eb0a1b7
lavc: AV-prefix all codec flags
...
Convert doxygen to multiline and express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Michael Niedermayer
ff1d85b0ed
avcodec/svq1dec: Remove duplicate buf_size check
...
Fixes CID1297573
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
6a85dfc830
lavc: Replace av_dlog and tprintf with internal macros
10 years ago
Michael Niedermayer
7b0daec233
avcodec/svq1dec: Fix undefined shifts
...
Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <tfoucu@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
741b56fcee
avcodec/svq1dec: Add assert to ensure "stages >= 0"
...
This is currently always true, the assert protects against
future changes to the code breaking this assumtation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Luca Barbato
9b8c8a9395
svq1dec: Validate the stages value strictly
...
It can be less than -1.
Bug-Id: CID 1194397 / CID 1194398
CC: libav-stable@libav.org
10 years ago
Paul B Mahol
335c150ba1
avcodec/svq1dec: remove unneeded #include, there are no assert()
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
10 years ago
Michael Niedermayer
5a82ad644f
svq1dec: Unbreak the scratch buffer allocation
...
The input packets are always assumed to be padded and
the av_fast_ family of function takes a pointer to a pointer.
Thanks to Nicolas Dufresne <nicolas.dufresne@collabora.com> for
a similar patch.
Introduced in 7b588bb691
.
Bug-Id: 766
CC: libav-stable@libav.org
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
10 years ago
Michael Niedermayer
e91ba2efa9
avcodec/svq1dec: zero terminate embedded message before printing
...
Fixes out of array access
Fixes: asan_stack-oob_49b1e5_10_009.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Paul B Mahol
6dfa70f272
Correct few "ffmpeg" typos
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
10 years ago
Michael Niedermayer
4213fc5b9e
avcodec/svq1dec: Fix multiple bugs from "svq1: do not modify the input packet"
...
Add padding, clear size, use the correct pointer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Anton Khirnov
7b588bb691
svq1: do not modify the input packet
...
The input data must remain constant, make a copy instead. This is in
theory a performance hit, but since I failed to find any samples
using this feature, this should not matter in practice.
Also, check the size of the header, avoiding invalid reads on truncated
data.
CC:libav-stable@libav.org
10 years ago
Anton Khirnov
5b9c3b4505
Replace all instances of avcodec_alloc_frame() with av_frame_alloc().
11 years ago
Anton Khirnov
7fbb75cc70
svq1dec: stop using deprecated avcodec_set_dimensions
11 years ago
Michael Niedermayer
c882b62d14
avcodec/svq1dec: Use skip_1stop_8data_bits()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Diego Biurrun
c591d4575a
avcodec: Replace local extern declarations for tables with header #includes
11 years ago
Michael Niedermayer
8c707a129a
avcodec/svq1dec: use init_get_bits8()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Carl Eugen Hoyos
052838f765
Insert a newline before showing embedded svq1 messages.
...
Messages may start with a carriage return.
12 years ago
Ronald S. Bultje
6caa44aa7d
svq1: Use hpeldsp instead of dsputil for half-pel functions
...
This makes svq1 independent of dsputil.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Anton Khirnov
ecff5acb5a
svq1dec: clip motion vectors to the frame size.
...
Fixes invalid reads for corrupted files.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
12 years ago
Anton Khirnov
b1bb8fb860
svq1dec: check that the reference frame has the same dimensions as the current one
...
They can be different if the last keyframe failed to decode correctly.
Fixes possible invalid reads in such a case.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
12 years ago
Ronald S. Bultje
4652389777
svq1: use hpeldsp instead of dsputil for half-pel functions.
...
This makes svq1 independent of dsputil.
12 years ago
Janne Grunau
e3232f3431
svq1: use av_frame_free to free refcounted frame
...
Fixes a memleak due to avcodec_free_frame not freeing the frame data.
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
12 years ago
Anton Khirnov
6ed9fc44ba
svq1: replace struct svq1_frame_size with an array.
...
It is used as an array in svq1enc, so this is more correct.
12 years ago
Michael Niedermayer
3b57bb478f
svq1dec: check that the reference frame matches in size before using it.
...
Fixes out of array reads
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Martin Storsjö
48238fd00b
svq1: Fix building with -DDEBUG
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Anton Khirnov
c4182d72c9
svq1: return meaningful error codes.
12 years ago
Anton Khirnov
998fdcff41
lavc: replace some forgotten instances of PixelFormat with AVPixelFormat
12 years ago
Anton Khirnov
84a0806680
svq1: unmacroify macros used only once.
12 years ago
Anton Khirnov
95baf701db
svq1: deMpegEncContextize
...
This decoder is quite simple and none of the MpegEncContext complexity
is actually needed.
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
Michael Niedermayer
7389bb12e6
svq1dec: update w/h only if the header is successfully parsed.
...
Prevents inconsistency and out of array accesses.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
0a373c31cb
svq1dec: dont export the qscale table.
...
SVQ1 has no qscales so the table is of no use, and it triggers a bug as
SVQ1 does not maintain the size of the table properly causing a crash.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Paul B Mahol
dd5aff001e
svq1dec: use log level that have more common sense
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
7b9fc769e4
svq1dec: use more common way to check if result is not zero
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
8f4020d8a4
svq1dec: check return value of get_bits1() in more common way
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
e2bf1082cc
svq1dec: return more meaningful error codes
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Diego Biurrun
63a46c6101
svq1: Drop a bunch of useless parentheses
12 years ago
Diego Biurrun
ada12f8366
svq1: K&R formatting cosmetics
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
f1e06d37c9
svq1/svq3: Move common code out of SVQ1 decoder-specific file
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago