Commit Graph

8006 Commits

Author SHA1 Message Date
Laurent Aimar
b832e539c0 vqa: fix double free on corrupted streams
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e3123856c7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-04 01:00:58 +01:00
Mans Rullgard
edc942202b lavf: fix signed overflow in avformat_find_stream_info()
On the first iteration through this code, last_dts is always
INT64_MIN (AV_NOPTS_VALUE) and the subtraction overflows in
an invalid manner.  Although the result is only used if the
input values are valid, performing the subtraction is still
not allowed in a strict environment.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit a31e9f68a4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-04 01:00:18 +01:00
Compn
d33a1d6507 riff: map 0x0038 to amrnb, works on http://video.mopoto.com/4/40/407/40709.avi
(cherry picked from commit 3ebab62fc6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-04 00:40:21 +01:00
Loren Osborn
b981c5d4e0 mpegtsenc: Lift limit on PMT PID
Fixes Ticket518
(cherry picked from commit bf5c3bac51)
2011-10-11 21:34:14 +02:00
Carl Eugen Hoyos
60171d8fa6 Do not set codec_tag property for matroska muxers.
Fixes ticket #8, #537.
2011-10-09 20:07:41 +02:00
Michael Niedermayer
a39b603bf6 lavf/utils: fix overestimation of the rational number density.
Fixes Ticket498

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-09 01:14:21 +02:00
Laurent Aimar
2e342df4a2 Fix use of uninitialized memory in 4X Technologies demuxer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a1876e0072)
2011-10-02 05:45:01 +02:00
Michael Niedermayer
b0804f3705 Merge remote-tracking branch 'qatar/release/0.7' into release/0.8
* qatar/release/0.7: (73 commits)
  Update Changelog for 0.7.2 release
  Update RELEASE file for 0.7.2
  lavf: do not set codec_tag for rawvideo
  fate: allow testing with libavfilter disabled
  fate: separate lavf-mxf_d10 test from lavf-mxf
  Fix memory (re)allocation in matroskadec.c, related to MSVR-11-0080.
  movenc: fix NULL reference in mov_write_tkhd_tag
  movenc: create an alternate group for each media type
  flvdec: Check for overflow before allocating arrays
  ppc: fix some pointer to integer casts
  ppc: fix 32-bit PIC build
  rv34: Check for invalid slice offsets
  rv34: Fix potential overreads
  rv34: Avoid NULL dereference on corrupted bitstream
  rv10: Reject slices that does not have the same type as the first one
  lavf: Fix context pointer in av_open_input_stream when avformat_open_input fails
  oggdec: fix out of bound write in the ogg demuxer
  Fixed size given to init_get_bits().
  smacker: fix a few off by 1 errors
  Check for invalid VLC value in smacker decoder.
  ...

Conflicts:
	RELEASE
	libavcodec/avs.c
	libavcodec/ppc/asm.S
	libavcodec/rv34.c
	libavcodec/xan.c
	libavdevice/alsa-audio.h
	libavformat/flvdec.c
	libavformat/gxf.c
	libavformat/utils.c
	libswscale/x86/swscale_template.c
	tests/ref/lavf/mov
	tests/ref/lavf/mxf

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-01 22:42:41 +02:00
Michael Niedermayer
80331265ca avienc: Add a limit on the number of skiped frames muxed in a row.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9cb9e39c41)
2011-10-01 21:04:04 +02:00
Laurent Aimar
67b704982f Fix double free on error in Deluxe Paint Animation demuxer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d39d7122e3)
2011-10-01 20:59:42 +02:00
Laurent Aimar
fa79af6845 Check for out of bound writes in the avs demuxer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5d44c061cf)
2011-10-01 20:59:28 +02:00
Laurent Aimar
c23d5261f7 Check for corrupted data in avs demuxer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1cce7def0a)
2011-10-01 20:59:20 +02:00
Martin Storsjö
932b5f3cbb lavf: Avoid using av_malloc(0) in av_dump_format
On OS X, av_malloc(0) returns pointers that cause crashes when
freed.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e81e5e8ad2)
2011-10-01 20:57:04 +02:00
Tomas Härdin
2451228b0c mov: Only touch extradata in mov_read_extradata() if codec_id is what we expect
Extradata should only be parsed from the avss, fiel, jp2h and alac atoms for
AVS, MJPEG, Motion JPEG 2000 and ALAC respectively.
This also fixes the mov demuxer coming up with bogus extradata for some
AVC-Intra samples due to the presence of fiel atoms.
(cherry picked from commit e571305a71)
2011-10-01 20:53:53 +02:00
Nicolas George
17b6abab50 movenc: Replace av_realloc by av_realloc_f when relevant.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 194c2432ee)
2011-10-01 20:50:19 +02:00
Nicolas George
cfff8db729 gxfenc: Replace av_realloc by av_realloc_f when relevant.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit af84d9bb9e)
2011-10-01 20:50:08 +02:00
Nicolas George
431937883f aviobuf: Replace av_realloc by av_realloc_f when relevant.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 247a1dc847)
2011-10-01 20:50:02 +02:00
Nicolas George
7bc9c32573 avienc: Replace av_realloc by av_realloc_f when relevant.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e47cfe9e5c)
2011-10-01 20:49:55 +02:00
Nicolas George
1537f86a93 avidec: Replace av_realloc by av_realloc_f when relevant.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 71e23d39a3)
2011-10-01 20:49:48 +02:00
Nicolas George
2a934e87b1 4xm: Replace av_realloc by av_realloc_f when relevant.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0cc44facf1)
2011-10-01 20:49:41 +02:00
Laurent Aimar
521dbccc11 Fix return value on EOF in mpc v8 demuxer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7ec5ea437f)
2011-10-01 20:30:35 +02:00
Michael Niedermayer
e394f7984c psxstr: improve probe to not misdetect so much.
The score of 50 can probably be raised if needed
Fixes Ticket490

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3f7dc480c1)
2011-10-01 19:31:06 +02:00
Michael Niedermayer
3aad92f3e6 lavf/utils: only complain about aspect missmatch when the difference is "meassureable"
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e8d8517b16)
2011-10-01 19:30:49 +02:00
Michael Niedermayer
4d36f7cf88 avformat_free_context: favor av_freep()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2a93f28a4b)
2011-10-01 01:32:37 +02:00
Mans Rullgard
e257eebd17 lavf: do not set codec_tag for rawvideo
If the demuxer did not set a codec_tag, there is none and
inventing one makes no sense.  This change stops the rawvideo
"decoder" over-writing user-supplied pixfmt with one derived
from the codec_tag.  The pixfmt-codec_tag-pixfmt round-trip
is lossy since several pixfmts map to the same codec_tag.

