Commit Graph

14533 Commits

Author SHA1 Message Date
addr-see-the-website@aetey.se
8e36fc0c33 RoQ encoder: support different integer framerates
Even though the most common framerate for RoQ is 30fps,
the format supports other framerates too.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-03 02:04:38 +01:00
Michael Niedermayer
1bc2fa447c avformat: use AVPROBE_SCORE_STREAM_RETRY, instead of AVPROBE_SCORE_RETRY - 1
This makes the code clearer

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-02 23:50:00 +01:00
Voyager1
9f6f4962fb avformat/utils: dvd still frames read thru libdvdnav ended up in internal lavf buffer
This is the solution we've been using in XBMC for over 2 years for dvd still frames.
The problem is that the demuxer asks for probing of the codec in the mpeg stream.
This causes lavf to read the whole menu structure into internal buffers.
After which, it won't read from input stream anymore and no events triggers.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-02 23:40:06 +01:00
Stefano Sabatini
5871ee5072 lavf: add output_ts_offset option to AVFormatContext
This option can be generally useful to set an output offset, needed when
setting an absolute index in the output.
2014-02-02 13:16:17 +01:00
Stefano Sabatini
a535d3952c lavf/avformat.h: fix typos 2014-02-02 13:11:59 +01:00
Reynaldo H. Verdejo Pinochet
95d1809981 libavformat/mtv: add test for audio magic
MTV files have the string "MP3" as audio magic on their
header. Always.

Signed-off-by: Reynaldo H. Verdejo Pinochet <r.verdejo@sisa.samsung.com>
2014-02-01 21:09:14 -08:00
Michael Niedermayer
23e48cd01f Merge commit 'c716624853339ea4b1086a3957b334829370204c'
* commit 'c716624853339ea4b1086a3957b334829370204c':
  mxf: Read field dominance flag

Conflicts:
	libavformat/mxfdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-02 05:23:59 +01:00
Michael Niedermayer
8fb67c1026 Merge commit '7d56f2fffc14ad02001ee0689bee76a759da9ede'
* commit '7d56f2fffc14ad02001ee0689bee76a759da9ede':
  mxf: Handle negative edit_rate

Conflicts:
	libavformat/mxfdec.c

See: 83cab07a4c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-02 05:07:42 +01:00
Matthieu Bouron
c716624853 mxf: Read field dominance flag
And export the information in field_order.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-02-01 16:26:44 +01:00
Luca Barbato
7d56f2fffc mxf: Handle negative edit_rate
Default to 1/25.
2014-02-01 16:25:07 +01:00
Ståle Kristoffersen
16097efb8c Auto-detect hevc in mpeg-ts.
Fixes decoding of files without PMT/PAT.

Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
2014-01-31 19:05:08 +01:00
Michael Niedermayer
13aa82bbbb avformat/flac_picture: clear padding area
aviod use of uninitialized memory

Fixes: asan_heap-oob_1487fa4_4706_cov_364534849_cover_art.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-31 17:32:32 +01:00
Michael Niedermayer
fff2953163 avformat/flac_picture: allocate buffer padding for picture
Fixes: heap array overread
Fixes: asan_heap-oob_14876d9_4706_cov_815472558_cover_art.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-31 17:22:48 +01:00
Michael Niedermayer
e53ec2fe38 Merge commit '78987a88a88b28d93d03ed6c228bcb33f178444f'
* commit '78987a88a88b28d93d03ed6c228bcb33f178444f':
  lavf: include 60 fps in guessed standard frame rates

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-31 14:58:28 +01:00
Janne Grunau
78987a88a8 lavf: include 60 fps in guessed standard frame rates
Due to what looks like an off-by-one error 60 * 12 * 1001 / 12 * 1001
is not tested as standard frame rate in avformat_find_stream_info().
2014-01-31 11:09:10 +01:00
Michael Niedermayer
c89f8f80cc avformat/hdsenc: check mkdir() return code
This also returns failure if the mkdir failure is not due to an already existing
path.

