Commit Graph

7628 Commits

Author SHA1 Message Date
Luca Barbato 30c3d976f1 mov: do not misreport empty stts
Return -1 instead of ENOMEM if entries is 0.
Fixes a av_malloc(0) crash in macosx.
2011-10-11 15:06:50 +02:00
Luca Barbato 5a7ba58657 mov: cosmetics, fix for and if spacing 2011-10-11 15:06:11 +02:00
Anton Khirnov c780b543e7 id3v2: fix NULL pointer dereference
Bug found by Laurent Aimar fenrir at videolan org
2011-10-11 14:56:41 +02:00
Raivo Hool 2804d32075 mov: read album_artist atom
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-10-11 14:56:41 +02:00
Raivo Hool dff4177546 mov: fix disc/track numbers and totals
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-10-11 14:56:41 +02:00
Justin Ruggles a7984a6a6d smacker: Separate audio flags from sample rates in smacker demuxer.
Makes the code easier to understand.
2011-10-11 07:48:16 -04:00
Laurent Aimar 79964745b3 4xmdemux: prevent use of uninitialized memory
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-10-10 21:37:35 +02:00
Laurent Aimar 6de33611c9 avsdemux: check for out of bound writes
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-10-10 21:36:12 +02:00
Laurent Aimar 76c6971a64 avsdemux: check for corrupted data
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-10-10 21:27:04 +02:00
Mans Rullgard 1703013cb7 avidec: fix signed overflow in avi_sync()
Keeping byte values read from the file as unsigned is consistent
with how they are subsequently used and avoids an undefined left
shift by 24 when bit 7 is set.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-10-10 17:49:13 +01:00
Alex Converse 0c46e958d1 mxfdec: Fix some buffer overreads caused by the misuse of AVPacket related functions. 2011-10-10 09:40:26 -07:00
Janne Grunau 2886f6759f avidec: simplify size parameter in memset() 2011-10-10 13:28:18 +02:00
Mans Rullgard a31e9f68a4 lavf: fix signed overflow in avformat_find_stream_info()
On the first iteration through this code, last_dts is always
INT64_MIN (AV_NOPTS_VALUE) and the subtraction overflows in
an invalid manner.  Although the result is only used if the
input values are valid, performing the subtraction is still
not allowed in a strict environment.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-10-08 20:04:22 +01:00
Alex Converse 98ef887a75 mpegps: Use av_get_packet() instead of poorly emulating it. 2011-10-07 17:04:14 -07:00
Laurent Aimar 1e3336de69 mpc8: Fix return value on EOF
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-10-07 16:25:30 +02:00
Laurent Aimar 1775b92fee segafilm: Check for memory allocation failures in segafilm demuxer.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-10-06 23:19:45 +02:00
Laurent Aimar 762ffa6861 segafilm: Fix potential division by 0 on corrupted streams in the demuxer
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-10-06 23:01:45 +02:00
Laurent Aimar 790f4dd5c9 Fixed segfault on corrupted sega streams in the demuxer.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-10-06 22:32:02 +02:00
Anton Khirnov a4ea00d021 lavc/lavf: use unique private classes.
This is needed by the new AVOptions API.
2011-10-05 07:52:30 +02:00
Diego Biurrun 12bd8532cf Synchronize various 4CCs and codec tags from FFmpeg. 2011-10-04 11:58:53 +02:00
Justin Ruggles fc2dd2c7ac ogg/celt: do not set sample_fmt in the demuxer 2011-10-03 21:23:22 -04:00
Anton Khirnov 60df6b0048 id3v2: remove pointless casts 2011-10-03 13:06:51 +02:00
Anton Khirnov d2961e4ebf id3v2: read TXXX frames with two calls to decode_str() instead of one.
Read the key in the first, value in the second.

