aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/matroskadec.c
Commit message (Collapse)AuthorAgeFilesLines
* matroskadec: fix NULL pointer dereference in webm_dash_manifest_read_headerAndreas Cadhalpun2016-11-271-0/+5
| | | | | | | | | The code assumes that s->streams[0] is valid. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit ff100c9dd97d2f1f456ff38b192edf84f9744738) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* lavf/matroskadec: Get sample size from private dataMats Peterson2016-01-161-2/+8
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/matroskadec: Use av_realloc() in get_qt_codec()Mats Peterson2016-01-121-3/+3
| | | | | | | Use av_realloc() rather than av_malloc() when normalizing noncompliant private data in get_qt_codec(). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/matroskadec: Normalize noncompliant A_QUICKTIME/V_QUICKTIME private dataMats Peterson2016-01-111-13/+35
| | | | | | | | | | | | | This patch adds a new static function get_qt_codec() that takes care of the initial retrieval of the fourcc and codec ID for A_QUICKTIME and V_QUICKTIME. It also normalizes noncompliant private data found in some older files that incorrectly starts with the fourcc by expanding/shifting the data by 4 bytes, and storing the data size at the start. This is necessary in order for the rest of the code in the A_QUICKTIME and V_QUICKTIME blocks (and most likely other code as well) to correctly parse the private data. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/matroskadec: A_QUICKTIME and fourcc 0x00000000Mats Peterson2016-01-081-0/+9
| | | | | | | | | | | | | | | In many older QuickTime files, the audio format, or "fourcc", is 0x00000000. The QuickTime File Format Specification states the following regarding this situation: "This format descriptor should not be used, but may be found in some files. Samples are assumed to be stored in either 'raw ' or 'twos' format, depending on the sample size field in the sound description." MPlayer handles this logic by itself, but FFmpeg/FFplay currently does not. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/matroskadec: correct codec_tag for "SMI" SVQ3 filesMats Peterson2016-01-061-2/+4
| | | | | | This corrects the codec_tag for some SVQ3 files Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/matroskadec: palettized QuickTime video in MatroskaMats Peterson2015-12-281-1/+25
| | | | | | | | | | | | | | Palettized QuickTime video in Matroska has hitherto not been recognized whatsoever, and the "palette" used has been completely random. The patch for matroskadec.c fixes this issue by adding a palette side data packet in matroska_deliver_packet(), much in the same way as it's done in mov.c. Video samples for testing are available at https://drive.google.com/open?id=0B3_pEBoLs0faWElmM2FnLTZYNlk. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'febfb49a70e82f5ac46dc7ea34dabd4d56b19b31'Hendrik Leppkes2015-12-181-2/+2
|\ | | | | | | | | | | | | * commit 'febfb49a70e82f5ac46dc7ea34dabd4d56b19b31': matroskadec: Fix sample_aspect_ratio for stereo matroska content Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * matroskadec: Fix sample_aspect_ratio for stereo matroska contentAaron Colwell2015-12-071-2/+34
| | | | | | | | | | | | | | | | | | matroskaenc applies divisors to the display width/height when generating stereo content. This patch adds the corresponding multipliers to matroskadec so that the original sample aspect ratio can be recovered. Signed-off-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | lavf/matroskadec: Set codec_tag also for audio codecs.Carl Eugen Hoyos2015-12-121-0/+2
| | | | | | | | | | This was already done for "A_MS/ACM" mkv files and it is done for mov files but was not done for A_QUICKTIME" mkv files.
* | Merge commit 'a0fa6d06b848f26b16ba12f0a9a4a85b93ab8022'Hendrik Leppkes2015-12-071-6/+37
|\| | | | | | | | | | | | | * commit 'a0fa6d06b848f26b16ba12f0a9a4a85b93ab8022': matroska: Warn when metadata references a non-existent element Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * matroska: Warn when metadata references a non-existent elementLuca Barbato2015-11-281-6/+37
| | | | | | | | | | | | Avoid some confusion when the information is not present. Bug-Id: 902
* | avformat: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-041-1/+1
| |
* | avformat/matroskadec: Fix sample_aspect_ratio for stereo matroska contentAaron Colwell2015-12-021-2/+32
| | | | | | | | | | | | | | | | matroskaenc.c applies divisors to the display width/height when generating stereo content. This patch adds the corresponding multipliers to matroskadec.c so that the original sample aspect ratio can be recovered. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* | avformat/matroskadec: Check subtitle stream before dereferencingMichael Niedermayer2015-11-171-0/+1
| | | | | | | | | | | | | | | | Unrecognized streams are not allocated Fixes: flicker-1.color1.vp91447030769.08.webm Found-by: Chris Cunningham <chcunningham@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Replace remaining occurances of av_free_packet with av_packet_unrefHendrik Leppkes2015-10-271-2/+2
| |
* | Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'Hendrik Leppkes2015-10-271-1/+1
|\| | | | | | | | | | | | | * 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-261-2/+2
| | | | | | | | | | | | | | `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-091-4/+5
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d'Hendrik Leppkes2015-09-291-20/+6
|\| | | | | | | | | | | | | * 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-291-2/+6
| | | | | | | | | | | | | | | | | | 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-201-2/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/matroskadec: Fully parse and repack MP3 packetsRodger Combs2015-08-161-1/+3
| | | | | | | | | | | | Fixes https://trac.ffmpeg.org/ticket/4776 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-271-4/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-271-5/+5
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'd80811c94e068085aab797f9ba35790529126f85'Michael Niedermayer2015-07-121-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-111-1/+1
| |
* | avformat/matroskadec: Fix undefined shift in read_sint()Michael Niedermayer2015-07-011-1/+1
| | | | | | | | | | | | | | 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-161-0/+12
| | | | | | | | | | | | | | | | | | 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-161-0/+8
| | | | | | | | | | | | | | | | | | 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-121-0/+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-131-0/+6
|\| | | | | | | | | | | | | | | | | | | * 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-121-0/+6
| |
* | avformat/matroskadec: Cleanup error handling for bz2 & zlibMichael Niedermayer2015-05-121-8/+4
| | | | | | | | | | | | 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-111-1/+1
| | | | | | | | | | | | 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-041-2/+2
| | | | | | | | | | | | The later is not correct Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: check s->streams[k] before using itAndreas Cadhalpun2015-05-041-1/+1
| | | | | | | | | | | | | | 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-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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-021-39/+39
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: remove now duplicate doctype checkMichael Niedermayer2015-04-191-2/+1
| | | | | | | | | | | | See: b8d7f3186e86234f6255f5e8ee9e98573b4d9a6e See: d9fe6b926cd619c311e45e0ae352cf09713c482c Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b8d7f3186e86234f6255f5e8ee9e98573b4d9a6e'Michael Niedermayer2015-04-181-2/+6
|\| | | | | | | | | | | | | * 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-181-2/+6
| | | | | | | | | | | | CC: libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit 'c4d37cd9ef6e374bb888f6273259b10fac5bd909'Michael Niedermayer2015-04-081-2/+3
|\| | | | | | | | | | | | | | | | | | | | | * 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-081-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-051-13/+36
| | | | | | | | | | | | | | | | | | | | | | 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-041-10/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-121-1/+4
|\| | | | | | | | | | | | | | | | | | | | | * 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-121-0/+6
| | | | | | | | CC: libav-stable@libav.org
* | Merge commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e'Michael Niedermayer2015-02-141-24/+24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-141-20/+20
| |