Fixed CID1135749

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-31 03:08:49 +01:00
Michael Niedermayer
72afa381b3 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avformat: utils: Refactor duplicated PRINT macro

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-29 23:40:51 +01:00
Diego Biurrun
d67cfdeb53 avformat: utils: Refactor duplicated PRINT macro 2014-01-29 17:04:35 +01:00
Carl Eugen Hoyos
cfe282ec80 Remove now unneeded Makefile dependency for the wtv muxer. 2014-01-29 09:59:45 +01:00
Michael Niedermayer
29986885ef avformat/mpegts: Continue parsing PMTs until at least 2 streams are found or 100kb are reached
This (ugly) hack fixes Ticket3348
If someone has an idea on how to fix this nicer, that would be very welcome
but the stream contains several PMTs with just one of the 2 streams at the start

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-29 05:44:03 +01:00
Michael Niedermayer
ad61419bbf avformat/mpegts: drop stray space
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-29 05:43:39 +01:00
Carl Eugen Hoyos
bf9a8d183d Support writing E-AC3 in wav. 2014-01-29 00:48:50 +01:00
Carl Eugen Hoyos
862174ec83 Move GUID-related objects to riffenc.c and riff.c.
This simplifies the following eac3-in-wav patch.
2014-01-29 00:44:59 +01:00
Mikael Finstad
5846d8a91e avformat/hls: Fix cookies and user agent with encrypted HLS streams
Session data (cookies, user-agent) is not being sent on payload requests with
encrypted HLS streams This causes services like Akamai to give a 403 forbidden
when requesting the TS files, because they expect the same cookies
and user-agent on all requests
2014-01-28 18:50:58 +01:00
Lukasz Marek
102bd64168 lavd: add avdevice_dev_to_app_control_message API
New API allows to send messages from devices to application.

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-27 15:18:17 +01:00
Lukasz Marek
7151411b9c lavd: add avdevice_app_to_dev_control_message API
New API allows to send messages from application to devices.

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-27 15:18:17 +01:00
Michael Niedermayer
896d6a7736 Merge commit '50ecf15712354a1d5b3f4dc9a57ff90ed7ee9654'
* commit '50ecf15712354a1d5b3f4dc9a57ff90ed7ee9654':
  avformat: utils: K&R formatting cosmetics

Conflicts:
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-26 23:35:38 +01:00
Diego Biurrun
50ecf15712 avformat: utils: K&R formatting cosmetics
Also adjust some comment wording / spelling and reorder header #includes.
2014-01-26 18:09:00 +01:00
James Darnley
2efdccac87 lavf/avienc: cosmetic indent
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-24 23:00:17 +01:00
James Darnley
fa20babb46 lavf/avienc: use metadata_header_padding
The muxer will write at least the number of bytes requested and possibly
up to 3 bytes more.  This is because the muxer writes 32-bit integers
and the format requires 4-byte alignment anyway.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-24 22:58:59 +01:00
James Darnley
67270ccd3a lavf/id3v2enc: update comment about minimum padding
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-24 22:52:33 +01:00
James Darnley
0de03fd6a1 lavf/id3v2enc: use metadata_header_padding
As with the change to flacenc this allows the user to control the amount
of padding they want added to the file.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-24 22:50:06 +01:00
James Darnley
c14b011a97 lavf/flacenc: fix comment after previous change
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-24 22:41:06 +01:00
James Darnley
72eeb18468 lavf/flacenc: use metadata_header_padding
Allows a user to control the amount, if any, of padding they want added
to the file.  If set to zero the block will not be written at all.  If
set to some positive number four more bytes will be added to the file
due to the small header required for the block.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-24 22:40:23 +01:00
James Darnley
86bee7984e AVFormatContext: add metadata_header_padding field
This field is used to store the number of bytes that should be written
as padding to a metadata header of a file.  For example:
 - The FLAC format's METADATA_BLOCK_PADDING [1]
 - The ID3v2 tag format's padding           [2]

[1] http://xiph.org/flac/format.html#metadata_block_padding
[2] http://id3.org/id3v2.3.0#ID3v2_overview

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-24 22:33:21 +01:00
Serhii Marchuk
1d07385053 mpegts demuxer: store PMT values of DVB teletext to extradata
* Using extradata by TS demuxer to store values from PMT
* Support of multiple languages in one DVB teletext stream:
  comma separated language codes in metadata "language" field

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-24 22:14:01 +01:00
Serhii Marchuk
2ebee19e1e mpegts muxer: restore PMT table of DVB teletext from extradata
* Using extradata by TS muxer to correctly restore PMT table
* PES_header_data_length should be always 0x24 for DVB teletext,
  according to DVB standard

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-24 22:07:40 +01:00
Serhii Marchuk
f8051bd31a mpegts muxer: Change the default subtitle language to "und"
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-24 22:01:37 +01:00
Michael Niedermayer
4b8c599e84 avformat/nutenc: fix missing break in switch
Fixes CID1163848
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-24 04:17:15 +01:00
Reynaldo H. Verdejo Pinochet
4d888a0ad8 libavformat/mtv: add missing MTV_ prefix to macro
Signed-off-by: Reynaldo H. Verdejo Pinochet <r.verdejo@sisa.samsung.com>
2014-01-23 17:40:58 -03:00
Reynaldo H. Verdejo Pinochet
ba15aab4a4 libavformat/mtv: make clear we assume bpp is always 16
All samples in the wild are RGB565/555 and we are already
acting on this assumption when pushing out the video frames,
so if we get anything != than 16 for bpp we just override
this value for doing any calculations making our approach
consistent.