This allows to avoid pointless strdups and simplify decode_str() by
dropping two of its parameters.
2011-10-03 13:06:51 +02:00
Anton Khirnov 1e18d32d01 id3v2: don't discard the whole tag when encountering empty frames.
While they're technically invalid, it's better to skip them and try to
read the rest of the tag.
2011-10-03 13:06:41 +02:00
Martin Storsjö e81e5e8ad2 lavf: Avoid using av_malloc(0) in av_dump_format
On OS X, av_malloc(0) returns pointers that cause crashes when
freed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-30 22:31:30 +03:00
Kieran Kunhya d4a544cbc4 latmenc: Set latmBufferFullness to largest value to indicate it is not used
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-09-30 11:17:27 +02:00
Alex Converse fe21f78d2b mpeg probe: check the 2/4-bit synchronization value found after a pack_start_code. 2011-09-29 09:45:57 -07:00
Kieran Kunhya 32dfd8ca65 latmenc: Fix private options
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-28 15:49:07 +03:00
Michael Niedermayer 77d2ef13a8 Fix memory (re)allocation in matroskadec.c, related to MSVR-11-0080.
Whitespace of the patch cleaned up by Aurel
Some of the issues have been reported by Steve Manzuik / Microsoft Vulnerability Research (MSVR)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

(cherry picked from commit 956c901c68)

Further suggestions from Kostya <kostya.shishkov@gmail.com> have been
implemented by Reinhard Tartler <siretart@tauware.de>

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-09-27 23:14:05 +02:00
Anton Khirnov c7a63a521b matroskaenc: write attachments. 2011-09-27 15:26:36 +02:00
Anton Khirnov 98cfe22b5c matroskadec: export mimetype of attachments as metadata. 2011-09-27 15:26:36 +02:00
Rafaël Carré 1430ae44e8 rtp: Simplify ff_rtp_get_payload_type
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-26 21:55:27 +03:00
Rafaël Carré 9152880e95 rtpenc: Add a payload type private option
Specifying the payload type is useful when the type number has
already been negotiated before creating the stream, for example
in SIP protocol.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-26 21:54:57 +03:00
Rafaël Carré 142887741f rtp: Correct ff_rtp_get_payload_type documentation
Since 0c378ea1f, it can't fail anymore.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-26 21:54:14 +03:00
Nicolas George 4ca59d1948 oggdec: add support for Xiph's CELT codec
This patch also introduces CODEC_ID_CELT.

Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-09-26 13:51:29 +02:00
Justin Ruggles b15a9888a8 sol: return error if av_get_packet() fails.
This prevents sending a packet with data=NULL size=AVERROR_EOF.
2011-09-25 16:53:49 -04:00
Mans Rullgard bb416bd68c lavf: do not set codec_tag for rawvideo
If the demuxer did not set a codec_tag, there is none and
inventing one makes no sense.  This change stops the rawvideo
"decoder" over-writing user-supplied pixfmt with one derived
from the codec_tag.  The pixfmt-codec_tag-pixfmt round-trip
is lossy since several pixfmts map to the same codec_tag.

This fixes fate-lavf-pixfmt with avfilter disabled.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-09-25 14:07:21 +01:00
Michael Niedermayer a246cefa75 flvdec: Check for overflow before allocating arrays
On allocation, the array length is multiplied by sizeof(int64_t),
this prevents the multiplication from overflowing.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-25 12:55:21 +03:00
Laurent Aimar 2b4e49d428 flvdec: Fix invalid pointer deferences when parsing index
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-24 18:08:39 +03:00
Diego Biurrun 30b4ee7901 Use explicit struct initializers for AVOutputFormat/AVInputFormat declarations. 2011-09-24 12:11:17 +02:00
Alex Converse 9fba8ebe0a mpegps: Handle buffer exhaustion when reading packets. 2011-09-23 16:36:16 -07:00
Rafaël Carré 0c378ea1f7 rtp: factorize dynamic payload type fallback
Move the identical code in rtp_write_header() and
ff_sdp_write_media() inside ff_rtp_get_payload_type()

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-09-23 22:00:24 +02:00
Martin Storsjö bafff1668c flvdec: Ignore the index if it's from a creator known to be different
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-23 20:59:48 +03:00
Diego Biurrun 5cc2530fc2 prores: mark prores as intra-only in libavformat/utils.c:is_intra_only() 2011-09-23 01:42:14 +02:00
Janne Grunau dcb9f6a20d Add LATM demuxer
This is a raw demuxer for the AAC LATM decoder and thus limited to
single stream LOAS.
2011-09-22 20:39:24 +02:00
Justin Ruggles 1993c6849c 8svx/iff: fix decoding of compressed stereo 8svx files.
Make the iff demuxer send the whole audio chunk to the decoder as a
single packet and move stereo interleaving from the iff demuxer to the
decoder.

