Commit Graph

440 Commits

Author SHA1 Message Date
Michael Niedermayer
5e1bacf2d4 matroskadec: reset size when freeing data.
Fixes null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-04 03:50:09 +01:00
Michael Niedermayer
0efcf16a3e replace av_log(0, by av_log(NULL,
The first parameter is a pointer and NULL is more correct

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-23 18:10:02 +01:00
Michael Niedermayer
c2ca0163af matroskadec: check h in generic rm packet shuffler
Fixes crash

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-11 01:19:44 +01:00
Michael Niedermayer
c63e76ba35 ebml_read_binary: use fast_padded_malloc()
Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-09 23:35:58 +01:00
Michael Niedermayer
2581d9bcbb Merge remote-tracking branch 'qatar/master'
* qatar/master:
  doc: add apidoc target for doxygen API documentation
  matroskadec: do not use avpacket internals

Conflicts:
	doc/Makefile
	libavformat/matroskadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-03 14:48:51 +01:00
Anton Khirnov
34871beb5e matroskadec: do not use avpacket internals 2012-11-02 18:28:56 +01:00
Michael Niedermayer
aa604e8e33 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avutil: Make LZO decoder code configure-time selectable
  avutil: Move memcpy_backptr() to mem.c
  configure: detect parisc64 automatically
  configure: detect ppc64 automatically
  configure: detect mips64 automatically
  configure: generalise 64-bit test
  smoothstreamingenc: Don't assume streams start from timestamp 0

Conflicts:
	configure
	libavutil/Makefile
	libavutil/lzo.c
	libavutil/lzo.h
	libavutil/mem.c
	libavutil/mem.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-25 13:15:58 +02:00
Diego Biurrun
2a91ada828 avutil: Make LZO decoder code configure-time selectable 2012-10-25 11:49:49 +02:00
Michael Niedermayer
2c5b92fe90 matroskadec: fix double negation typo
Fixes CID602563
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 16:58:33 +02:00
Michael Niedermayer
1116491c53 matroska_parse_rm_audio: check for malloc failure
Fixes CID733712
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 16:55:45 +02:00
Michael Niedermayer
9270a2b374 Merge commit '4c995fafd861f537360b3717901cdbed6a6844e7'
* commit '4c995fafd861f537360b3717901cdbed6a6844e7':
  configure: simplify get_version() function
  build: support asan and tsan toolchain shortcuts
  rmdec: Move SIPR code shared with Matroska demuxer to a separate file

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-16 13:20:46 +02:00
Diego Biurrun
7e68c91e24 rmdec: Move SIPR code shared with Matroska demuxer to a separate file 2012-10-15 13:34:07 +02:00
Michael Niedermayer
406cdddbdd Merge remote-tracking branch 'qatar/master'
* qatar/master:
  libx264: add forgotten ;
  matroskadec: fix a sanity check.
  matroskadec: only return corrupt packets that actually contain data
  lavf: zero data/size of the packet passed to read_packet().
  ARM: use 2-operand syntax for ADD Rd, PC in Apple PIC code
  ARM: align PIC offset pools to 4 bytes
  ARM: swap source operands in some add instructions
  configure: update tms470 detection for latest version
  lavf probe: prevent codec probe with no data at all seen
  motion_est: fix use of inline on extern functions

Conflicts:
	libavcodec/motion_est_template.c
	libavformat/matroskadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-21 14:44:32 +02:00
Anton Khirnov
87b017a298 matroskadec: fix a sanity check. 2012-09-21 09:15:07 +02:00
Anton Khirnov
bdb939ad73 matroskadec: only return corrupt packets that actually contain data
Fixes bug 372.
2012-09-21 09:15:01 +02:00
Michael Niedermayer
a6ec1e49f6 matroskadec: matroska_parse_rm_audio: remove unused parameter
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-20 23:43:20 +02:00
Michael Niedermayer
5864ce13d1 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mp3dec: read Xing frame TOC index
  mp3dec: use named constants for Xing header flags
  libx264: add support for nal-hrd, required for Blu-ray streams.
  mov: support random access point grouping
  matroskadec: properly support BlockDuration

Conflicts:
	libavcodec/libx264.c
	libavformat/isom.h
	libavformat/matroskadec.c
	libavformat/mov.c
	libavformat/mp3dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-20 21:46:35 +02:00
Michael Niedermayer
8c51ea5489 Merge commit 'c831ebf61629d219ebcaa9f02d262e67aad09d83'
* commit 'c831ebf61629d219ebcaa9f02d262e67aad09d83':
  matroskadec: split frame parsing
  matroskadec: split laces parsing

Conflicts:
	libavformat/matroskadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-20 20:39:47 +02:00
Michael Niedermayer
b8044972c4 Merge commit '117d8c6d1f1c187ffc6098d9618457e00534e013'
* commit '117d8c6d1f1c187ffc6098d9618457e00534e013':
  matroska: implement support for ProRes
  matroska: implement support for ALAC

Conflicts:
	libavformat/matroskaenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-20 19:43:38 +02:00
Michael Niedermayer
0da50055eb matroskadec: fix typo
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-20 19:12:07 +02:00
Michael Niedermayer
6902c3acb0 Merge commit '870e75524aa0d00ebcd1d15589c8d29b84af1565'
* commit '870e75524aa0d00ebcd1d15589c8d29b84af1565':
  matroskadec: validate lace_size when parsed

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-20 19:11:46 +02:00
Michael Niedermayer
a16c512374 Merge commit 'c9a39cec70603f662f4c326b21b11c4f0112079a'
* commit 'c9a39cec70603f662f4c326b21b11c4f0112079a':
  matroskadec: return meaningful errors in matroska_decode_buffer
  matroskadec: fix incorrect unsigned->signed conversion

Conflicts:
	libavformat/matroskadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-20 13:40:47 +02:00
Michael Niedermayer
1df2e3c707 Merge commit '8d4dd55c37b14ecea596f3477b35bf6c20688d8b'
* commit '8d4dd55c37b14ecea596f3477b35bf6c20688d8b':
  matroskadec: refactor matroska_decode_buffer

Conflicts:
	libavformat/matroskadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-20 13:32:43 +02:00
Michael Niedermayer
61ced71d79 Merge commit '581281e242609a222233a2e5538b89dfb88fb18e'
* commit '581281e242609a222233a2e5538b89dfb88fb18e':
  matroskadec: check realloc in lzo encoding
  matroska: honor error_recognition on unknown doctypes
  tiffdec: Add support for GRAY16LE.
  tiffenc: Add support for little endian RGB48 and GRAY16
  mpeg4: support frame parameter changes with frame-mt
  mpegvideo: check ff_find_unused_picture() return value for errors
  mpegvideo: release frame buffers before freeing them
  configure: msvc: default to 'lib' as 'ar' tool
  build: support some non-standard ar variants

Conflicts:
	libavcodec/h263dec.c
	libavcodec/mpegvideo.c
	libavcodec/tiff.c
	libavcodec/tiffenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-20 03:20:29 +02:00
Luca Barbato
c831ebf616 matroskadec: split frame parsing 2012-09-19 20:34:14 +02:00
Luca Barbato
117d8c6d1f matroska: implement support for ProRes
Support Matroska native formatting.

On demuxing prepend a Frame container atom (32bit big endian encoded
frame size and 'icpf' string).
On muxing remove it.
2012-09-19 20:34:14 +02:00
Luca Barbato
870e75524a matroskadec: validate lace_size when parsed
Stricter validation, explicitly exit on misparsing and some error
forwarding from the ebml parsing functions used.
2012-09-19 20:34:14 +02:00
Luca Barbato
c9a39cec70 matroskadec: return meaningful errors in matroska_decode_buffer 2012-09-19 20:34:14 +02:00
Luca Barbato
8d4dd55c37 matroskadec: refactor matroska_decode_buffer
Make MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP behave like
the other encodings and spare few lines of boilerplate code.
2012-09-19 20:34:14 +02:00
Luca Barbato
7d8431004a matroskadec: properly support BlockDuration 2012-09-19 20:34:14 +02:00
Luca Barbato
2d0e7713f9 matroskadec: split laces parsing 2012-09-19 20:34:14 +02:00
Moritz Bunkus
8071dca3d5 matroska: implement support for ALAC
Support Matroska native formatting.

On demuxing reconstruct the 36-bytes QuickTime atom that the ALAC
decoder expects by prepending the "atom size", "tag" and
"tag version" fields missing from the Matroska's CodecPrivate
element.

On muxing remove the initial 12 bytes

Sample files are available:
http://www.bunkus.org/videotools/mkvtoolnix/samples/alac/alac-in-matroska.mka
and the CoreAudio file it was created from with today's mkvmerge:
http://www.bunkus.org/videotools/mkvtoolnix/samples/alac/alac-in-matroska-source.caf

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-19 20:34:14 +02:00
Dale Curtis
df1d84121b matroskadec: fix incorrect unsigned->signed conversion 2012-09-19 20:34:14 +02:00
Luca Barbato
581281e242 matroskadec: check realloc in lzo encoding
Make all the compression encodings behave the same way.
2012-09-19 20:34:13 +02:00
Luca Barbato
cd4739c4f2 matroska: honor error_recognition on unknown doctypes 2012-09-19 20:34:13 +02:00
Clément Bœsch
ca81e3b6e7 lavf/mkv: prefix video stereo arrays with ff_. 2012-09-16 02:58:40 +02:00
Philip Langdale
9d89c8b3ac matroskadec, matroskadec, srtenc: Read/Write duration for subtitles.
After much discussion and back-and-forth, we reached the conclusion
that matroska uses convergence_duration for subtitle duration because
a 32bit value isn't large enough to store the duration if sub-micro-second
timebases are used. Matroska may not be the only one that supports these
timebases, but it's certainly the only one that ffmpeg attempts to support
in this way.

The long term solution that we seemed to reach was that if we encounter
a matroska file with a sub-micro-second timebase, we should internally
scale it up to at least micro-second, and then duration can be used
normally. This suggests that on the encode side, we should not allow
generation of files with sub-micro-second timebases, but that's a separate
issue.

That being a non-trivial change, and the subtitle interoperability breakage
being very real, I'm re-submitting this small change for consideration.

In this diff, we make sure that duration is populated by the matroska
demuxer, and that convergence_duration is respected in matroskaenc and
srtenc, but that duration is used otherwise. This ends up being a strict
improvement - pipelines that use convergence duration are unchanged, and
ones that are currently broken due to the duration mismatch will start
working - except for the ones with the extreme timebases, but those were
already broken.

Signed-off-by: Philip Langdale <philipl@overt.org>
2012-08-31 20:22:49 -07:00
Philip Langdale
2626cc4580 matroska: Mark S_TEXT/UTF-8 as Subrip encoded subtitles.
While not explicitly stated in the specs, the original author
has stated that S_TEXT/UTF-8 is expected to be text using Subrip
markup, but without Subrip in-band timing.

So, now that we have a decoder that conforms to this expectation,
let's use it.

Note that this change will impact tools that use libavformat. If
they expect srt subtitles to have CODEC_ID_TEXT, they must be
adjusted to expect CODEC_ID_SUBRIP. The actual content is, obviously,
unchanged.

Signed-off-by: Philip Langdale <philipl@overt.org>
2012-08-25 13:15:41 -07:00
Michael Niedermayer
ee475e272e matroskadec: fix lace vs block duration.
Fixes Ticket1270

Thanks-to: Moritz Bunkus
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-08 17:54:49 +02:00
Michael Niedermayer
7a72695c05 Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'
* commit '36ef5369ee9b336febc2c270f8718cec4476cb85':
  Replace all CODEC_ID_* with AV_CODEC_ID_*
  lavc: add AV prefix to codec ids.

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/examples/muxing.c
	ffmpeg.c
	ffprobe.c
	ffserver.c
	libavcodec/8svx.c
	libavcodec/avcodec.h
	libavcodec/dnxhd_parser.c
	libavcodec/dvdsubdec.c
	libavcodec/error_resilience.c
	libavcodec/h263dec.c
	libavcodec/libvorbisenc.c
	libavcodec/mjpeg_parser.c
	libavcodec/mjpegenc.c
	libavcodec/mpeg12.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pcm.c
	libavcodec/r210dec.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/version.h
	libavdevice/alsa-audio-dec.c
	libavdevice/bktr.c
	libavdevice/v4l2.c
	libavformat/asfdec.c
	libavformat/asfenc.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/caf.c
	libavformat/electronicarts.c
	libavformat/flacdec.c
	libavformat/flvdec.c
	libavformat/flvenc.c
	libavformat/framecrcenc.c
	libavformat/img2.c
	libavformat/img2dec.c
	libavformat/img2enc.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/matroska.c
	libavformat/matroskadec.c
	libavformat/matroskaenc.c
	libavformat/mov.c
	libavformat/movenc.c
	libavformat/mp3dec.c
	libavformat/mpeg.c
	libavformat/mpegts.c
	libavformat/mxf.c
	libavformat/mxfdec.c
	libavformat/mxfenc.c
	libavformat/nsvdec.c
	libavformat/nut.c
	libavformat/oggenc.c
	libavformat/pmpdec.c
	libavformat/rawdec.c
	libavformat/rawenc.c
	libavformat/riff.c
	libavformat/sdp.c
	libavformat/utils.c
	libavformat/vocenc.c
	libavformat/wtv.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-07 22:45:46 +02:00
Anton Khirnov
36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Michael Niedermayer
c30f53e4d8 matroskadec: prevent potential integer overflow
Iam not sure this can happen, but its safer we check.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-05 17:59:12 +02:00
Moritz Bunkus
bc3b422029 matroskadec: Implement support for ALAC
This patch implements support reading ALAC from Matroska files. The
only non-trivial thing about it is that only the ALAC magic cookie is
stored in Matroska's CodecPrivate element but not the "atom size",
"tag" and "tag version" fields that FFMPEG's ALAC decoder
expects. However, those are trivial to re-create.

Sample files are available:
http://www.bunkus.org/videotools/mkvtoolnix/samples/alac/alac-in-matroska.mka
and the CoreAudio file it was created from with today's mkvmerge:
http://www.bunkus.org/videotools/mkvtoolnix/samples/alac/alac-in-matroska-source.caf

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-05 17:59:12 +02:00
Michael Niedermayer
668c873bed matroskadec: check element size against stream limit in ebml_parse_elem()
Fixes Ticket1195

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-04 02:27:51 +02:00
Michael Niedermayer
b5da7d4c1a Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avformat: Drop pointless "format" from container long names
  swscale: bury one more piece of inline asm under HAVE_INLINE_ASM.
  wv: K&R formatting cosmetics
  configure: Add missing descriptions to help output
  h264_ps: declare array of colorspace strings on its own line.
  fate: amix: specify f32 sample format for comparison
  tiny_psnr: support 32-bit float samples
  eamad/eatgq/eatqi: call special EA IDCT directly
  eamad: remove use of MpegEncContext
  mpegvideo: remove unnecessary inclusions of faandct.h
  af_asyncts: avoid overflow in out_size with large delta values
  af_asyncts: add first_pts option

Conflicts:
	configure
	libavcodec/eamad.c
	libavcodec/h264_ps.c
	libavformat/crcenc.c
	libavformat/ffmdec.c
	libavformat/ffmenc.c
	libavformat/framecrcenc.c
	libavformat/md5enc.c
	libavformat/nutdec.c
	libavformat/rawenc.c
	libavformat/yuv4mpeg.c
	tests/tiny_psnr.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-30 23:28:31 +02:00
Diego Biurrun
6774247a9d avformat: Drop pointless "format" from container long names 2012-07-30 13:59:06 +02:00
Michael Niedermayer
7d1918affe Merge remote-tracking branch 'qatar/master'
* qatar/master:
  flvdec: remove spurious use of stream id
  lavf: deprecate r_frame_rate.
  lavf: round estimated average fps to a "standard" fps.

Conflicts:
	ffmpeg.c
	ffprobe.c
	libavformat/avformat.h
	libavformat/electronicarts.c
	libavformat/flvdec.c
	libavformat/rawdec.c
	libavformat/utils.c
	tests/ref/fate/iv8-demux

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-30 00:56:33 +02:00
Anton Khirnov
aba232cfa9 lavf: deprecate r_frame_rate.
According to its description, it is supposed to be the LCM of all the
frame durations. The usability of such a thing is vanishingly small,
especially since we cannot determine it with any amount of reliability.
Therefore get rid of it after the next bump.

Replace it with the average framerate where it makes sense.

FATE results for the wtv and xmv demux tests change. In the wtv case
this is caused by the file being corrupted (or possibly badly cut) and
containing invalid timestamps. This results in lavf estimating the
framerate wrong and making up wrong frame durations.
In the xmv case the file contains pts jumps, so again the estimated
framerate is far from anything sane and lavf again makes up different
frame durations.

In some other tests lavf starts making up frame durations from different
frame.
2012-07-29 08:06:30 +02:00
Michael Niedermayer
88beb2df98 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  FATE: fix the asyncts test
  build: Drop gcc-specific warning flag from header compilation rule
  FATE: add a test for the asyncts audio filter.
  matroskadec: return more correct error code on read error.
  buffersrc: check ff_get_audio_buffer() for errors.
  lavfi: check all ff_get_video_buffer() calls for errors.
  lavfi: check all avfilter_ref_buffer() calls for errors.
  vf_select: avoid an unnecessary avfilter_ref_buffer().
  buffersrc: avoid creating unnecessary buffer reference
  lavfi: use avfilter_unref_bufferp() where appropriate.
  vf_fps: add more error checks.
  vf_fps: fix a memleak on malloc failure.
  lavfi: check all ff_start_frame/draw_slice/end_frame calls for errors
  lavfi: add error handling to end_frame().
  lavfi: add error handling to draw_slice().
  lavfi: add error handling to start_frame().

Conflicts:
	Makefile
	ffplay.c
	libavfilter/buffersrc.c
	libavfilter/vf_boxblur.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_frei0r.c
	libavfilter/vf_hflip.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/video.c
	libavfilter/vsrc_color.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-22 23:56:21 +02:00
Anton Khirnov
721113bed2 matroskadec: return more correct error code on read error. 2012-07-22 09:14:05 +02:00