Also avoid repeatedly shifting bpp.

Signed-off-by: Reynaldo H. Verdejo Pinochet <r.verdejo@sisa.samsung.com>
2014-01-23 17:40:58 -03:00
Reynaldo H. Verdejo Pinochet
d467e7df1a libavformat/mtv: donwgrade probe score for < 512
MTV has a 512 bytes header. We should be able to
parse required fiels from the first 57 (rest is
padding) but if we haven't seen enough data then
go with SCORE_EXTENSION.

Signed-off-by: Reynaldo H. Verdejo Pinochet <r.verdejo@sisa.samsung.com>
2014-01-23 17:40:58 -03:00
Reynaldo H. Verdejo Pinochet
30f4c58f6f libavformat/mtv: Check for min header size first
Abort immediately if we are not getting enough
data to extract the required fields.

Signed-off-by: Reynaldo H. Verdejo Pinochet <r.verdejo@sisa.samsung.com>
2014-01-23 17:40:58 -03:00
Michael Niedermayer
c1333a762c Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtpdec_asf: Copy the need_parsing field from the chained demuxer

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-23 20:15:21 +01:00
Martin Storsjö
2aec9e228c rtpdec_asf: Copy the need_parsing field from the chained demuxer
This fixes playback of mp3 streams in rtp/asf. This used to work
until c6f1dc8, but mostly by coincidence.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-23 17:37:10 +02:00
Michael Niedermayer
8456bd2c0f avformat/matroskaenc: wrap V_QUICKTIME codec private in something that looks like its part of quicktime stsd
This is needed for matroska spec compliance
Fixes playback of SVQ3 in matroska with vlc
Fixes Ticket 3256

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-23 14:49:50 +01:00
Eli Kara
da25a6573f avformat/http: Properly handle cookies that specify sub-domain where the URL.
Fixes ticket #3336

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-23 14:39:36 +01:00
Matt Oliver
306e1ac012 avformat/tls: Fix windows build with openSSL enabled.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-23 14:33:56 +01:00
Michael Niedermayer
94a52417cb Merge remote-tracking branch 'lukaszmluki/master'
* lukaszmluki/master:
  lavf/ftp: remove double space
  lavf/libssh: fix seek with whence==SEEK_CUR
  lavf/libssh: rename context variable from s into libssh
  lavf/libssh: add av_cold attributes
  lavf/libssh: factorize create_sftp_session function
  lavf/libssh: factorize create_ssh_session function
  lavf/libssh: factorize file_stat function
  lavf/libssh: factorize open_file function
  lavf/libssh: add private_key option

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-22 01:12:23 +01:00
Lukasz Marek
9ef441c525 lavf/ftp: remove double space
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-22 00:41:13 +01:00
Lukasz Marek
e0d124a920 lavf/libssh: fix seek with whence==SEEK_CUR
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-22 00:41:13 +01:00
Lukasz Marek
b271aac536 lavf/libssh: rename context variable from s into libssh
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-22 00:41:13 +01:00
Lukasz Marek
522814455c lavf/libssh: add av_cold attributes
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-22 00:41:13 +01:00
Lukasz Marek
7fb5f55e1e lavf/libssh: factorize create_sftp_session function
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-22 00:41:13 +01:00
Lukasz Marek
77fadab1be lavf/libssh: factorize create_ssh_session function
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-22 00:41:13 +01:00
Lukasz Marek
bf5d73b04d lavf/libssh: factorize file_stat function
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-22 00:41:13 +01:00
Lukasz Marek
8d3f14e11b lavf/libssh: factorize open_file function
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-22 00:41:13 +01:00
Lukasz Marek
7e8f304846 lavf/libssh: add private_key option
Allows to specify private key to use during authorization.

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-22 00:41:13 +01:00
Michael Niedermayer
28bc1d94b7 avformat/mov: redesign the fps calculation
This uses STTS and TRUN information to calculate the fps
It seems to work with more files than the previous code

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-22 00:33:38 +01:00
Stefano Sabatini
f57baf743f lavf/segment: drop pointless variable oc from seg_write_packet() 2014-01-21 20:08:36 +01:00
Stefano Sabatini
169065fbfb lavf/segment: remove duplicated and inconsistent cleanup code in seg_write_packet()
In particular, avoid to leave around the seg->avf pointer to freed
structure, and fix crash with:
ffmpeg -f lavfi -i testsrc -c:v h264 -map 0 -f segment foo-%d.ts
2014-01-21 20:08:36 +01:00
Stefano Sabatini
a2e78161ce lavf/mpegtsenc: fix weird indent 2014-01-21 20:08:36 +01:00
Michael Niedermayer
8e5e84c2a2 avformat/mov: Ignore the last frame for duration and fps calculation if it looks suspect
The used heuristic will potentially need to be finetuned
Fixes daemon404s fps.mov

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-21 19:48:05 +01:00
Michael Niedermayer
1c7d287044 Merge commit '89564be444d24f75ea5add8b6987e414cf7aa7d5'
* commit '89564be444d24f75ea5add8b6987e414cf7aa7d5':
  rtmpproto: Send a full, absolute timestamp if it isn't monotonically growing

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-21 04:20:50 +01:00
Michael Niedermayer
ca9d7c57f4 Merge commit '24eb3c791606fe98a1591c13a8b2ba6c342bb3b5'
* commit '24eb3c791606fe98a1591c13a8b2ba6c342bb3b5':
  rtmpproto: Avoid using uninitialized memory

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-21 04:13:57 +01:00
Martin Storsjö
89564be444 rtmpproto: Send a full, absolute timestamp if it isn't monotonically growing
The normal differential timestamps can't handle negative
differences, thus send a full packet header with an absolute
timestamp in these cases.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-20 21:57:02 +02:00
Martin Storsjö
24eb3c7916 rtmpproto: Avoid using uninitialized memory
If the url ends with .flv, we stripped it but didn't initialize
rt->playpath, doing av_strlcat on an uninitialized buffer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-20 21:56:57 +02:00
Justin Ruggles
d01e684186 mov: do not set avg_frame_rate in the demuxer
The track duration is often not reliable or is not the duration
represented by the number of frames. In those cases, avg_frame_rate
was reported incorrectly. Removing this code falls back to the
default calculation in avformat_find_stream_info().