Based on a patch by Stefano Sabatini.
git.videolan.org/ffmpeg.git
commit e280a4da2a
2011-09-22 14:11:34 -04:00
Alex Converse 1c2e07b811 mp4: Don't read an empty Decoder Config Descriptor 2011-09-22 10:09:04 -07:00
Martin Storsjö b14629e5ea rtmp: Make the input FLV parser handle data cut at any point
This makes the RTMP writing code able to handle FLV data
fed in arbitrarily small or large chunks, with multiple
consecutive packets in one write call, or having the FLV
packet header split over numerous write calls.

When used in conjunction with the flv muxer, the AVIO buffer
size still needs to be large enough to fit the initial metadata
packet though, since the size of that packet is written with a
seekback.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-22 10:36:16 +03:00
Alex Converse 05fc9e40a4 swfdec: Add support for sample_rate_code 0 (5512 Hz) 2011-09-21 09:42:35 -07:00
Anton Khirnov 609a2fa1fa Remove some forgotten AVCodecContext.palctrl usage. 2011-09-21 13:51:53 +02:00
Diego Biurrun 35a6855868 Fix av_dlog invocations with wrong or missing logging context.
This fixes build failures with -DDEBUG in CPPFLAGS.
2011-09-21 09:57:32 +02:00
David Goldwich 61f4387d39 oma: support for encrypted files
Signed-off-by: David Goldwich <david.goldwich@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-21 08:33:15 +02:00
David Goldwich 7a019dffe5 id3v2: add support for non-text and GEOB type tag frames
This extends the ID3v2 parser to allow for reading of non-text (i.e.
other than T***) meta tag frames providing a ff_id3v2_read_all()
function. An additional data structure 'ID3v2ExtraMeta' is introduced
for these tags since AVDictionary is string oriented and unsuitable
for binary data.

A parser for tag frames of type GEOB is implemented, which is needed
to extract keyring information from encrypted OMA files. GEOB data
is parsed into 'ID3v2ExtraMetaGEOB' data structures.

The routine to decode characters from different encodings to UTF-8,
formerly part of the read_ttag() function, is moved to its own
function. Because some tag frames contain subparts of unknown length,
the function is now also able to read until a null character is found.
In addition, the function now takes care of allocating a buffer long
enough to hold the decoded characters.

Signed-off-by: David Goldwich <david.goldwich@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-21 08:28:21 +02:00
Martin Storsjö 3ffe32eb96 rtmp: Don't blindly skip the 4 trailer bytes from the FLV packets
If not enough bytes are available, keep track of them and skip
them on next call.

In practice, if these trailer bytes are written in a separate
call, there is no other data written in this call, making it
fall into the "FLV packet too small" case currently - working,
but not as intended.

This patch makes the code more robust, handling all cases
except for having the FLV packet header split over multiple
write calls.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-20 16:23:48 +03:00
Chiranjeevi Melam a14c784210 rtmp: Handle FLV packets written in more than one write call
If the FLV packet is larger than the AVIO buffer, a partial
FLV packet will be flushed to the RTMP protocol.

