summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
Commit message (Collapse)AuthorAge
* Replace remaining occurances of av_free_packet with av_packet_unrefHendrik Leppkes2015-10-27
|
* Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'Hendrik Leppkes2015-10-27
|\ | | | | | | | | | | | | * commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457': avpacket: Replace av_free_packet with av_packet_unref Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * 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`.
* | lavf/matroskadec: drop indexes that appear brokenRodger Combs2015-10-09
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d'Hendrik Leppkes2015-09-29
|\| | | | | | | | | | | | | * commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d': lavc: Make AVPacket.duration int64, and deprecate convergence_duration Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: Make AVPacket.duration int64, and deprecate convergence_durationwm42015-09-29
| | | | | | | | | | | | | | | | | | Note that convergence_duration had another meaning, one which was in practice never used. The only real use for it was a 64 bit replacement for the duration field. It's better just to make duration 64 bits, and to get rid of it. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | lavf/matroska: ignore ChapCountry ID for nowRodger Combs2015-09-20
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/matroskadec: Fully parse and repack MP3 packetsRodger Combs2015-08-16
| | | | | | | | | | | | Fixes https://trac.ffmpeg.org/ticket/4776 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'd80811c94e068085aab797f9ba35790529126f85'Michael Niedermayer2015-07-12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'd80811c94e068085aab797f9ba35790529126f85': riff: Use the correct logging context Conflicts: libavformat/asfdec_o.c libavformat/avidec.c libavformat/dxa.c libavformat/matroskadec.c libavformat/mov.c libavformat/riff.h libavformat/riffdec.c libavformat/wavdec.c libavformat/wtvdec.c libavformat/xwma.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * riff: Use the correct logging contextLuca Barbato2015-07-11
| |
* | avformat/matroskadec: Fix undefined shift in read_sint()Michael Niedermayer2015-07-01
| | | | | | | | | | | | | | Fixes: asan_heap-oob_17212bc_2243_cov_594210248_h264_TTA.mkv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: validate audio channels and bitdepthAndreas Cadhalpun2015-06-16
| | | | | | | | | | | | | | | | | | In the TTA extradata re-construction the values are written with avio_wl16 and if they don't fit into uint16_t, this triggers an av_assert2 in avio_w8. Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | matroskadec: check audio sample rateAndreas Cadhalpun2015-06-16
| | | | | | | | | | | | | | | | | | And default to 8000 if it is invalid. An invalid sample rate can trigger av_assert2 in av_rescale_rnd. Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | matroskadec: verify seekhead IDswm42015-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some files have SeekHead elements with broken IDs. They mismatch with the ID of the destination element. These files are written by "IDMmkvlib0.1" (as identified by the MuxingApp and WritingApp elements), and the SeekHead IDs are actually endian-swapped. This confuses the SeekHead logic of the demuxer. It will read some elements twice, because the SeekHead ID is used to identify and remember already read elements. With the file at hand, the stream list was duplicated by reading the Tracks element twice. Fix this by rejecting invalid EBML IDs in SeekHead entries. (This fix is relatively specific to the broken file at hand, and doesn't protect against some other cases of broken SeekHead, such as valid but mismatching target element IDs.) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '8fc11abe1fea4f211cc7dbd58a173d1221627d90'Michael Niedermayer2015-05-13
|\| | | | | | | | | | | | | | | | | | | * commit '8fc11abe1fea4f211cc7dbd58a173d1221627d90': mkv: Print unsupported mov tags when found Conflicts: libavformat/matroskadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mkv: Print unsupported mov tags when foundVittorio Giovara2015-05-12
| |
* | avformat/matroskadec: Cleanup error handling for bz2 & zlibMichael Niedermayer2015-05-12
| | | | | | | | | | | | Fixes CID703652 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Use size_t for the variable holding a strlen() value.Michael Niedermayer2015-05-11
| | | | | | | | | | | | Should make no difference but is more correct Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Use tracks[k]->stream instead of s->streams[k]Michael Niedermayer2015-05-04
| | | | | | | | | | | | The later is not correct Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: check s->streams[k] before using itAndreas Cadhalpun2015-05-04
| | | | | | | | | | | | | | This fixes a segmentation fault. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: use uint64_t instead of int for index_scaleAndreas Cadhalpun2015-05-04
| | | | | | | | | | | | | | | | | | | | | | index_scale is set to matroska->time_scale of type uint64_t. When index_scale is int, the assignment can overflow and e.g. result in index_scale = 0. This causes a floating point exception due to the division by index_scale. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Mark static tables as constMichael Niedermayer2015-05-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: remove now duplicate doctype checkMichael Niedermayer2015-04-19
| | | | | | | | | | | | See: b8d7f3186e86234f6255f5e8ee9e98573b4d9a6e See: d9fe6b926cd619c311e45e0ae352cf09713c482c Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b8d7f3186e86234f6255f5e8ee9e98573b4d9a6e'Michael Niedermayer2015-04-18
|\| | | | | | | | | | | | | * commit 'b8d7f3186e86234f6255f5e8ee9e98573b4d9a6e': matroskadec: fix crash when parsing invalid mkv Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskadec: fix crash when parsing invalid mkvThomas Guillem2015-04-18
| | | | | | | | | | | | CC: libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit 'c4d37cd9ef6e374bb888f6273259b10fac5bd909'Michael Niedermayer2015-04-08
|\| | | | | | | | | | | | | | | | | | | | | * commit 'c4d37cd9ef6e374bb888f6273259b10fac5bd909': matroskadec: export cover art correctly Conflicts: libavformat/matroskadec.c See: 511585ce7f7272e5069ef011d6be5f073d268901 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskadec: export cover art correctlywm42015-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generally, libavformat exports cover art pictures as video streams with 1 packet and AV_DISPOSITION_ATTACHED_PIC set. Only matroskadec exported it as attachment with codec_id set to AV_CODEC_ID_MJPEG. Obviously, this should be consistent, so change the Matroska demuxer to export a AV_DISPOSITION_ATTACHED_PIC pseudo video stream. Matroska muxing is probably incorrect too. I know that it can create broken files with an audio track and just 1 video frame when e.g. remuxing mp3 with APIC to mkv. But for now this commit does not change anything about muxing, and also continues to write attachments with AV_CODEC_ID_MJPEG should the muxer application have special knowledge that the Matroska is broken in this way. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | matroskadec: Add support for parsing live header filesVignesh Venkatasubramanian2015-04-05
| | | | | | | | | | | | | | | | | | | | | | This patch adds support for parsing live files (produced by -f webm_chunk) which contains only the headers but no packets. This is only used when using -f webm_dash_manifest. There will be a follow up patch which adds live support to WebM DASH Manifest muxer. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: export cover art correctlywm42015-04-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generally, libavformat exports cover art pictures as video streams with 1 packet and AV_DISPOSITION_ATTACHED_PIC set. Only matroskadec exported it as attachment with codec_id set to AV_CODEC_ID_MJPEG. Obviously, this should be consistent, so change the Matroska demuxer to export a AV_DISPOSITION_ATTACHED_PIC pseudo video stream. Matroska muxing is probably incorrect too. I know that it can create broken files with an audio track and just 1 video frame when e.g. remuxing mp3 with APIC to mkv. But for now this commit does not change anything about muxing, and also continues to write attachments with AV_CODEC_ID_MJPEG should the muxer application have special knowledge that the Matroska is broken in this way. Fixes trac #4423. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '6bdae41d3ef74a0865e8f87896e649f93b2f39bd'Michael Niedermayer2015-03-12
|\| | | | | | | | | | | | | | | | | | | | | * commit '6bdae41d3ef74a0865e8f87896e649f93b2f39bd': matroskadec: Check memory allocations Conflicts: libavformat/matroskadec.c See: 3e2a5b33f0355eeb80b6b2805be7f1b4fa1d1a46 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskadec: Check memory allocationsVittorio Giovara2015-03-12
| | | | | | | | CC: libav-stable@libav.org
* | Merge commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e'Michael Niedermayer2015-02-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e': avformat: Don't anonymously typedef structs Conflicts: libavformat/adtsenc.c libavformat/aiffenc.c libavformat/avidec.c libavformat/gif.c libavformat/iff.c libavformat/img2dec.c libavformat/jvdec.c libavformat/matroskadec.c libavformat/udp.c libavformat/wtvdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: Don't anonymously typedef structsDiego Biurrun2015-02-14
| |
| * matroskadec: Fix read-after-free in matroska_read_seek()Xiaohan Wang2014-12-15
| | | | | | | | | | | | | | | | | | | | | | In matroska_read_seek(), |tracks| is assigned at the begining of the function. However, functions like matroska_parse_cues() could reallocate the tracks and invalidate |tracks|. This assigns |tracks| only before using it, so that it will not get invalidated elsewhere. Bug-Id: chromium/427266
* | avformat/matroskadec: fix IGNIDX handlingwm42015-02-12
| | | | | | | | | | | | | | | | | | | | | | Just because the user requested the seek index to be ignored, we can't just skip essential headers. At least tags are often located at the end of the file, and the old code simply ignored the seekhead for all elements, not just the cue index. Also, it looks like it used the index even if IGNIDX was set if the cue index was located in the beginning of the file. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroska: redo seekhead handlingwm42015-02-12
| | | | | | | | | | | | | | | | | | | | | | In particular, this reads chained seekheads. This makes seeking faster in files which have the index indirectly linked through 2 seekheads. As a side-effect, this warns when reading level-1 (toplevel) elements multiple times (other than seekheads, clusters, and void/crc). Such elements are not valid and likely break everything. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroska: don't complain about unknown elementswm42015-02-09
| | | | | | | | | | | | | | | | | | | | | | | | Matroska is an extensible format - unknown elements must be expected. It shouldn't complain about such elements to the user either; it'll just generate noise. The "error_recognition & AV_EF_EXPLODE" is completely, wrong why would it explode on valid files? It's still useful for debugging, so the message is left in place with a higher log level. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Fix number suffixesMichael Niedermayer2015-02-01
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Use av_malloc_array() for index_entriesMichael Niedermayer2015-01-25
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Check av_mallocz() return valuesMichael Niedermayer2015-01-25
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Use av_freep() to avoid leaving stale pointers in memoryMichael Niedermayer2015-01-06
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | wavdec: RIFX file format supportThomas Volkert2014-12-18
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: request a sample with recursive seek headsMichael Niedermayer2014-12-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: fix handling of recursive SeekHead elementswm42014-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When matroska_execute_seekhead() is called, it goes through the list of seekhead entries and attempts to read elements not read yet. When doing this, the parser can find further SeekHead elements, and will extend the matroska->seekhead list. This can lead to a (practically) infinite loop with certain broken files. (Maybe it can happen even with valid files. The demuxer doesn't seem to check correctly whether an element has already been read.) Fix this by ignoring elements that were added to the seekhead field during executing seekhead entries. This does not fix the possible situation when multiple SeekHead elements after the file header (i.e. occur after the "before_pos" file position) point to the same elements. These elements will probably be parsed multiple times, likely leading to bugs. Fixes ticket #4162. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | msvc: Fix compilation errors due to header include order.Matthew Oliver2014-11-27
| | | | | | | | | | | | | | Ensures that the header include order is such that winsock2.h is always included before windows.h or that windows.h does not include winsock.h. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Fix read-after-free in matroska_read_seek().Xiaohan Wang2014-11-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In matroska_read_seek(), |tracks| is assigned at the begining of the function. However, functions like matroska_parse_cues() could reallocate the tracks so that |tracks| can get invalidated. This CL assigns |tracks| only before we use it so that it won't be invalidated. BUG=427266 TEST=Test case in associated bug passes now. Change-Id: I9c7065fe8f4311ca846076281df2282d190ed344 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: use gmtime_r() for thread safteyMichael Niedermayer2014-11-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Check the return code from strftime()Michael Niedermayer2014-10-26
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>