This is a partial revert of commit c3aeaa540.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-01-20 19:15:36 +00:00
Carl Eugen Hoyos
b7702fafb3 Avoid a possible overflow when reading Nikon avi files.
Suggested-by: Reimar
2014-01-20 11:40:35 +01:00
Carl Eugen Hoyos
f9c2d4d17e Allow decoding of slightly broken Nikon avi files.
Fixes ticket #3330.
2014-01-20 01:44:07 +01:00
wm4
1a193c438c lavf: add avformat_get_mov_video_tags() and avformat_get_mov_audio_tags()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-19 22:15:32 +01:00
Michael Niedermayer
9d13432a90 avformat/matroskadec: identify SMI as SVQ3
Fixes part of Ticket3256

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-19 20:13:38 +01:00
Michael Niedermayer
48218580e1 avformat/matroskadec: support QDM2 as generated by mkvtoolnix-6.7.0
Fixes part of Ticket3256

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-19 18:48:49 +01:00
Michael Niedermayer
5800b08572 avformat/matroskadec: support SVQ3 as generated by mkvtoolnix-6.6.0
Fixes part of Ticket3256

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-19 18:48:11 +01:00
Michael Niedermayer
ed7f1a5c20 avformat/metadata: allow ff_metadata_conv() to be called with NULL saftely
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-17 23:09:52 +01:00
Michael Niedermayer
ee27b11306 avformat/riff: fix demuxing of h264 INMC
Its said that there was a mpeg4 sample with the same fourcc, but noone has it
if someone finds it please tell me so i can fix detection of both.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-17 17:58:36 +01:00
Michael Niedermayer
6e2d3ba0ee Merge commit '5ef11b8dcc054b230deb9b20493255c14a80597d'
* commit '5ef11b8dcc054b230deb9b20493255c14a80597d':
  yuv4mpeg: set average frame rate

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-17 16:18:40 +01:00
Michael Niedermayer
58770db2ae Merge commit '33018907bd07b34e0e70d5ae12097265eb3734d7'
* commit '33018907bd07b34e0e70d5ae12097265eb3734d7':
  mp3enc: allow omitting the id3v2 header with -id3v2_version 0