This commit handles the most common cases of FLV packets
being written in more than one call.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-20 16:23:46 +03:00
Anton Khirnov c92a2a4eb8 movenc: fix NULL reference in mov_write_tkhd_tag
st may be NULL when there are more mov streams than AVStreams, e.g. when
chapters are present.
2011-09-19 16:44:42 +02:00
Laurent Aimar f06068bbd6 rmdec: Reject invalid deinterleaving parameters
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-19 15:45:22 +03:00
Laurent Aimar 3e033da847 rmdec: use the deinterleaving mode and not the codec when creating audio packets.
It prevents crashes due to non initialized fields.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-19 12:37:31 +02:00
David Goldwich 63d64228a7 lavf: Fix context pointer in av_open_input_stream when avformat_open_input fails
Signed-off-by: David Goldwich <david.goldwich@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-19 12:03:56 +02:00
Laurent Aimar 0e7efb9d23 oggdec: fix out of bound write in the ogg demuxer
Between ogg_save() and ogg_restore() calls, the number of streams
could have been reduced.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-09-17 09:41:02 -07:00
Anton Khirnov 7574cacbd5 movenc: create an alternate group for each media type
Partially fixes bug 44.
2011-09-17 08:42:30 +02:00
Anton Khirnov 85d982f1e2 rawdec: refactor private option for raw video demuxers
pixel_format/video_size only apply to 'rawvideo' (==uncompressed) demuxer
and make no sense for the other raw (== containerless) demuxers. Keep
only the framerate option for those.

Also use unique classes for all raw video demuxers
2011-09-17 06:43:09 +02:00
Anton Khirnov 34d2bf30a0 pcmdec: use unique classes for all pcm demuxers. 2011-09-17 06:42:32 +02:00
Anton Khirnov d906f49aa8 rawdec: g722 is always 1 channel/16kHz 2011-09-17 06:42:17 +02:00
Laurent Aimar b59efc9434 Fixed size given to init_get_bits().
init_get_bits() takes a number of bits and not a number of bytes as
its size argument.

Signed-off-by: Alex Converse <alex.converse@gmail.com>
2011-09-15 13:23:04 -07:00
Dustin Brody d7d2f0e63c matroskadec: fix typo.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-15 09:34:38 +02:00
Dustin Brody 4a9628f276 matroskadec: bail on parsing of incorrect seek index segments
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-15 09:34:16 +02:00
Alex Converse 940173d4d1 lavf utils: Remove write-only variable 2011-09-14 10:35:46 -07:00
Alex Converse 4439caa482 lavf utils: Rename shadowing variable 2011-09-14 10:35:42 -07:00
Laurent Aimar a92d0fa5d2 Fixed off by one packet size allocation in the smacker demuxer.
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-12 23:44:51 +03:00
Laurent Aimar e055932f56 Check for invalid packet size in the smacker demuxer.
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-12 23:43:52 +03:00
Laurent Aimar 273aab99bf ape demuxer: fix segfault on memory allocation failure.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-12 21:12:31 +02:00
Kostya Shishkov 47a8589f7b smacker demuxer: handle possible av_realloc() failure.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-12 15:51:21 +02:00
Georgi Chorbadzhiyski f1f15c3c1a mpegts: improve error reporting
When reporting continuity error show pid, expected and received cc.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-09-11 09:27:13 -04:00
Aviad Rozenhek 162f1fbc14 mpegts: on seek, reset the cc for all PIDs
Prevent false positive continuity counter error logs.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-09-11 09:26:21 -04:00
Diego Biurrun 6376362d15 Employ FF_ARRAY_ELEMS instead of manually calculating array length. 2011-09-08 15:57:14 +02:00
Michael Niedermayer 5ea091fb5a rtpdec_asf: Fix integer underflow that could allow remote code execution
Fixes MSVR-11-0088.
Credit:  Jeong Wook Oh of Microsoft and Microsoft Vulnerability Research (MSVR)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-07 23:33:53 +03:00
Kieran Kunhya 0ca36b4de7 Add LATM muxer
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-09-07 12:57:55 +02:00
Anton Khirnov 9c684feadc libx264: add 'direct-pred' private option
Deprecate AVCodecContext.directpred
2011-09-07 07:27:55 +02:00
Anton Khirnov 0635a8aa21 libx264: add 'partitions' private option
Deprecate AVCodecContext.partitions.
2011-09-07 07:27:18 +02:00
Stefan Fritsch 346ea9e222 http: Consider the stream as seekable if the reply contains Accept-Ranges: bytes
The initial request contains "Range: 0-", which servers normally
have responded with "HTTP/1.1 206 Partial Content" reply with
a Content-Range header, which was used as indicator for seekability.

Apache, since 2.2.20, responds with "HTTP/1.1 200 OK" for these
requests, which is more friendly to caches and proxies, but the
seekability still is indicated via the Accept-Ranges: bytes header.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-04 11:28:53 +02:00
Luca Barbato 5ee5dc4e9a nutenc: add namespace to the api facing functions
Rename write_{header,packet,trailer} to nut_write_{header,packet,trailer}
in order to make easier debugging them.
2011-09-04 11:09:06 +02:00
Anton Khirnov fb4ca26bdb lavf,lavc,sws: add {avcodec,avformat,sws}_get_class() functions. 2011-09-03 20:53:35 +02:00
Anton Khirnov c11fb8288d AVOptions: add AV_OPT_SEARCH_FAKE_OBJ flag for av_opt_find().
It allows to search for options only with AVClass, without allocating
the corresponding context.
2011-09-03 20:52:21 +02:00
Tomas Härdin 8b7222979c isom: add missing AVC-Intra tags, rearrange list and update comments
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-08-29 16:48:39 +02:00
Kostya Shishkov 10397215aa Use deinterleavers for demangling audio packets in RealMedia.
Unlike other containers RealMedia stores its audio packets in scrambled form,
with interleaver ID preceeding audio codec ID. Currently deinterleaving
decision is tied to the codec while it's possible to have non-default
deinterleaver with audio codec (like Int0 deinterleaver instead of specific
one for Sipro).

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-08-27 17:23:45 +02:00
Stefano Sabatini f2011ed234 fifo: add av_fifo_peek2(), and deprecate av_fifo_peek()
The new function provides a more generic interface than av_fifo_peek()
for peeking at a FIFO buffer data.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-08-26 20:53:02 +02:00
Diego Biurrun c960e67ad0 Replace deprecated av_find_stream_info() by avformat_find_stream_info(). 2011-08-26 17:40:07 +02:00
Sven Hesse 5f677aac76 xmv: eliminate superfluous zeroing of zero data
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-08-26 16:26:57 +02:00
Alex Converse ad6c7c1b52 mp4: Handle non-trivial ES Descriptors. 2011-08-25 11:53:21 -07:00
Alex Converse 7e6029f98a lavf utils: Fix bad indentation. 2011-08-23 09:53:23 -07:00
Alberto Delmás 45ecda8554 Windows Media Image decoder (WMVP/WVP2)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-08-23 11:18:35 +02:00
Anton Khirnov fb42d156ed movenc: use libx264 by default when possible for mov, mp4 and psp 2011-08-22 07:17:35 +02:00
Anton Khirnov b71389cbae avienc: saner default audio codec.
libmp3lame if available, ac3 otherwise.
2011-08-22 07:17:19 +02:00
Anton Khirnov 3436c4a368 matroskaenc: saner default codecs.
libvorbis/libx264 for video if available, otherwise ac3/mpeg4.
2011-08-22 07:16:55 +02:00
Kostya Shishkov ccb919e34b WavPack demuxer: do not rely on index when timestamp is not in indexed range.
This fixes the situation when there are not enough entries in the index
(e.g. on initial seek there's only one index entry in the index) and index
search returns just the last known entry. That causes seeking function just to
seek there instead of trying harder to get at the requested position.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-08-21 12:55:17 +02:00
Kostya Shishkov 5561fe487f WavPack demuxer: store position of the first block in index.
Currently for multichannel audio position for the last block position is
stored in index (and used for seeking), which is obviously not correct.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-08-21 12:54:35 +02:00
Sven Hesse c6c6c1aaa6 add XMV demuxer
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-08-17 15:04:37 +02:00
Kostya Shishkov a43b1e74e2 rmdec: parse FPS in RealMedia properly
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-08-17 15:00:42 +02:00
Kostya Shishkov 48ce8b8da7 Use parsers for RealVideo 3/4 to determine correct PTS
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-08-17 15:00:42 +02:00