This fixes fate-lavf-pixfmt with avfilter disabled.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit bb416bd68c)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-09-30 15:37:05 +02:00
Michael Niedermayer
a2443e89d7 Fix memory (re)allocation in matroskadec.c, related to MSVR-11-0080.
Whitespace of the patch cleaned up by Aurel
Some of the issues have been reported by Steve Manzuik / Microsoft Vulnerability Research (MSVR)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

(cherry picked from commit 956c901c68)

Further suggestions from Kostya <kostya.shishkov@gmail.com> have been
implemented by Reinhard Tartler <siretart@tauware.de>

(cherry picked from commit 77d2ef13a8)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-09-28 00:24:41 +02:00
Anton Khirnov
9f9b731a3a movenc: fix NULL reference in mov_write_tkhd_tag
st may be NULL when there are more mov streams than AVStreams, e.g. when
chapters are present.

(cherry picked from commit c92a2a4eb8)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-09-27 20:57:08 +02:00
Anton Khirnov
ad47a5ec85 movenc: create an alternate group for each media type
Partially fixes bug 44.

(cherry picked from commit 7574cacbd5)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-09-27 20:57:08 +02:00
Michael Niedermayer
fed7f5b04f flvdec: Check for overflow before allocating arrays
On allocation, the array length is multiplied by sizeof(int64_t),
this prevents the multiplication from overflowing.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit a246cefa75)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-09-26 19:31:32 +02:00
David Goldwich
9973ca992e lavf: Fix context pointer in av_open_input_stream when avformat_open_input fails
Signed-off-by: David Goldwich <david.goldwich@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 63d64228a7)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-26 19:26:33 +02:00
Laurent Aimar
a3d471e500 oggdec: fix out of bound write in the ogg demuxer
Between ogg_save() and ogg_restore() calls, the number of streams
could have been reduced.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 0e7efb9d23)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-26 19:26:33 +02:00
Laurent Aimar
54a178f28f Fixed size given to init_get_bits().
init_get_bits() takes a number of bits and not a number of bytes as
its size argument.

Signed-off-by: Alex Converse <alex.converse@gmail.com>
(cherry picked from commit b59efc9434)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-26 19:26:32 +02:00
Laurent Aimar
9f391c4971 Fixed off by one packet size allocation in the smacker demuxer.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit a92d0fa5d2)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-26 19:26:32 +02:00
Laurent Aimar
4e7905fa9e Check for invalid packet size in the smacker demuxer.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e055932f56)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-26 19:26:32 +02:00
Laurent Aimar
4ee014309c ape demuxer: fix segfault on memory allocation failure.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 273aab99bf)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-26 19:26:32 +02:00
Kostya Shishkov
0b9b3570a3 smacker demuxer: handle possible av_realloc() failure.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 47a8589f7b)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-26 19:26:32 +02:00
Luca Barbato
fe3e7297fe flvenc: use int64_t to store offsets
Metadata currently is written only at the start of the file in normal
cases, when transcoding from a rtmp source metadata could be
written later and the offset recorded can exceed 32bit.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 7f5bf4fbaf)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-26 19:26:30 +02:00
Alex Converse
c613a89143 mxfdec: Include FF_INPUT_BUFFER_PADDING_SIZE when allocating extradata.
This prevents out of bounds reads when extradata is being decoded.
(cherry picked from commit 1f6f58d585)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-26 19:26:29 +02:00
Anton Khirnov
9c2a024660 lavf: fix segfault in av_open_input_stream()
ic is NULL in case of error.
(cherry picked from commit 13551ad1e3)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-26 19:26:29 +02:00
Jindrich Makovicka
b772a757dd mpegts: fix Continuity Counter error detection
According to MPEG-TS specs, the continuity_counter shall not be
incremented when the adaptation_field_control of the packet
equals '00' or '10'.