Conflicts:
	doc/muxers.texi
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-17 15:34:24 +01:00
Michael Niedermayer
5049b6a1fe Merge commit 'f9cc6883a4e5cf72cbfa21d17e1908a2a432f6bd'
* commit 'f9cc6883a4e5cf72cbfa21d17e1908a2a432f6bd':
  mp3enc: add an option for disabling the Xing frame.

Conflicts:
	doc/muxers.texi
	libavformat/mp3enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-17 15:23:11 +01:00
Michael Niedermayer
c9db8694a8 avisynth: fix setting packet properties
Reviewed-by: Stephen Hutchinson <qyot27@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-17 11:11:08 +01:00
Anton Khirnov
5ef11b8dcc yuv4mpeg: set average frame rate 2014-01-17 10:30:45 +01:00
Anton Khirnov
33018907bd mp3enc: allow omitting the id3v2 header with -id3v2_version 0 2014-01-17 10:30:45 +01:00
Anton Khirnov
f9cc6883a4 mp3enc: add an option for disabling the Xing frame. 2014-01-17 10:30:45 +01:00
Carl Eugen Hoyos
fe9f575924 Warn if s16be is muxed into flv.
Players that conform to the specification can only playback such
files correctly on big-endian hardware.
2014-01-16 00:38:27 +01:00
Carl Eugen Hoyos
cb36e441de Never favour an audio stream with 0 channels in av_find_best_stream().
Fixes ticket #3311.
2014-01-16 00:36:27 +01:00
Carl Eugen Hoyos
1132937077 Do not read mkv audio bit_depth if bits_per_coded_sample is already set.
This allows decoding broken mkv files containing G.726 audio.
2014-01-15 23:37:47 +01:00
Carl Eugen Hoyos
565102dcac Do not set mkv bit_depth to av_get_bytes_per_sample() for G.726.
The value is wrong and leads to broken files.
2014-01-15 23:35:22 +01:00
Michael Niedermayer
b948ab8132 avformat/jvdec: clear packet padding after downsize
Fixes: use of uninitialized memeory
Fixes: msan_uninit-mem_7fbf26b5fefe_5981_intro.jv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-15 23:13:03 +01:00
Michael Niedermayer
fd334b9b6e avformat/mxfdec: fix typo in error check of mxf_edit_unit_absolute_offset()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-15 18:01:26 +01:00
Michael Niedermayer
fb37d03a87 Merge commit '2620df13104ddaa136158eb6bb1195adbf9d7692'
* commit '2620df13104ddaa136158eb6bb1195adbf9d7692':
  mov: Free an earlier allocated array if allocating a new one

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-15 14:13:17 +01:00
Michael Niedermayer
04cc753d07 Merge commit 'd51f09962d5b4bc999fb70c040f330dd1873212e'
* commit 'd51f09962d5b4bc999fb70c040f330dd1873212e':
  mov: Free intermediate arrays in the normal cleanup function

Conflicts:
	libavformat/mov.c

See: a6b3e6d0b4
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-15 14:06:27 +01:00
Martin Storsjö
2620df1310 mov: Free an earlier allocated array if allocating a new one
It could probably also be considered an error if the pointer isn't
null at this point, but then we might risk rejecting some
slightly broken files that we might have handled so far.

