summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* mov: Don't allocate arrays with av_malloc that will be reallocedMartin Storsjö2013-10-05
| | | | | CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmpproto: Validate the embedded flv packet size before copyingMartin Storsjö2013-10-04
| | | | | | | | | | This wasn't an issue prior to 58404738, when the whole RTMP packet was copied at once and the length of the individual embedded flv packets only were validated by the flv demuxer. Prior to this patch, this could lead to reads and writes out of bound. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmpproto: Readjust the end of the flv buffer if handle_metadata exited earlyMartin Storsjö2013-10-04
| | | | | | | | If the embedded flv packets were incomplete and we aborted the copying loop early, make sure the flv buffer is trimmed to only contain full packets. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmpproto: Move the flv header/trailer addition to append_flv_dataMartin Storsjö2013-10-04
| | | | | | | | | | | | | | | | | update_offset is also called from handle_metadata, where the packet header sizes is already included in the size. Previously this lead to flv_data/flv_size including 15 uninitialized bytes at the end after each call to handle_metadata, making the flv demuxer lose sync with the stream. Also remove leftover copying in handle_metadata. This is a leftover from the refactoring in 5840473. (Previously this final mempcy was the one that copied all the packets at once, while this is done within the loop right now.) After making sure flv_size is set to the right size, this write was out of bounds. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmpproto: Clear the flv allocation size on reallocp failuresMartin Storsjö2013-10-04
| | | | | | | This was overlooked in d872fb0f7 since I assumed all the realloc issues in the rtmp code was fixed already. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmpproto: Pass the 'live' parameter in the right unitMartin Storsjö2013-10-04
| | | | | | | | | | | The current magic numbers passed are values in seconds, while the parameter itself should be passed over the wire in milliseconds. This makes (some/all?) live streams from Red5 work correctly, that previously returned StreamNotFound even with "-rtmp_live live". After this commit, the default 'any' also works on these streams. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmpproto: Print the error code string if there's no descriptionMartin Storsjö2013-10-04
| | | | | | | | | | On (certain streams/setups at least on) Red5, the description string actually is present, but empty. Therefore, first try loading the description, but if not found or empty, load the code string instead. The code string is quite understandable in most cases anyway (like "NetStream.Play.StreamNotFound"). Signed-off-by: Martin Storsjö <martin@martin.st>
* oggparsevorbis: K&R formatting cosmeticsVittorio Giovara2013-10-03
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* avformat/output-example: Declare link dependency on libswscale in the MakefileDiego Biurrun2013-10-03
|
* rtmp: alias rtmp_listen to listenLuca Barbato2013-10-01
| | | | Make it uniform with the other protocols.
* mxf: Remove a typoLuca Barbato2013-10-01
| | | | Introduced in 93370d1216
* asfdec: Check the return value of asf_read_stream_propertiesMartin Storsjö2013-09-30
| | | | | | | | | | This makes sure errors in setting stream parameters are passed on to the caller. This avoids successfully opening files while some parameters aren't filled in properly. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* omadec: fix bitrate for ATRAC3+ streamsMaxim Poliakovski2013-09-29
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* Add support for multichannel ATRAC3+ streams.Maxim Poliakovski2013-09-29
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* mxfdec: set audio timebase to 1/samplerateAnton Khirnov2013-09-29
| | | | | | | | Fixes sync in some samples (e.g. bugs 7581 and 8374 in VLC). Based on a commit by Matthieu Bouron <matthieu.bouron@gmail.com> Reported-by: Jean-Baptiste Kempf <jb@videolan.org> CC: libav-stable@libav.org
* mov: Make sure the read sample count is nonnegativeMartin Storsjö2013-09-29
| | | | | | | | | This avoids setting a negative number of frames, ending up with a negative average frame rate. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* bfi: Add some very basic sanity checks for input packet sizesMartin Storsjö2013-09-29
| | | | | CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* bfi: Avoid divisions by zeroMartin Storsjö2013-09-29
| | | | | | | | | If a zero-length video packet is to be returned, just return AVERROR(EAGAIN) and switch back to the audio stream. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* electronicarts: Add more sanity checking for the number of channelsMartin Storsjö2013-09-29
| | | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* riffdec: Add sanity checks for the sample rateMartin Storsjö2013-09-29
| | | | | | | | This avoids a division by zero for G726. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* mvi: Add sanity checking for the audio frame sizeMartin Storsjö2013-09-29
| | | | | | | | This avoids a division by zero. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* xwma: Avoid division by zeroMartin Storsjö2013-09-29
| | | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* avidec: Make sure a packet is large enough before reading its dataMartin Storsjö2013-09-29
| | | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* vqf: Make sure the bitrate is in the valid rangeMartin Storsjö2013-09-29
| | | | | | | | Even if the sample rate is valid, an invalid bitrate could pass the mode combination test below. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* vqf: Make sure sample_rate is set to a valid valueMartin Storsjö2013-09-29
| | | | | | | | | | This avoids divisions by zero later (and possibly assertions in time base scaling), since an invalid rate_flag combined with an invalid bitrate below could pass the mode combination test. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* lxf: check the nb_streams instead of relying on paddingLuca Barbato2013-09-27
| | | | | | | Remove the now unneeded stream pointer while at it. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
* lxf: remove deplanarization hackPaul B Mahol2013-09-27
| | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org> Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
* pcm: support 24-bit/32-bit little-endian planarPaul B Mahol2013-09-27
| | | | | | Used by LXF. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* lxf: Support 16-channel filesCarl Eugen Hoyos2013-09-27
| | | | | | Reported, analyzed and tested by Gabriel Gerard. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* lxf: Support version 1 filesReimar Döffinger2013-09-27
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* lavf: Reset the entry count and allocation size variables on av_reallocp ↵Martin Storsjö2013-09-26
| | | | | | | | | | | | | | failures When av_reallocp fails, the associated variables that keep track of the number of elements in the array (and in some cases, the separate number of allocated elements) need to be reset. Not all of these might technically be needed, but it's better to reset them if in doubt, to make sure variables don't end up conflicting. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Allocate arrays with av_realloc if they will be realloced laterMartin Storsjö2013-09-26
| | | | | | | Pointers returned from av_malloc can't in general be passed to av_realloc. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec_qt: Add an accidentally removed allocation return value checkMartin Storsjö2013-09-26
| | | | | | This check was mistakenly removed in 5626f994f. Signed-off-by: Martin Storsjö <martin@martin.st>
* tls: Add support for listen modeMartin Storsjö2013-09-26
| | | | | | | | | Also add options for specifying a certificate and key, which can be used both when operating as client and as server. Partially based on a patch by Peter Ross. Signed-off-by: Martin Storsjö <martin@martin.st>
* http: Pass options through to the nested protocolMartin Storsjö2013-09-26
| | | | | | | | When passing a dict to the nested protocol, it will consume the used options from it, so a separate copy needs to be used when reopening the connection multiple times. Signed-off-by: Martin Storsjö <martin@martin.st>
* tls: Add options for verifying the peer certificateMartin Storsjö2013-09-26
| | | | | | | | | | | | | | | | | | | | A file containing the trusted CA certificates needs to be supplied via the ca_file AVOption, unless the TLS library has got a system default file/database set up. This doesn't check the hostname of the peer certificate with openssl, which requires a non-trivial piece of code for manually matching the desired hostname to the string provided by the certificate, not provided as a library function. That is, with openssl, this only validates that the received certificate is signed with the right CA, but not that it is the actual server we think we're talking to. Verification is still disabled by default since we can't count on a proper CA database existing at all times. Signed-off-by: Martin Storsjö <martin@martin.st>
* matroskadec: check av_strdup() when setting defaultsAnton Khirnov2013-09-24
|
* movenchint: Clear size and len if the realloc failedMartin Storsjö2013-09-22
| | | | | | | | Previously these were left in an inconsistent state. Pointed out by Michael Niedermayer. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Return a proper error code for invalid combinationsMartin Storsjö2013-09-22
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* electronicarts: Check packet sizes before readingMartin Storsjö2013-09-22
| | | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Avoid setting avg_frame_rate if delta_dts is negativeMartin Storsjö2013-09-22
| | | | | | | | | This avoids setting avg_frame_rate to invalid (negative) values. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Use keyframes as default fragmentation point in ismvMartin Storsjö2013-09-22
| | | | | | | | Fragmenting blindly to a certain duration isn't a good choice if one should be able to switch between different qualities, therefore default to keyframes instead. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Set all implicit flags immediately in mov_write_headerMartin Storsjö2013-09-22
| | | | | | | | This makes sure other sanity checks for conflicting options can work properly, e.g. for the conflict between the faststart flag when using the ismv mode. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Set mov->mode earlier in mov_write_headerMartin Storsjö2013-09-22
| | | | | | | This allows simplifying some early checks that depend on the muxer mode. Signed-off-by: Martin Storsjö <martin@martin.st>
* tls: Do not abort on non-fatal TLS alerts with gnutlsMartin Storsjö2013-09-22
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* flv: Make onTextData parsing robustLuca Barbato2013-09-22
| | | | Certain streaming servers do not preserve the order of the fields.
* rtmp: Replace a magic number with a macroLuca Barbato2013-09-22
| | | | 11 is the RTMP header size.
* rtmp: Rewrite embedded flv handlingLuca Barbato2013-09-22
| | | | | | Use update_offset() as done for rtmp audio, video and notifications and read update and write the fields instead of replacing them in the rtmp packet and then memcpying it to the output buffer.
* rtmp: Refactor get_packetLuca Barbato2013-09-22
|
* rtmp: Support AMF_DATA_TYPE_MIXEDARRAYLuca Barbato2013-09-22
| | | | | | | | | And fix the AMF_DATA_TYPE_ARRAY parsing while at it. A MIXEDARRAY type, as the ARRAY, store the number of elements in an uint32 before the list. The ARRAY is strict and does not have an OBJECT terminator, MIXEDARRAY behaves like an OBJECT type and a different than stated number of element can be present.