Sylvain Fabre
526049ce61
Issue-#3407 : Enhance precision for double to string conversion, useful for GEOTIFF double values
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
a744064c41
avcodec/tiff: reset geotag_count in free_geotags()
...
Fixes null pointer dereference
Fixes: signal_sigsegv_19d922e_3688_cov_1577641655_aletrek_tiff.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
c265b8bb76
tiff: stop using deprecated avcodec_set_dimensions
11 years ago
Michael Niedermayer
46143d2555
avcodec/tiff: factorize offset init code
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
d5ad4e4a2f
avcodec/tiff: remove TIFF_LONG special case
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
0aba920d61
avcodec/tiff: Fix use of uninitialized off variable
...
Fixes CID1108608
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
6338f1b3c0
avcodec/tiff: remove byte based bpp special case
...
This case does not work as off is uninitialized and it should be
handled fine by the generic code below
Fixes CID1108608
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Paul B Mahol
8a7295beeb
tiff: frame multithreading support
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years ago
Thilo Borgmann
b7ba7cbd6e
avcodec/tiff: Refactor TIFF tag related functions to share the code.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
61e0e80999
tiff: continue parsing on non fatal errors
...
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
200170e8c0
avcodec/tiff: remove redundant check
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
a9553e8f37
avcodec/tiff: avoid seek back on reading tags
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Luca Barbato
9c22169769
tiff: do not overread the source buffer
...
At least 2 bytes from the source are read every loop.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
12 years ago
Luca Barbato
999ccd2d0a
tiff: cleanup the error paths
...
Return the proper error values and optionally report them.
12 years ago
Luca Barbato
016c5b066d
tiff: refactor fax support in a separate function
12 years ago
Luca Barbato
103937681d
tiff: refactor deflate support in a separate function
...
Report when zlib support is missing.
12 years ago
Paul B Mahol
86005184e3
tiff: simplify picking right pixel format
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
8cc8adaa88
tiff: correctly decode saparate planes with horizontal differencing predictor
...
Closes #2648 .
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Michael Niedermayer
bbae652113
tiff: fix memleak
...
Fixes CID1026764
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
46ce9ded96
tiff: K&R formatting cosmetics
12 years ago
Carl Eugen Hoyos
a4b5863eea
Fix compilation of libavcodec/tiff.c
12 years ago
Paul B Mahol
379ad9788b
tiff: planar rgb
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
7984ed87c1
tiff: support inverted fill_order for packbits compression
...
Fixes #1995 .
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
30d7dcce4c
tiff: add helper function for fill_order case
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Hendrik Leppkes
edcc51fb8e
tiff: fix handling of metadata with refcounted frames
...
Since the conversion to refcounted frames, the tiff decoder
only wrote the metadata into its internal "picture" in its own context,
never exposing the metadata to the user, and eventually leaking the
metadata.
Instead, properly store the metadata directly into the frame being decoded into.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Clément Bœsch
1ec94b0f06
lavc: factorize ff_{thread_,re,}get_buffer error messages.
...
Coccinelle profile used:
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_get_buffer(ctx, f, flags)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str;
@@
-if ((r = ff_reget_buffer(ctx, f)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_reget_buffer(ctx, f)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0)
+ return r;
...along with some manual patches for the remaining ones.
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
12 years ago
Michael Niedermayer
f232659130
tiff: use AVFrame accessor functions
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
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