Sample-Id: 00000496-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-15 09:57:38 +02:00
Martin Storsjö
d51f09962d mov: Free intermediate arrays in the normal cleanup function
These arrays are normally freed at the end of mov_read_trak,
but make sure they're freed in case mov_read_trak returned
early (due to errors) or in case the atoms that allocate arrays
are encountered at some other point than within a trak (which
we don't have checks against).

Sample-Id: 00000496-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-15 09:57:26 +02:00
Michael Niedermayer
e3c0fcadda Merge commit '1a4e4ad0e0c5486dcab05e54b587672a498dd7cf'
* commit '1a4e4ad0e0c5486dcab05e54b587672a498dd7cf':
  mxf: Use av_malloc_array

Conflicts:
	libavformat/mxfdec.c

See: 8ce41721a4
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 22:20:52 +01:00
Michael Niedermayer
d938a013af Merge commit 'aa0cb16c15a5b30f78542f18e3fa65de005cf084'
* commit 'aa0cb16c15a5b30f78542f18e3fa65de005cf084':
  mxf: Fix off by one error in d10 aes3 decoding

Conflicts:
	libavformat/mxfdec.c

See: 3be02afb56
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 21:54:11 +01:00
Michael Niedermayer
1171ad647e Merge commit '42f9132218ca11a8e9a3c82a175b46bca092113e'
* commit '42f9132218ca11a8e9a3c82a175b46bca092113e':
  mxf: Do not use int to check the seek position

Conflicts:
	libavformat/mxfdec.c

See: 007989c7a2
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 21:37:42 +01:00
Michael Niedermayer
b2ae92110f avcodec/flashsv: check avio_read() return in mov_read_udta_string()
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f3f90a8606a_3018_Sequence_1-Apple_ProRes_422_LT.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 18:35:14 +01:00
Tomas Härdin
cc1e3ace63 mxf: Fix potential leak in mxf_read_local_tags()
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-14 18:23:00 +01:00
Luca Barbato
1a4e4ad0e0 mxf: Use av_malloc_array 2014-01-14 18:13:29 +01:00
Tomas Härdin
8b708f1c6b mxf: Correctly support files from Pinnacle Thunder
Such files have IndexTableSegments which when parsed cover EditUnit
ranges like this:

 [0,1)
 [249,250)
 [249,377)
 [0,249)

where each interval is

 [IndexStartPosition, IndexStartPosition + IndexDuration)

This would be reduced to a sparse index like:

 [0,1), [249,250)

instead of the full range:

 [0,249), [249,377)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-14 18:13:29 +01:00
Luca Barbato
f5fbbbc022 mxf: Drop unnecessary checks
av_reallocp_array does the check already.
2014-01-14 18:13:29 +01:00
Michael Niedermayer
0d6605c7ef mxf: Fix a possible leak of extradata
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-14 18:13:29 +01:00
Marton Balint
aa0cb16c15 mxf: Fix off by one error in d10 aes3 decoding
Without this fix the last sample was missing from the packet.
2014-01-14 18:13:22 +01:00
Luca Barbato
42f9132218 mxf: Do not use int to check the seek position
Overly large files are to be expected.

Reported-by: Jean-Baptiste Kempf <jb@videolan.org>
2014-01-14 17:29:03 +01:00
Reimar Döffinger
d84bd4650b mxf: Set AV_FIELD_PROGRESSIVE
Needed for AVC-intra

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-14 17:28:48 +01:00
Andrey Myznikov
b79bccba80 avformat/librtmp: Fix memory leak if RTMP_ConnectStream() fails
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 01:59:23 +01:00
Michael Niedermayer
05c78f345b avformat/utils: av_probe_input_buffer2 decrease difference to libav
This removes the initialization of 2 unused fields
The change was part of c1868e7ee7
but wasnt merged as the fields could still be used

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 01:59:11 +01:00
Michael Niedermayer
05886c9d4e avformat/utils/av_probe_input_buffer2: fix buffer passed to ffio_rewind_with_probe_data()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 22:24:30 +01:00
Michael Niedermayer
8c3b026a0e avformat/utils/av_probe_input_buffer2: fix offset check
The check could fail if avio_read() read less than requested

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 22:23:40 +01:00
Michael Niedermayer
6a2064820b avformat/utils/av_probe_input_buffer2: Fix pd.buf_size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 22:14:02 +01:00
Michael Niedermayer
220f0927b8 Merge commit '8b76362836f3c373c3aadc544522edcbef16dd5f'
* commit '8b76362836f3c373c3aadc544522edcbef16dd5f':
  lavf: use a fixed width type

Conflicts:
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 21:34:42 +01:00
Anton Khirnov
2115a35974 lavf: make av_probe_input_buffer more robust
Always use the actually read size as the offset instead of making
possibly invalid assumptions.

Addresses: CVE-2012-6618
2014-01-13 15:00:09 +01:00
Anton Khirnov
8b76362836 lavf: use a fixed width type
It's shorter and more consistent with the rest of the code.
2014-01-13 15:00:09 +01:00
Anton Khirnov
c1868e7ee7 lavf: simplify handling of offset in av_probe_input_buuffer() 2014-01-13 15:00:09 +01:00
Serhii Marchuk
c917cde9cc mpegts muxer, DVB subtitles encoder: common DVB subtitles payload
Improved DVB subtitles encoder to generate AVPacket.data in the same
format as generates MPEGTS demuxer + DVB subtitles parser. So now single
format of DVB subtitles data is used across all the components of FFmpeg:
only subtitles payload WITHOUT 0x20 0x00 bytes at the beginning and 0xFF
trailing byte.

Improved MPEGTS muxer to support format of DVB subtitles in
AVPacket.data described above: while muxing we add two bytes 0x20 0x00 to
the beginning of and 0xFF to the end of DVB subtitles payload.

The patch fixes DVB subtitle copy problems: tickets #2989 fully and #2024
partly.

Signed-off-by: Clément Bœsch <u@pkh.me>
2014-01-12 16:40:52 +01:00
Michael Niedermayer
419787a2ff Merge remote-tracking branch 'qatar/master'
* qatar/master:
  flv: Workaround for buggy Omnia A/XE encoder

Conflicts:
	libavformat/flvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-11 20:56:29 +01:00
Benjamin Larsson
547f834537 flv: Workaround for buggy Omnia A/XE encoder
The Omnia A/XE encoder writes the explicit extra data incorrectly
and wrongly disables parametric stereo. Truncating the extra data
by setting the size to 2 works around this. The AAC extra data
parser will then only parse the correct parts.

Bug-id: 599
2014-01-11 13:14:20 +01:00
Clément Bœsch
b84a7330af avformat/pjsdec: dont increase pointer when its already at the end in read_ts()
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f91f2de7764_2649_PJS_capability_tester.pjs
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-11 02:28:17 +01:00
Michael Niedermayer
a1ed1c2193 avformat/matroskadec: check generic audio deinterleaver sub_packet_size against frame_size
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f67d052a530_7517_nosound.mkv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-10 23:45:43 +01:00
Michael Niedermayer
396ddcf22d avformat/flvdec: initialize context before reading from it
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f9b8387069e_5377_flv_with_pcm_s16be_audio_track.flv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-10 20:59:25 +01:00
Michael Niedermayer
e2bb185e62 nut: Support XYZ12 rawvideo
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-10 17:51:13 +01:00
Michael Niedermayer
4cb9c20136 avformat/avisynth simplify packet allocation
Reviewed-by: Stephen Hutchinson <qyot27@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-10 15:38:59 +01:00
Michael Niedermayer
3b8299c1e1 Merge commit 'aa69cbc9e08281db6ecb98a2c8b4f60e8b12e558'
* commit 'aa69cbc9e08281db6ecb98a2c8b4f60e8b12e558':
  flac muxer: add option to disable writing the global header

Conflicts:
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-10 02:32:12 +01:00
Michael Niedermayer
4162ceea93 avformat/mxfdec: check avio_read(UID) result
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fc9ba2fd98e_82_02785736.mxf
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-10 02:12:30 +01:00
Michael Niedermayer
7f9697aa11 avformat/nutdec: fix packet end clearing
The code was buggy, using the wrong variable, also it missed the case
where the packet become smaller due to sidedata/metadata being extracted
which left a few bytes uninitialized

Fixes use of uninitialized memory
Fixed: msan_uninit-mem_7f6abbe44530_6838_mewmew_vorbis_ssa.nut
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-10 00:34:15 +01:00
Michael Niedermayer
77d2a1ca59 avformat/rmdec: when reading audio blocks, dont leave holes when reading fails
The fate test is changed because the reference file depends on the use of
non cleared data at the very
end. Alternatively we could upload a new reference file, though that would
then have to be changed every time the handling of a truncated frame changes
or theres a change to error concealment, each time adding a new file ...

Fixes use of uninitialized memory
Fixed: msan_uninit-mem_7f3c02b81363_2787_RLG2_19.rm
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-09 23:50:59 +01:00
Justin Ruggles
aa69cbc9e0 flac muxer: add option to disable writing the global header
The global header is not explicitly required for playback, and
omitting it allows for simple concatenation.
2014-01-09 16:09:41 -05:00
Maxim Polijakowski
e6f0bb6527 ATRAC3+ decoder
Cleanup by Diego Biurrun.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2014-01-09 19:33:07 +01:00
rogerdpack
2be1e1b223 avformat/udp: debug log udp socket size
Signed-off-by: rogerdpack <rogerpack2005@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 23:56:05 +01:00
Stephen Hutchinson
16ae337bd8 avisynth: Use av_packet_from_data instead of av_new_packet
If the audio changes from 9eac7c4 were merged as they were, this
would cause scripts with both video+audio to fail with a lot of
audio decoding errors (the video would be fine). Scripts with
only one of either video or audio were unaffected. Additionally,
the av_packet changes in general caused seeking to break.

Using av_packet_from_data allows video+audio scripts to work as
expected, without audio decoding errors.  It also fixes seeking.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 12:54:27 +01:00
Anton Khirnov
02dd178d9d avisynth: More av_new_packet changes
These are the remaining av_packet-related bits from 9eac7c4
that didn't get merged at that time.

Changes authored by Anton Khirnov <anton@khirnov.net>, split out
from 9eac7c4 by Stephen Hutchinson <qyot27@gmail.com>

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 12:54:22 +01:00
Michael Niedermayer
1c010fd035 avformat/mxfdec: detect loops during header parsing
The header parser uses forward and backward parsing, making the
bulletproof prevention of loops difficult, thus this simple
detection code.
If someone improves the forward/backward parsing so it cannot loop
then this commit should be reverted

Fixes Ticket3278

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 04:55:42 +01:00
Carl Eugen Hoyos
94cf4f8bac Use the h264 parser when decoding VSSH in avi.
Fixes ticket #3261 visually.

Analyzed-by: Michael Doilnitsyn
2014-01-07 22:49:05 +01:00
Michael Niedermayer
243b9fea90 avformat/takdec: zero padding area before use
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fcecee73d71_6470_luckynight-partial.tak
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 19:48:13 +01:00
Michael Niedermayer
2303b45112 avformat/segafilm: drop song and dance, this seems not to do anything anymore since a long time
Fixes use of uninitialized memory
Partly fixes; msan_uninit-mem_7fb7d24780d0_2744_R03T.CAK
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 15:02:31 +01:00
Michael Niedermayer
77274d5c79 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  network.h: Add #endif comments to improve readability

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 13:16:55 +01:00
Michael Niedermayer
b0517467c0 avformat/webvttdec: Dont skip over a never checked byte after -->
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f49667d83db_3396_WebVTT_capability_tester.vtt
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 04:09:19 +01:00
Michael Niedermayer
ed1eb9602c avformat/rmdec: check that sub_packet_size fit in the packet for DEINT_ID_GENR
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fa8c49400d0_3923_audiosig.rm
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 00:26:33 +01:00
Michael Niedermayer
71fe97a60a avformat/nutdec: check avio_read() return code
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f2785ab8669_6838_mewmew_vorbis_ssa.nut
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 00:26:33 +01:00
Diego Biurrun
9997cee04d network.h: Add #endif comments to improve readability 2014-01-06 21:16:54 +01:00
Michael Niedermayer
2a58d5fc0e Merge commit '6892d145a0c80249bd61ee7dd31ec851c5076bcd'
* commit '6892d145a0c80249bd61ee7dd31ec851c5076bcd':
  segafilm: fix leaks if reading the header fails

Conflicts:
	libavformat/segafilm.c

See: ca5456db7f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-06 17:13:09 +01:00
Michael Niedermayer
76c63bc5d8 Merge commit '3867f3718ba82ff11d3e24c6d84beb520d0b174f'
* commit '3867f3718ba82ff11d3e24c6d84beb520d0b174f':
  lavf: remove a pointless check

Conflicts:
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-06 15:34:45 +01:00
Michael Niedermayer
59725592a9 Merge commit '75647dea6f7db79b409bad66a119f5c73da730f3'
* commit '75647dea6f7db79b409bad66a119f5c73da730f3':
  oggparseogm: check timing variables

See: 9ed388f598
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-06 15:28:24 +01:00
Anton Khirnov
6892d145a0 segafilm: fix leaks if reading the header fails
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-06 08:26:09 +01:00
Anton Khirnov
3867f3718b lavf: remove a pointless check
AVStream.codec is always non-NULL
2014-01-06 08:21:53 +01:00
Anton Khirnov
75647dea6f oggparseogm: check timing variables
Fixes a potential divide by zero.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-06 08:21:38 +01:00
Michael Niedermayer
d04aceb7d0 avformat/nutdec: remove unused variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 17:27:23 +01:00
Peter Ross
f5f6e59495 avformat/matroskaenc: warn when muxing video codec not supported by format
This occurs for video codecs that have codec_tag set, but are are not listed
in ff_codec_bmp_tags (e.g. AV_CODEC_ID_BINKAUDIO, AV_CODEC_ID_IFF_ILBM).

Fixes ticket #3269.

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 04:33:24 +01:00
Michael Niedermayer
70937d9708 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  sdp: Check that fmt->oformat is non-null before accessing it

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 02:38:57 +01:00
Michael Niedermayer
7546ac2fee avformat/mp3dec: fix start time in light of initial skip samples
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 01:05:16 +01:00