Michael Niedermayer
a34418c28e
tiff: check bppcount
...
Fixes division by 0
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
e1219cdaf9
tiff: Check buffer allocation and pointer increment more carefully in shorts2str() and double2str()
...
Fixes 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
0e3dacb11e
tiff: dont leave geotag_count in an invalid state on errors.
...
Fixes out of array reads
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
f28043d0a3
tiff: check for failure in search_keyval()
...
Fixes null pointer dereference
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
b16830840e
tiff: in add_string_metadata() check the count more completely
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
659546b42d
tiff: Fix assignments in if()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
b2a7b81b9c
tiff: return meaningful error codes.
12 years ago
Piotr Bandurski
4784a135b2
tiffdec: Use the correct height field.
...
Fixes Ticket913
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
52334f5be2
tiff: print error for old style LZW
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Piotr Bandurski
17714adbf8
tiffdec: support LZW compression with inverted FillOrder
12 years ago
Piotr Bandurski
7f01247572
tiff: support zlib with invertedFillOrder
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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
Michael Niedermayer
27eada287a
tiffdec: better checks for bitstream offsets, fixes out of array reads
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
02a325cb6f
tiffdec: check rps, fix infinite loop.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
6d1c5ea04a
tiffdec: check count in metadata reading.
...
Fixes out of array access
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
ce1ebb31a9
tiffdec: use checked reads for tget*()
...
Fixes out of array reads
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Clément Bœsch
6fb2fd895e
lavc: add lavfi metadata support.
...
This commit introduces a new AVPacket side data type:
AV_PKT_DATA_STRINGS_METADATA. Its main goal is to provide a way to
transmit the metadata from the AVFilterBufferRef up to the AVFrame. This
is at the moment "only" useful for lavfi input from libavdevice:
lavd/lavfi only outputs packets, and the metadata from the buffer ref
kept in its context needs to be transmitted from the packet to the frame
by the decoders. The buffer ref can be destroyed at any time (along with
the metadata), and a duplication of the AVPacket needs to duplicate the
metadata as well, so the choice of using the side data to store them was
selected.
Making sure lavd/lavfi raises the metadata is useful to allow tools like
ffprobe to access the filters metadata (it is at the moment the only
way); ffprobe will now automatically show the AVFrame metadata in any
customizable output format for users. API users will also be able to
access the AVFrame->metadata pointer the same way ffprobe does
(av_frame_get_metadata).
All the changes are done in this single commit to avoid some memory
leaks: for instances, the changes in lavfi/avcodec.c are meant to
duplicate the metadata from the buffer ref into the AVFrame. Unless we
have an internal way of freeing the AVFrame->metadata automatically, it
will leak in most of the user apps. To fix this problem, we introduce
AVCodecContext->metadata and link avctx->metadata to the current
frame->metadata and free it at each decode frame call (and in the codec
closing callback for the last one). But doing this also means to update
the way the tiff decoder already handles the AVFrame->metadata (it's the
only one decoder with frame metadata at the moment), by making sure it
is not trying to free a pointer already freed by the lavc internals.
The lavfi/avcodec.c buffer ref code is based on an old Thomas Kühnel
work, the rest of the code belongs to the commit author.
Signed-off-by: Thomas Kühnel <kuehnelth@googlemail.com>
Signed-off-by: Clément Bœsch <ubitux@gmail.com>
12 years ago
Michael Niedermayer
d185c8a79b
tiff: run strlen() after setting the pointer
...
Fixes CID733803
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
b12d92efd6
avoid "0xFF << 24" as it is considered a integer overflow in C99
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
d5c62122a7
Move av_reverse table to libavcodec
...
It is only used in that library.
12 years ago
Michael Niedermayer
4b20b21b8d
tiff: fix leak on error return in doubles2str()
...
Fixes CID733797
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
716d413c13
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
12 years ago
Michael Niedermayer
c5fdd0696a
tiff: fix "assignment discards qualifiers from pointer target type" warning
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Alex Converse
df6c3f9fb3
tiffdec: Add support for GRAY16LE.
...
Tested with the GraphicsMagick TIFF archive and Libav generated files.
12 years ago
Carl Eugen Hoyos
8e082df0f4
Support decoding of monochrome tiff images without bpp tag.
12 years ago
Michael Niedermayer
17f9626b5d
tiff/doubles2str: check for truncation
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
0196bc6f14
tiff/doubles2str: factor out component_len
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Martin Storsjö
1d9c2dc89a
Don't include common.h from avutil.h
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
13 years ago
Paul B Mahol
3071af6cf2
tiff: read more tags of type string
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Paul B Mahol
292850b634
tiff: add smarter checks if there is enough data left
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Paul B Mahol
1ec83d9a9e
tiff: port to bytestream2
...
Prevents out of array reads.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Thomas Kühnel
75abfab6c6
lavc/tiff: add GeoTIFF support to the TIFF decoder
...
Work done for SOCIS 2011.
See thread:
Subject: [libav-devel] [PATCH 2/3] tiff: Add GeoTIFF support to the TIFF decoder
Date: Tue, 4 Oct 2011 00:19:52 +0200
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
13 years ago
Paul B Mahol
8f239412d8
tiffdec: PIX_FMT_GRAY16LE support
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Michael Niedermayer
fefc65675e
tiffdec: check overread for packbits
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Alex Converse
f346b6bbeb
tiffdec: K&R cosmetics
13 years ago
Alex Converse
90a4306007
tiffdec: Add a malloc check and refactor another.
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
Alex Converse
fd0be63049
tiffdec: Prevent illegal memory access caused by recycled pointers.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
13 years ago
Diego Biurrun
324deaa268
Replace AVFrame pointer type punning by proper struct member assignments.
13 years ago
Diego Biurrun
562b6c744a
Remove unnecessary AVFrame pointer casts.
13 years ago
Alex Converse
447363870f
tiff: Prevent overreads in the type_sizes array.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
13 years ago
Alex Converse
e32548d133
tiff: Make the TIFF_LONG and TIFF_SHORT types unsigned.
...
TIFF v6.0 (unimplemented) adds signed equivalents.
13 years ago
Carl Eugen Hoyos
f746f37901
Support decoding gray8a tiff images.
13 years ago
Carl Eugen Hoyos
c714cd3bd4
Support 64bit tiff images.
...
Fixes a part of ticket #503 .
Reviewed-by: Paul B Mahol
Reviewed-by: Jean First
13 years ago
Paul B Mahol
98dfdfdd8e
tiffdec: notify user that tile support is missing
...
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
13 years ago
Carl Eugen Hoyos
714d2f9796
Only expand raw and packed 1bpp tiff horizontally if it is palettised.
13 years ago
Michael Niedermayer
4392b3d11e
tiffdec: hotfix for fate failure.
...
Only use pal8 as output if the file has a palette or more than 2 colors.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago