Commit Graph

12482 Commits

Author SHA1 Message Date
Vignesh Venkatasubramanian 30c5c45b12 Adding support for parsing BlockAdditional
Matroska specification lists support for BlockAdditional element
which is not supported by ffmpeg's matroska parser. This patch
adds grammar definitions for parsing that element (and few other
related elements) and then puts the data in AVPacket.side_data
with new AVPacketSideDataType AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 00:46:28 +01:00
Daniel Verkamp 5dd78ef34e WAV muxer: reindent 2013-02-13 17:36:55 +00:00
Nicolas George b68dd8a161 lavf/concatdec: allow probing. 2013-02-13 14:58:50 +01:00
Nicolas George db9dc5154d lavf/concatdec: add signature directive. 2013-02-13 14:58:50 +01:00
Nicolas George 6d680d20ad lavf/concatdec: add safe option. 2013-02-13 14:58:50 +01:00
Daniel Verkamp 1ecce266fa WAV muxer: add RF64 support 2013-02-12 14:50:27 +00:00
Carl Eugen Hoyos 182e342fdb Print mxf Universal Label if the user requested verbose logging.
Fixes ticket #2198
2013-02-11 13:11:16 +01:00
Stefano Sabatini 6b171f046c lavf/matroskaenc: provide more feedback in case of unsupported codec
Also return meaningful error code.
2013-02-10 21:00:56 +01:00
Michael Niedermayer ea1d8465e6 Fix division by 0 due to audio frame size
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 18:15:33 +01:00
Michael Niedermayer e88f392733 Merge commit '81726a4f0b8a43e19898e2a36fdde80583bafff0'
* commit '81726a4f0b8a43e19898e2a36fdde80583bafff0':
  FATE: add tests for additional flavors of asf cover art
  asfdec: do not assume every AVStream has a corresponding ASFStream

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 13:18:04 +01:00
Michael Niedermayer 9a714d871a Merge commit 'f5fac6f77752931347ab302563802dcaa49c2419'
* commit 'f5fac6f77752931347ab302563802dcaa49c2419':
  asfdec: support reading ID3v2 tags in ASF files

Conflicts:
	Changelog
	libavformat/asfdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 13:06:16 +01:00
Michael Niedermayer 30085bd43e Merge commit '84b721db366c0734fdfd23c8daaa7da7da21f761'
* commit '84b721db366c0734fdfd23c8daaa7da7da21f761':
  asfdec: also read Metadata Library Object

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 12:39:17 +01:00
Michael Niedermayer 3600049dae Merge commit '61f9ad2dfcb3f98b7ac5777d19d0e7b61d0be01e'
* commit '61f9ad2dfcb3f98b7ac5777d19d0e7b61d0be01e':
  asfdec: read the full Metadata Object, not just aspect ratio information

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 12:25:40 +01:00
Michael Niedermayer 0af4506e15 Merge commit '36fab50e90d15352e403e4cc210890810f2fb4e2'
* commit '36fab50e90d15352e403e4cc210890810f2fb4e2':
  asfdec: silence a warning
  mss4, ra288: Remove unused DSPContext local codec context members

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 12:14:14 +01:00
Carl Eugen Hoyos f02f231e05 Do not write invalid matroska files.
Some real codecs are supported by the matroska specification
(and FFmpeg's matroska demuxer) but not the FFmpeg muxer.
2013-02-10 10:51:12 +01:00
Nicolas George f43d09cd60 lavf: add tee pseudo-muxer. 2013-02-09 20:50:11 +01:00
Vladimir Pantelic f5fac6f777 asfdec: support reading ID3v2 tags in ASF files
Yes, these files do exist

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-02-09 18:57:21 +01:00
Vladimir Pantelic 84b721db36 asfdec: also read Metadata Library Object
In some ASF files this objects holds cover art and other tags. Compared to
Metadata Object it can also hold GUIDs, but we ignore these for now.

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-02-09 18:57:21 +01:00
Vladimir Pantelic 61f9ad2dfc asfdec: read the full Metadata Object, not just aspect ratio information
Use the same get_tag()/get_value() as for the Extended Content Description
but handle the 16 bit vs 32 bit difference for type 2 (BOOL)

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-02-09 18:57:21 +01:00
Vladimir Pantelic 36fab50e90 asfdec: silence a warning
Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-02-09 18:57:21 +01:00
Anton Khirnov 1ef0e8a6bf asfdec: do not assume every AVStream has a corresponding ASFStream
This won't be true for ID3 attached picture.

Also stop allocating now useless dummy ASFStreams for ASF native
attached pictures.
2013-02-09 18:57:21 +01:00
Stefano Sabatini 765dbea9fe lavf/rawvideodec: fix/extend option descriptions 2013-02-09 14:57:10 +01:00
rogerdpack aa715cdcf5 dshow: attempt to build shared as well as static
Signed-off-by: rogerdpack <rogerpack2005@gmail.com>
2013-02-06 23:37:46 -07:00
Michael Niedermayer 47335126c0 ff_end_tag: assert that the start is aligned.
If its start is not aligned then aligning its end will
likely break many demuxers as they check the size and not
the position.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-08 12:51:52 +01:00
Paul B Mahol 810cd0dd9c riff: chunks must be at 2 byte boundary
Fixes #2244.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-02-08 10:40:41 +00:00
Michael Niedermayer a8e748eee5 lavf: add seek2any to allow forcing seeking to non keyframes via AVOptions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-07 21:54:41 +01:00
Michael Niedermayer 7c00d853a6 matroskadec: support seek to non keyframes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-07 21:48:48 +01:00
Michael Niedermayer 199683c898 mov: remove unused function
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-07 11:54:46 +01:00
Stefano Sabatini b3d2c6f8b9 lavf/segment: fix DTS inconsistencies with -reset_timestamps
The DTS needs to be resynched against the segment start PTS, or the
resulting DTS may result < PTS.

Reported-by: Owen Jones <riots6@gmail.com>

See thread:
Subject: [FFmpeg-user] pts/dts error using reset_timestamps while splitting a DVD
Date: Sat, 19 Jan 2013 08:58:27 +0000
2013-02-06 22:55:18 +01:00
Matthieu Bouron 59d40fc7e6 lavf/mov: skip version and flags attributes in mov_read_chan function
Fixes ticket #1764.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 22:39:40 +01:00
Michael Niedermayer 864fdfa062 framecrcenc: print all side data elements, not just the first
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 18:17:27 +01:00
Michael Niedermayer b2c4431944 framecrcenc: Also print the size of side data elements
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 18:17:03 +01:00
Vignesh Venkatasubramanian 579c4add63 Fate test to print side_data crc if present
Modified the fate test crc generator to print the side_data's
crc if side_data is present.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 17:53:47 +01:00
Michael Niedermayer fadf845973 Merge commit '48a4ffa722c0874b251de9d201babed52cef0bcb'
* commit '48a4ffa722c0874b251de9d201babed52cef0bcb':
  asf: K&R formatting cosmetics
  vc1dec: use codec_id instead of codec_tag for VC1IMAGE
  sh4: drop unused functions

Conflicts:
	libavformat/asf.c
	libavformat/asfdec.c
	libavformat/asfenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 14:25:28 +01:00
Diego Biurrun 48a4ffa722 asf: K&R formatting cosmetics 2013-02-06 09:48:51 +01:00
Stefano Sabatini a12787960e lavf/segment: extend PTS debugging log with -reset_timestamps 2013-02-06 00:40:09 +01:00
Michael Niedermayer f0eacbc760 dvenc: dont fail hard if the timecode is invalid
Instead just dont store the timecode
Fixes Ticket2187

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 22:57:35 +01:00
Michael Niedermayer a8343bfb6a riff: fix infinite loop
Fixes Ticket2241

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 18:31:27 +01:00
Carl Eugen Hoyos 90020d7f4b lavf/segment: use correct spelling and value for EXT-X-ALLOW-CACHE tag
Replace wrong "EXT-X-ALLOWCACHE" with "EXT-X-ALLOW-CACHE", and value 1/0
with YES/NO, as per spec.

Fix trac ticket #2228.

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
2013-02-03 11:17:35 +01:00
Carl Eugen Hoyos a60530e3ee Require at least three frames to autodetect loas. 2013-02-02 22:36:25 +01:00
Carl Eugen Hoyos b45a3e167f Map the interlaced flag of yuv4mpeg streams to AVCodecContext->field_order.
Fixes a part of ticket #2190.
2013-02-02 12:32:04 +01:00
Carl Eugen Hoyos 985e93a865 Do not fail for mixed interlaced / non-interlaced YUV4MPEG streams. 2013-02-02 00:01:48 +01:00
Carl Eugen Hoyos 6a50e8a190 Do not change codec in flv streams if the user has forced a codec.
Fixes ticket #2218.
2013-02-01 23:27:15 +01:00
Michael Niedermayer 911e270688 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Use proper "" quotes for local header #includes
  ppc: fmtconvert: Drop two unused variables.
  bink demuxer: set framerate.

Conflicts:
	libavcodec/kbdwin.c
	libavcodec/ppc/fmtconvert_altivec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-01 14:34:18 +01:00
Diego Biurrun 6c1a7d07eb Use proper "" quotes for local header #includes 2013-02-01 12:51:15 +01:00
Anton Khirnov 9ec8971060 bink demuxer: set framerate. 2013-02-01 12:42:17 +01:00
Anton Khirnov 1730ca2eca bink demuxer: check malloc return value 2013-02-01 12:41:38 +01:00
Allan Kristensen 4789c25d83 matroska: fixed missing S_DVBSUB subtitles 2013-02-01 01:49:04 +01:00
Michael Niedermayer 01d012ba3d Merge commit '29f1fa74225e9fdbab6d590857edbecb51cf74da'
* commit '29f1fa74225e9fdbab6d590857edbecb51cf74da':
  configure: Move newlib libc check before mingw libc check
  avisynth: Change demuxer name to avoid conflicts with AVS

Conflicts:
	configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-31 19:52:58 +01:00
Diego Biurrun 0f5b0b4178 avisynth: Change demuxer name to avoid conflicts with AVS 2013-01-31 11:19:22 +01:00
Michael Niedermayer fe6767f849 asfdec: fix integer overflow in packet_replic_size check
Fixes assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-31 03:37:43 +01:00
Paul B Mahol 0dcfccaa69 auenc: strict check for supported codec
Also check number of streams and give error message why muxing failed.
This prevents muxing unsupported codec with known and supported tag.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-30 22:17:52 +00:00
Paul B Mahol 10e4905dd9 auenc: remove put_au_header() and merge its code into au_write_header
Such level of abstraction is pointless.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-30 22:17:52 +00:00
Michael Niedermayer 033f1644b5 fixup_vorbis_headers: add missing malloc failure check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-30 20:04:14 +01:00
Paweł Hajdan, Jr 0451ff295a oggparsevorbis: use av_realloc consistently
Memory passed to av_realloc cannot be allocated using memalign.

From realloc(3):

The realloc() function changes the size of the memory block pointed to
by ptr to size bytes. (...) Unless ptr is NULL, it must have been returned
by an earlier call to malloc(), calloc() or realloc().

The issue has been found by debugallocation, a part of google-perftools:
http://code.google.com/p/gperftools/ .

Signed-off-by: Paweł Hajdan, Jr <phajdan@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-30 19:54:35 +01:00
Michael Niedermayer afb4bc3d29 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  movenc: Simplify code by using avio_wb24
  bfin: unbreak compilation

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-30 14:49:49 +01:00
Martin Storsjö 61d36761ef movenc: Simplify code by using avio_wb24
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-30 13:45:45 +02:00
Carl Eugen Hoyos 91f359292a Correctly mark non-default streams when muxing matroska.
Fixes ticket #1815.

Reviewed-by: Hendrik Leppkes
2013-01-30 10:28:53 +01:00
Michael Niedermayer 99b1b2b1c6 r3d: check that sampling rate is non negative.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-29 17:13:45 +01:00
Michael Niedermayer df92ac1852 r3d: fix division by 0 with 0 sample rate
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-29 16:57:50 +01:00
Michael Niedermayer 036b9ee1c9 oggenc: fix "oggstream may be used uninitialized in this function" warning
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-29 15:57:42 +01:00
Michael Niedermayer 3c8085dc42 Merge commit 'e6b1c3bbe7082c71ea8ee8ac83698c156c9e4838'
* commit 'e6b1c3bbe7082c71ea8ee8ac83698c156c9e4838':
  pthread: make ff_thread_release_buffer idempotent.
  mvi: set framerate

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-29 14:19:56 +01:00
Anton Khirnov 729b37149c mvi: set framerate
This container does not store timestamps and thus supports CFR only.
2013-01-29 07:31:55 +01:00
Carl Eugen Hoyos d88d0b6db6 Write forced track flag to matroska files.
Based on a patch by Daniel Pielmeier, daniel pielmeier gmail
Fixes a part of ticket #1815.
2013-01-27 23:24:52 +01:00
Clément Bœsch f2b6aabd3d lavf/srtdec: do not try to queue empty subtitle chunks.
Regression since 3af3a30.
Fixes Ticket2167.
2013-01-27 20:26:35 +09:00
Michael Niedermayer 5de286ef88 mvdec: check var_read_string() return value
Prevent null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-27 02:15:02 +01:00
Michael Niedermayer 362271d72f mvdec: Check the frame counter against the correct limit.
fixes out of array reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-27 02:11:19 +01:00
Paul B Mahol d1d159d31e lavf/gifdec: cosmetics: remove extra whitespace
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-26 09:28:57 +00:00
Paul B Mahol 254e11cc01 lavf/gifdec: fix typo
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-26 09:28:57 +00:00
Michael Niedermayer 13aca070ab gifdec: resync support
This allows decoding gifs that have junk at the begin
and also allows byte wise seeking

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-25 17:25:16 +01:00
Stefano Sabatini 1ec3324f00 lavf/img2enc: extend current options documentation 2013-01-25 00:04:23 +01:00
Stefano Sabatini 069d156454 lavf/img2dec: fix option help fields 2013-01-25 00:04:22 +01:00
Michael Niedermayer 55d66b2790 movenc: check that fps for tmcd is within encodable range.
The fps is stored as a 8 bit value thus 255 is the maximum encodable.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-24 18:59:49 +01:00
Michael Niedermayer 9362f31b55 movenc: Calculate fps for tmcd without intermediate step.
Fixes part of Ticket2045

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-24 18:57:12 +01:00
Michael Niedermayer c071b00643 mpeg12demux: Fallback to startcode for stream type identification.
Fixes Ticket2147
Fixes SageTV support

Based-on patch by Andrew Gallatin
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-24 17:10:23 +01:00
Paul B Mahol eb567a7999 eacdata: do not set sample_fmt
It is supposed to be set from lavc only.
Also this one differs from one set in decoder.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-24 15:02:44 +00:00
Paul B Mahol 7b007a7c1f flic: do not set sample_fmt
It is supposed to be set from lavc only.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-24 15:02:44 +00:00
Michael Niedermayer b4581e9394 Merge commit '4a4a7e138c92901e04db46a6b05cc6948023e5f5'
* commit '4a4a7e138c92901e04db46a6b05cc6948023e5f5':
  rtpenc_chain: Use the original AVFormatContext for getting payload type
  rtp: Make sure the output format pointer is set

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-24 14:18:30 +01:00
Michael Niedermayer 40c27504a5 Merge commit '57ed8debb9b9cc565cc6e9f98c5b5cbb9f69097c'
* commit '57ed8debb9b9cc565cc6e9f98c5b5cbb9f69097c':
  wmv2: Propagate the wmv2 idct permutation type to the dsputils context
  rtp: Make sure priv_data is set before reading it

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-24 14:15:40 +01:00
Paul B Mahol dd5689a3bd matroskadec: export codec bits_per_coded_sample
Fixes -codec copy with TTA from matroska to matroska.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-24 12:15:12 +00:00
Paul B Mahol ee8d4a4142 matroskaenc: fix -codec copy with TTA
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-24 11:59:43 +00:00
Paul B Mahol 9ddf5631e3 matroskaenc: support TTA muxing
TTA in matroska does not store any private data.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-24 11:59:43 +00:00
Martin Storsjö 4a4a7e138c rtpenc_chain: Use the original AVFormatContext for getting payload type
In ff_rtp_get_payload_type, the AVFormatContext is used for checking
whether the payload_type or rtpflags options are set. In rtpenc_chain,
the rtpctx struct is a newly initialized struct where no options have
been set yet, so no options can be fetched from there.

All muxers that internally chain rtp muxers have the "rtpflags" field
that allows passing such options on (which is how this worked before
8034130e06), so this works just as intended.

This makes it possible to produce H263 in RFC2190 format with chained
RTP muxers.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-24 11:31:36 +02:00
Martin Storsjö 932117171f rtp: Make sure the output format pointer is set
Not sure if this actually happens, but we do the same check when
checking payload_type further above in the function, so it might
be needed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-24 11:31:35 +02:00
Carl Eugen Hoyos fc50175ba2 Refuse to mux tta into matroska, the output file is broken. 2013-01-24 10:23:00 +01:00
Michael Niedermayer 69fb605ad5 mpc8: check stream count before accessing stream 1.
Fixes null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-24 02:51:51 +01:00
Carl Eugen Hoyos df39c3ce38 matroskaenc: add codec_tag lists back.
This reverts 312645e :
"Do not set codec_tag property for matroska muxers."

Also adds dummy codec_tag lists with codecs
supported in mkv but not in wav / avi.

Fixes ticket #2169.
2013-01-24 01:22:07 +01:00
Carl Eugen Hoyos f8b6d4818e Only try to auto-detect LATM in mpegts if the LOAS demuxer was configured.
This allows to decode LATM-in-mpegts without the LOAS demuxer.
2013-01-24 01:21:13 +01:00
Martin Storsjö e90820d4f8 rtp: Make sure priv_data is set before reading it
This fixes crashes with muxing H263 into RTSP.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-23 23:30:58 +02:00
Michael Niedermayer 665f2d432c hls: add missing checks for accessing avoption fields
Fixes null pointer exception and probably other things

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-23 22:22:53 +01:00
Micah Galizia d4e5d8d4c2 lavf/hls: broker HTTP options
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
2013-01-23 19:27:14 +01:00
Stefano Sabatini e319725717 lavf/segment: exit immediately in case of invalid stream specifier
Avoid duplicated confusing error message, and propagate error code from
the failing avformat_match_stream_specifier() call.
2013-01-23 18:54:53 +01:00
Stefano Sabatini bb539eb13a lavf/segment: avoid failure in case -flags +live and -segment_times/frames are specified
The conflict does not apply any longer, since the M3U8 segment target
duration is re-computed every time a new segment is added to the list.
2013-01-23 18:54:33 +01:00
Stefano Sabatini f4e4e5b841 lavf/segment: drop now pointless segment_list_close() function 2013-01-23 18:32:01 +01:00
Stefano Sabatini ca68acd7ac lavf/segment: mark #EXT-X-ENDLIST in M3U8 only at the end of stream
Should fix immediate playback termination.

In particular, should fix trac ticket #2172.
2013-01-23 18:32:01 +01:00
Xi Wang cf29f49d8a rtpenc: fix overflow checking in avc_mp4_find_startcode()
The check `start + res < start' is broken since pointer overflow is
undefined behavior in C.  Many compilers such as gcc/clang optimize
away this check.

Use `res > end - start' instead.  Also change `res' to unsigned int
to avoid signed left-shift overflow.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-23 13:51:29 +02:00
Xi Wang ecb918e5f0 rtmp: fix buffer overflows in ff_amf_tag_contents()
A negative `size' will bypass FFMIN().  In the subsequent memcpy() call,
`size' will be considered as a large positive value, leading to a buffer
overflow.

Change the type of `size' to unsigned int to avoid buffer overflow, and
simplify overflow checks accordingly. Also change a literal buffer
size to use sizeof, and limit the amount of data copied in another
memcpy call as well.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-23 13:51:28 +02:00
Xi Wang 3cff53369a rtmp: fix multiple broken overflow checks
Sanity checks like `data + size >= data_end || data + size < data' are
broken, because `data + size < data' assumes pointer overflow, which is
undefined behavior in C.  Many compilers such as gcc/clang optimize such
checks away.

Use `size < 0 || size >= data_end - data' instead.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-23 13:51:27 +02:00
Xi Wang 4e692374f7 rtmp: fix buffer overflows in ff_amf_tag_contents()
A negative `size' will bypass FFMIN().  In the subsequent memcpy() call,
`size' will be considered as a large positive value, leading to a buffer
overflow.

Change the type of `size' to unsigned int to avoid buffer overflow, and
simplify overflow checks accordingly.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-23 05:29:59 +01:00
Xi Wang 902cfe2f74 rtmp: fix multiple broken overflow checks
Sanity checks like `data + size >= data_end || data + size < data' are
broken, because `data + size < data' assumes pointer overflow, which is
undefined behavior in C.  Many compilers such as gcc/clang optimize such
checks away.

Use `size < 0 || size >= data_end - data' instead.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-23 05:28:38 +01:00
Xi Wang 2f014567cf rtpenc: fix overflow checking in avc_mp4_find_startcode()
The check `start + res < start' is broken since pointer overflow is
undefined behavior in C.  Many compilers such as gcc/clang optimize
away this check.

Use `res > end - start' instead.  Also change `res' to unsigned int
to avoid signed left-shift overflow.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-23 05:28:01 +01:00
Michael Niedermayer b89815f519 mvdec: check channel count.
Fixes division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 23:06:49 +01:00
Michael Niedermayer e6cc3c869b mvdec: minor simplification, remove av_inv_q()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 22:52:23 +01:00
Michael Niedermayer 4c9f35bb7c mvdec: use avpriv_set_pts_info() instead of directly setting tb.
Fixes division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 22:41:09 +01:00
Carl Eugen Hoyos 379d03b0c9 Fix compilation with --disable-everything --enable-demuxer=loas 2013-01-22 20:28:31 +01:00
Matthieu Bouron c114414a57 lavf/aiffenc: ID3 tags support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 20:27:05 +01:00
Stefano Sabatini 30a40d4a55 lavf/segment: provide link to HTML M3U8 draft, also fix mentioned version in docs 2013-01-22 20:25:45 +01:00
Michael Niedermayer 9774251c45 rtpenc: do not use random values for seq when bitexact is requested.
Fixes fate

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 14:40:18 +01:00
Michael Niedermayer 73b59cc1ba Merge commit '4f56e773fe8a554b8c2662650aaf799c2ece2721'
* commit '4f56e773fe8a554b8c2662650aaf799c2ece2721':
  x86: ac3: Fix HAVE_MMXEXT condition to only refer to external assembly
  rtpenc: Start the sequence numbers from a random offset

Conflicts:
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 14:27:48 +01:00
Michael Niedermayer b4a7f4d018 Merge commit '570a4a0189946c2c983da41d37fdd67fa13266e7'
* commit '570a4a0189946c2c983da41d37fdd67fa13266e7':
  avidec: use sensible error codes instead of -1

Conflicts:
	libavformat/avidec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 13:38:20 +01:00
Michael Niedermayer 0a84174f2d mov: prevent double free if the caller replaces the io context.
Fixes Ticket2148

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 05:15:47 +01:00
Martin Storsjö ab587f39b2 rtpenc: Start the sequence numbers from a random offset
Expose the current sequence number via an AVOption - this can
be used both for setting the initial sequence number, or for
querying the current number.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-22 00:25:38 +02:00
Michael Niedermayer 05340be97b img2dec: support seeking in infinitely looped stream
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 19:53:41 +01:00
Stefano Sabatini 4630dfd1eb lavf/hlsenc: append last incomplete segment when closing the output
Also introduce missing check on PTS value in case of NOPTS value.
2013-01-21 19:21:21 +01:00
Michael Niedermayer ed37a566c9 oggdec: remove unused variables
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 16:41:50 +01:00
Jindrich Makovicka 570a4a0189 avidec: use sensible error codes instead of -1
Use AVERROR_INVALIDDATA on invalid inputs, and AVERROR_EOF when no more
frames are available in an interleaved AVI.

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-01-21 16:02:40 +01:00
Michael Niedermayer 2cf9ab6555 Merge commit '8a4f26206d7914eaf2903954ce97cb7686933382'
* commit '8a4f26206d7914eaf2903954ce97cb7686933382':
  dsputil: remove butterflies_float_interleave.
  srtp: Move a variable to a local scope
  srtp: Add tests for the crypto suite with 32/80 bit HMAC

Conflicts:
	libavcodec/x86/dsputil.asm
	libavcodec/x86/dsputil_mmx.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 15:18:57 +01:00
Michael Niedermayer 248140f8a2 Merge commit '3ef6d22e1ba544ab37c73e8fc61382f13aac250f'
* commit '3ef6d22e1ba544ab37c73e8fc61382f13aac250f':
  srtp: cosmetics: Use fewer lines for the test vectors
  srtp: Don't require more input data than what actually is needed

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 15:07:07 +01:00
Michael Niedermayer bc639dbd9b Merge commit 'a2a991b2ddf951454ffceb7bcedc9db93e26c610'
* commit 'a2a991b2ddf951454ffceb7bcedc9db93e26c610':
  srtp: Improve the minimum encryption buffer size check
  srtp: Add support for a few DTLS-SRTP related crypto suites

Conflicts:
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 15:00:45 +01:00
Michael Niedermayer acc0c0190b Merge commit 'f53490cc0c809975f8238d5a9edbd26f83bd2f84'
* commit 'f53490cc0c809975f8238d5a9edbd26f83bd2f84':
  rtpdec/srtp: Handle CSRC fields being present
  rtpdec: Check the return value from av_new_packet
  ac3dec: fix non-optimal dithering of zero bit mantissas

Conflicts:
	libavcodec/ac3dec.c
	libavformat/rtpdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 14:55:48 +01:00
Michael Niedermayer 0a5da9cc14 Merge commit 'c6f1dc8e4cd967ae056698eafb891a08003c211c'
* commit 'c6f1dc8e4cd967ae056698eafb891a08003c211c':
  rtpdec: Move setting the parsing flags to the actual depacketizers
  rtpdec: Split handling of mpeg12 audio/video to a separate depacketizer

Conflicts:
	libavformat/rtpdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 14:02:01 +01:00
Michael Niedermayer 950482bf58 Merge commit '2326558d5277ec87ba6d607a01ec6acfc51c694c'
* commit '2326558d5277ec87ba6d607a01ec6acfc51c694c':
  rtpdec: Split mpegts parsing to a normal depacketizer
  rtpdec: Reorder payload handler registration alphabetically

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 13:52:42 +01:00
Michael Niedermayer c3f3c22563 Merge commit 'a717f9904227d7979473bad40c50eb40af41d01d'
* commit 'a717f9904227d7979473bad40c50eb40af41d01d':
  mpegts: Share the cleanup code between the demuxer and lavf-internal parser functions
  rtpdec_mpeg4: Return one AAC AU per AVPacket
  ppc: Include string.h for memset

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 13:45:36 +01:00
Michael Niedermayer c74d4658dc oggdec: #if 0 disabled code
Fixes CID968589
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 03:01:53 +01:00
Micah Galizia c8ea5ccd5d fix memory leak on string reassign
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fixes CID968584 and CID968585
2013-01-21 02:50:02 +01:00
Martin Storsjö c9311f3e46 srtp: Move a variable to a local scope
This simplifies the code slightly.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:17:00 +02:00
Martin Storsjö 3ef6d22e1b srtp: cosmetics: Use fewer lines for the test vectors
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:13:43 +02:00
Martin Storsjö a2a991b2dd srtp: Improve the minimum encryption buffer size check
This clarifies where the limit number comes from, and only
requires exactly as much padding space as will be needed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:13:43 +02:00
Martin Storsjö ae01e8d295 srtp: Add tests for the crypto suite with 32/80 bit HMAC
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:13:43 +02:00
Martin Storsjö b4bb1d493c srtp: Don't require more input data than what actually is needed
The theoretical minimum for a (not totally well formed) RTCP packet
is 8 bytes, so we shouldn't require 12 bytes as minimum input.

Also return AVERROR_INVALIDDATA instead of 0 if something that is
not a proper packet is given.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:13:43 +02:00
Martin Storsjö e1d0b3d875 srtp: Add support for a few DTLS-SRTP related crypto suites
The main difference to the existing suites from RFC 4568 is
that the version with a 32 bit HMAC still uses 80 bit HMAC
for RTCP packets.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:13:35 +02:00
Martin Storsjö f53490cc0c rtpdec/srtp: Handle CSRC fields being present
This is untested in practice, but follows the spec.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:10:47 +02:00
Martin Storsjö a76bc3bc44 rtpdec: Check the return value from av_new_packet
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:08:19 +02:00
Xi Wang 64b7e7dcaf cafdec: fix overflow checking in read_header()
Several compilers such as clang/icc/pathscale will optimize the check
pos + size < pos (assuming size > 0) into false, since signed integer
overflow is undefined behavior in C.  This breaks overflow checking.
Use a safe precondition check instead.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-20 21:30:34 +01:00
Michael Niedermayer 3317414fc1 wtvdec: fix integer overflow
Fixes CID968583
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-20 20:59:30 +01:00
Michael Niedermayer 7cb27d216d oggdec: Support chained streams, support replacing streams in multistream files.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Conflicts:

	Changelog
2013-01-20 17:53:51 +01:00
Martin Storsjö c6f1dc8e4c rtpdec: Move setting the parsing flags to the actual depacketizers
This gets rid of almost all the codec specific details from the
generic rtpdec code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:20:42 +02:00
Martin Storsjö a9c847c1ba rtpdec: Split handling of mpeg12 audio/video to a separate depacketizer
This also adds checking of mallocs.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:20:22 +02:00
Martin Storsjö 2326558d52 rtpdec: Split mpegts parsing to a normal depacketizer
This gets rid of a number of special cases from the common rtpdec
code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:17:17 +02:00
Martin Storsjö d5bb8cc2dd rtpdec: Reorder payload handler registration alphabetically
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:16:04 +02:00
Martin Storsjö a717f99042 mpegts: Share the cleanup code between the demuxer and lavf-internal parser functions
The lavf-internal parser functions are used when receiving
mpegts over RTP. This fixes memory leaks in this setup.

The normal mpegts demuxer close function was updated in ec7d0d2e in
2004 to fix leaks, but the parsing function used for RTP wasn't
updated and has been leaking ever since.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:14:17 +02:00
Martin Storsjö 21f5c24b80 rtpdec_mpeg4: Return one AAC AU per AVPacket
This makes the returned data valid to stream copy into other
containers as well, not only for decoding straight away.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:12:38 +02:00
Matthieu Bouron b3b456b258 lavf/id3v2: seek back to previous offset if header size is not matched
Makes ff_id3v2_read reset stream position at the end of ID3 data if the
header size is not matched (caused by an EOF for example).

Current behaviour (without the patch):
    filesize = 400
    id3 data size = 399
    file offset after ff_id3v2_read is 400 instead of 399

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-20 04:39:56 +01:00
Matthieu Bouron 61625565e4 lavf/id3v2: cosmetics: reindent
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 14:37:44 +01:00
Stefano Sabatini d00df260ca lavf/segment: do not auto-select a video stream with attached_pic disposition
In particular, fix trac ticket #2138.
2013-01-19 00:32:08 +01:00
Stefano Sabatini bbce913edf lavf/segment: move reference stream selection code to a dedicated function 2013-01-19 00:32:01 +01:00
Stefano Sabatini 1de369a632 lavf/segment: remove now unused field list_max_segment_time 2013-01-19 00:23:36 +01:00
Stefano Sabatini d4890c1068 lavf/segment: add support to segment list file entries sliding window listing
In particular, should fix trac ticket #1842.
2013-01-19 00:22:58 +01:00
Stefano Sabatini 6b7d9d5153 lavf/segment: add SegmentListEntry and use it
This patch is propedeutic to the incoming patch which adds
support to sliding window segment listing.
2013-01-19 00:14:03 +01:00
Stefano Sabatini 176b72a28c lavf/utils: provide feedback in case of invalid probe size
Log message in case the max_probe_size value in av_probe_input_buffer()
is smaller than the minimum accepted value.
2013-01-19 00:13:52 +01:00