summaryrefslogtreecommitdiff
path: root/libavformat/asfdec.c
Commit message (Collapse)AuthorAge
* cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* Drop pointless assert.h #includesDiego Biurrun2016-05-03
|
* lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
* asfdec: make sure packet_size is non-zero before seekingAndreas Cadhalpun2016-02-07
| | | | | | | This fixes infinite loops due to seeking back. Signed-off-by: Alexandra Hájková <alexandra@khirnov.net> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* asfdec: check for too small size in asf_read_unknownAndreas Cadhalpun2016-02-07
| | | | | | | This fixes infinite loops due to seeking back. Signed-off-by: Alexandra Hájková <alexandra@khirnov.net> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* asfdec: check avio_skip in asf_read_simple_indexAndreas Cadhalpun2016-02-07
| | | | | | | | The loop can be very long, even though the file is very short. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Alexandra Hájková <alexandra@khirnov.net> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* asfdec: break if EOF is reached after asf_read_packet_headerAndreas Cadhalpun2016-02-07
| | | | | | | | | | | asf_read_payload can unset eof_reached, so check it also before calling that function. This fixes infinite loops. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Alexandra Hájková <alexandra@khirnov.net> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* asfdec: Fix typo in commentAlexandra Hájková2016-01-11
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* asfdec: Remove unused function parametersAlexandra Hájková2016-01-07
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: reject size > INT64_MAX in asf_read_unknownAndreas Cadhalpun2016-01-07
| | | | | | | | | | | Both avio_skip and detect_unknown_subobject use int64_t for the size parameter. This fixes a segmentation fault due to infinite recursion. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Alexandra Hájková <alexandra.khirnova@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: only set asf_pkt->data_size after sanity checksAndreas Cadhalpun2016-01-07
| | | | | | | | | Otherwise invalid values are used unchecked in the next run. This can cause NULL pointer dereferencing. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Alexandra Hájková <alexandra.khirnova@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: handle the case when the stream index has an invalid value betterAlexandra Hájková2015-11-23
| | | | | | | | | | The demuxer returned INVALIDDATA and failed to demux the remaining data when an invalid stream index was read, now it just skips the asf packet for the stream with an invalid stream index and continues demuxing. Reported-By: Hendrik Leppkes Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* avpacket: Replace av_free_packet with av_packet_unrefLuca Barbato2015-10-26
| | | | | | | `av_packet_unref` matches the AVFrame ref-counted API and can be used as a drop in replacement. Deprecate `av_free_packet`.
* asfdec: do not skip padding if offset is above packet size - paddingAlexandra Hájková2015-10-08
| | | | | | Sample-Id: https://samples.libav.org/asf-wmv/demux-asf-assert-failed.wmv Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* asfdec: add more checks for size left in asf packet bufferAlexandra Hájková2015-09-12
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* asfdec: alloc enough space for storing name in asf_read_metadata_objAlexandra Hájková2015-09-06
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* asfdec: prevent the memory leak in the asf_read_metada_objAlexandra Hájková2015-08-16
| | | | | | | also do not return the error code but just break reading metadata object in the case of the aspect ratio reading failure Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* asf: Use time_t where neededLuca Barbato2015-08-04
| | | | gmtime takes a time_t not an uint64_t.
* asfdec: read values properlyAlexandra Hájková2015-08-04
| | | | | | | The length of BOOL values is 16 bits in the Metadata Object but 32 bits in the Extended Content Description Object. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* asfdec: prevent the memory leak while reading metadataAlexandra Hájková2015-08-02
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: remove improper assignement that caused wrong timestampsAlexandra Hájková2015-07-31
| | | | | | | | and remove unneeded variable Sample-Id: https://samples.libav.org/asf-wmv/asf-code-53/movn018.asf Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: do not export empty metadataAlexandra Hájková2015-07-31
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: free AVDictionaries properly when closing the demuxerAlexandra Hájková2015-07-31
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: do not align Data Object when Broadcast Flag is setAlexandra Hájková2015-07-27
| | | | | | its size is invalid in this case Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* asfdec: interpret the first flag in an asf packet as length flagAlexandra Hájková2015-07-27
| | | | | | if the error correction flag is not set, a packet starts with payload Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: remove the wrong conditionAlexandra Hájková2015-07-23
| | | | | | | | this condition breaks reading from the pipe as data_reached variable have to be set to break while in the asf_read_header just after the Data Object is found Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: increment nb_streams right after the stream allocationAlexandra Hájková2015-07-23
| | | | | | to prevent possible memory leaks Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: set nb_streams to 0 in the asf_read_closeAlexandra Hájková2015-07-23
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: avoid crash in the case when chunk_len is 0 or pkt_len is 0Alexandra Hájková2015-07-22
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: close the demuxer properly when read_header is failingAlexandra Hájková2015-07-22
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: factor out seeking to the Data Object outside whileAlexandra Hájková2015-07-22
| | | | | | return INVALIDDARA if Data Object was not found Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: make nb_sub to be unsigned intAlexandra Hájková2015-07-19
| | | | | | number of subpayloads should be always positive Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: read the replicated data in a separate functionAlexandra Hájková2015-07-19
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: convert condition for the replicated data reading to be saferAlexandra Hájková2015-07-19
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: do not read replicated data when their length is 0Alexandra Hájková2015-07-19
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: prevent memory leaks found with Coverity ScanAlexandra Hájková2015-07-13
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: always reset packet state after seekingHendrik Leppkes2015-07-12
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* riff: Use the correct logging contextLuca Barbato2015-07-11
|
* asfdec: Fix reading from the pipeAlexandra Hájková2015-07-10
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* asfdec: prevent the infinite loop in detect unknown_subobjectAlexandra Hájková2015-07-03
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* asfdec: prevent possible memory leak in the asf_read_metadata_objAlexandra Hájková2015-07-03
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* asf: Do not skip data streamsLuca Barbato2015-06-28
|
* lavf: Replace the ASF demuxerAlexandra Hájková2015-06-28
| | | | | | | | | | | | | | | | | The old one is the result of the reverse engineering and guesswork. The new one has been written following the now-available specification. This work is part of Outreach Program for Women Summer 2014 activities for the Libav project. The fate references had to be changed because the old demuxer truncates the last frame in some cases, the new one handles it properly. The seek-test reference is changed because seeking works differently in the new demuxer. When seeking, the packet is not read from the stream directly, but it is rather constructed by the demuxer. That is why position is -1 now in the reference. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* Replace av_dlog with normal av_log at trace levelVittorio Giovara2015-04-19
| | | | This applies to every library where performance is not critical.
* asf: do not export XMP metadata by defaultVittorio Giovara2015-03-03
| | | | | | | | | | | Similarly to what has been done for MOV, display XMP metadata only when users explicitly require it. The Extensible Metadata Platform tag can contain various kind of data which are not strictly related to the video file, such as history of edits and saves from the project file. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* avformat: Don't anonymously typedef structsDiego Biurrun2015-02-14
|
* lavf: move internal fields from public to internal contextwm42015-02-10
| | | | | | | This is not an API change; the fields were explicitly declared private before. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf: more correct printf format specifiersDiego Biurrun2014-03-11
|
* asfdec: fix seeking with fragmented packetsJanne Grunau2014-02-12
| | | | | | | After seeking fragments with an offset > 0 must be skipped to correctly assemble packets. Bug-Id: 43