Vittorio Giovara
6a85dfc830
lavc: Replace av_dlog and tprintf with internal macros
10 years ago
Vittorio Giovara
ec17782e17
dvdsubdec: Check memory allocations
10 years ago
wm4
816577716b
avcodec/dvdsubdec: fix accessing dangling pointers
...
dvdsub_decode() can call append_to_cached_buf() 2 times, the second time
with ctx->buf as argument. If the second append_to_cached_buf() reallocs
ctx->buf, the argument will be a pointer to the previous, freed block.
This can cause invalid reads at least with some fuzzed files - and
possibly with valid files.
Since packets can apparently not be larger than 64K (even if packets are
combined), just use a fixed size buffer. It will be allocated as part of
the DVDSubContext, and although some memory is "wasted", it's relatively
minimal by modern standards and should be acceptable.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
wm4
bcaa9099b3
avcodec/dvdsubdec: error on bitmaps with size 0
...
Attemtping to decode them could lead to invalid writes with some fuzzed
samples.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
wm4
c9151de7c4
avcodec/dvdsubdec: fix out of bounds accesses
...
The code blindly trusted buffer offsets read from the file in the RLE
decoder. Explicitly check the offset. Also error out on other RLE
decoding errors.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
5d0cfb58ef
avcodec/dvdsubdec: Avoid strerror() due to thread saftey
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Luca Barbato
d466d82faa
dvdsubdec: Do not leak on failure path
...
CC: libav-stable@libav.org
Bug-Id: CID 1198262
10 years ago
Michael Niedermayer
1de786777e
avcodec/dvdsubdec: Check all fseek()s return codes
...
Fixes CID1254660
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Shin-ichi Toyama
12630fa821
avcodec/dvdsubdec: New option for obtaining global palette from .IFO file (experimental)
...
Suggested-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Nicholas Robbins
c7d21dee28
libavcodec/dvdsubdec: Add option forced_subs_only to only decode forced subtitle frames.
...
Signed-off-by: Nicholas Robbins <nickrobbins@yahoo.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
5c073bbb57
avcodec/dvdsubdec: fix VD/SD identifier name
...
Found-by: Nicholas Robbins <nickrobbins-at-yahoo.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
2d7cec14be
avcodec/dvdsubdec: Dont mix integers with pointers
...
Reviewed-by: James Darnley <james.darnley@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Gabriel Dume
4b1f5e5090
cosmetics: Write NULL pointer inequality checks more compactly
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
11 years ago
Gabriel Dume
f929ab0569
cosmetics: Write NULL pointer equality checks more compactly
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
11 years ago
Michael Niedermayer
dd200c56c0
avcodec/dvdsubdec: free subtitle rectangles if nothing is output
...
Fixes assertion failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Oliver Fromme
d73823286d
avcodec/dvdsubdec: fix alpha in debuging code
...
improve the debugging function for saving subtitles
to PPM files: Actually use the alpha channel.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Oliver Fromme
3f0a3e9e12
avcodec/dvdsubdec: Fix off-by-one error
...
Fix an off-by-one error that causes the height of decoded
subtitles to be too small, thus cutting off the lowest row
of pixels.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
3dc6272bed
Remove a number of unnecessary dsputil.h #includes
11 years ago
Diego Biurrun
05563ccacc
dsputil: cosmetics: Lose camelCase on ff_cropTbl and ff_squareTbl names
...
Also switch from "tbl" to "tab" name suffixes.
11 years ago
Michael Niedermayer
7fa9f7ef1c
dvdsub_parse_extradata: fix memleak
...
Fixes CID1135765
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
b7fea3daab
libavcodec/dvdsubdec: remove exit() call in debug code
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
86f910806b
Remove #undefs for formerly forbidden system functions
...
The macros forbidding the system functions no longer exist, obviating
the need for the #undefs.
11 years ago
Anton Khirnov
babbec0867
dvdsubdec: stop using deprecated avcodec_set_dimensions
11 years ago
Clément Bœsch
95cafeb684
avcodec/dvdsubdec: reconstruct incomplete SPU packets.
11 years ago
Clément Bœsch
71e0ae22ac
avcodec/dvdsubdec: extract every subtitle in a different file (debug).
...
Even thought a generic solution would be more relevant, this is
currently helpful while debugging.
11 years ago
Clément Bœsch
41fd6f0796
avcodec/dvdsubdec: factor out rectangles reset.
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 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
Diego Biurrun
2832ea26f3
Remove commented-out debug #define cruft
12 years ago
Michael Niedermayer
a1f234be11
make the ordering of the return type and av_cold consistent
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
6fee1b90ce
avcodec: Add av_cold attributes to init functions missing them
12 years ago
Martin Storsjö
9e0f14f16c
lavc: Make pointers to ff_cropTbl const
...
There's no point in these pointers not being const.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Reimar Döffinger
efa7f42020
Use the avstring.h locale-independent character type functions
...
Make sure the behavior does not change with the locale.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Reimar Döffinger
88d55b827d
Remove incorrect use of ctype.h functions.
...
As far as I can tell the code should not change behaviour
depending on locale in any of these places.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
12 years ago
Clément Bœsch
40976257bc
dvdsubdec: parse the size from the extradata
...
Signed-off-by: Alexandra Khirnova <alexandra.khirnova@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Joakim Plate
f924d52975
dvdsubdec: Support palette in mkv
...
Matroska stores palette information as plain text in extradata.
Signed-off-by: Alexandra Khirnova <alexandra.khirnova@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Michael Niedermayer
754dd7e889
dvdsubdec: use unsigned shifts to avoid shifting into the sign bit
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Nicolas George
217b10de3f
lavc/dvdsubdec: accept palette from options.
...
On DVDs, the palette is part of the IFO file and therefore
not available when reading from a dumped VOB file.
12 years ago
Clément Bœsch
3b6e9cd7ec
lavc/dvdsubdec: parse the size from the extradata.
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
13 years ago
hakuya
79e5902cf1
Exposing forced flag for DVD and PGS subtitles
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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
Diego Biurrun
a92be9b856
Replace memset(0) by zero initializations.
...
Also remove one pointless zero initialization in rangecoder.c.
13 years ago
Diego Biurrun
124e28847b
Remove some stray unnecessary ffmpeg references.
13 years ago
Kelly Anderson
872655fee9
dvdsubdec: fix bad free in dvdsub_init
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Joakim Plate
32c0c562e7
dvdsubdec: Move colormap and alpha to context
...
This makes it rememember old values should the stream not
contain new values for these for each subtitle.
13 years ago
Joakim Plate
7009b96511
dvdsubdec: Support palette information for vobsub's stored as text in extradata
...
This is how mkv's store palette information for vobsubs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Reimar Döffinger
99c7b51641
Abort if command offset decreases, avoids potential endless loop.
...
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
14 years ago
Anton Khirnov
ec6402b7c5
lavc: use designated initialisers for all codecs.
...
It's more readable and less prone to breakage.
14 years ago
Alexandre Colucci
676eaf8433
dvdsubdec: fix incorrect colors.
...
On DVD and HD-DVD colors are stored in the order YCrCb (and not YCbCr) as mentioned in the specifications:
see DVD Specifications for Read-Only Disc / Part 3, 4.3 Program Chain Information (7) PGC_SP_PLT
see DVD Specifications for High Definition Disc, 5.2 Navigation for Standard Content (11) PGC_SDSP_PLT
see DVD Specifications for High Definition Disc, 5.2 Navigation for Standard Content (12) PGC_HDSP_PLT
see DVD Specifications for High Definition Disc, 5.5 Presentation Data (4) SET_COLOR2
When decoding a DVD or HD-DVD subtitle, the colors were incorrectly set.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
14 years ago