Signed-off-by: Jindrich Makovicka <jindrich.makovicka@nangu.tv>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 8923cfa328)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-26 19:26:29 +02:00
Tomas Härdin
c75ba07f6e gxf: Fix 25 fps DV material in GXF being misdetected as 50 fps
Set DV packet durations using fields_per_frame.
This requires turning gxf_stream_info into the demuxer's context for access to the value in gxf_packet().
Since MPEG-2 seems to work fine this done only for DV.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 99fecc64b0)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-26 19:26:28 +02:00
Alex Converse
6107543d4e adts: Fix PCE copying.
Parse the extension flag bit when reading the MPEG4 AudioSpecificConfig.

This has nothing to do with SBR/PS contradictory to what was noted when it was removed.
(cherry picked from commit 7f01a4192c)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-26 19:26:28 +02:00
Clément Bœsch
776603b650 mxfenc: fix ignored drop flag in binary timecode representation.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 4d5e7ab5c4)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-26 19:26:28 +02:00
Michael Niedermayer
ec7f0b527c Merge remote-tracking branch 'khirnov/release/0.7' into release/0.8
* khirnov/release/0.7: (64 commits)
  rv34: Check for invalid slice offsets
  rv34: Fix potential overreads
  rv34: Avoid NULL dereference on corrupted bitstream
  rv10: Reject slices that does not have the same type as the first one
  lavf: Fix context pointer in av_open_input_stream when avformat_open_input fails
  oggdec: fix out of bound write in the ogg demuxer
  Fixed size given to init_get_bits().
  smacker: fix a few off by 1 errors
  Check for invalid VLC value in smacker decoder.
  Check and propagate errors when VLC trees cannot be built in smacker decoder.
  Fixed off by one packet size allocation in the smacker demuxer.
  Check for invalid packet size in the smacker demuxer.
  ape demuxer: fix segfault on memory allocation failure.
  xan: Add some buffer checks (cherry picked from commit 0872bb23b4)
  Fixed size given to init_get_bits() in xan decoder. (cherry picked from commit 393d5031c6)
  smacker demuxer: handle possible av_realloc() failure.
  Fixed segfault with wavpack decoder on corrupted decorrelation terms sub-blocks.
  cljr: init_get_bits size in bits instead of bytes (cherry picked from commit 0c1f5b93d9)
  indeo2: fail if input buffer too small (cherry picked from commit b7ce4f1d1c)
  indeo2: init_get_bits size in bits instead of bytes (cherry picked from commit 68ca330cbd)
  ...

Conflicts:
	ffmpeg.c
	libavdevice/alsa-audio.h
	libavformat/gxf.c
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-22 01:10:24 +02:00
Michael Niedermayer
596762f058 mp3demux: pass on error code on packet read.
Reported-by: Tanami, Ohad
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c83442b057)
2011-09-21 21:04:51 +02:00
Laurent Aimar
3899b3be0c rmdec: Reject invalid deinterleaving parameters
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-21 21:04:51 +02:00
Kostya Shishkov
5163de0873 Use deinterleavers for demangling audio packets in RealMedia.
Unlike other containers RealMedia stores its audio packets in scrambled form,
with interleaver ID preceeding audio codec ID. Currently deinterleaving
decision is tied to the codec while it's possible to have non-default
deinterleaver with audio codec (like Int0 deinterleaver instead of specific
one for Sipro).

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-21 21:04:51 +02:00
Laurent Aimar
27128d82fa rmdec: use the deinterleaving mode and not the codec when creating audio packets.
It prevents crashes due to non initialized fields.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 3e033da847)
2011-09-21 20:56:53 +02:00
Carl Eugen Hoyos
9442f50c33 Support 3IVD in isom, produced by 3ivx DivX Doctor.
Fixes ticket #486.
(cherry picked from commit 4a9b069b67)
2011-09-21 20:56:53 +02:00
Arne de Bruijn
89bd2307f5 mpegpsdec: fix reading first mpegps packet
(cherry picked from commit b2f230e23d)
2011-09-21 20:56:53 +02:00