6058 Commits

Author SHA1 Message Date
Michael Niedermayer
f9225c2884 matroska_read_seek: Fix used streams for subtitle index compensation
Might fix Ticket1907 (I have no testcase so i cant test)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4758e32a6c48044f77102a49110c79b4f338f648)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-29 03:00:40 +02:00
Xi Wang
9aa60889f3 rtmp: fix buffer overflows in ff_amf_tag_contents()
A negative `size' will bypass FFMIN().  In the subsequent memcpy() call,
`size' will be considered as a large positive value, leading to a buffer
overflow.

Change the type of `size' to unsigned int to avoid buffer overflow, and
simplify overflow checks accordingly.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4e692374f7962ea358c329de38c380103f8991b6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-23 05:55:32 +01:00
Xi Wang
636c42de19 rtmp: fix multiple broken overflow checks
Sanity checks like `data + size >= data_end || data + size < data' are
broken, because `data + size < data' assumes pointer overflow, which is
undefined behavior in C.  Many compilers such as gcc/clang optimize such
checks away.

Use `size < 0 || size >= data_end - data' instead.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 902cfe2f74d777a7dc20ac68f2393b9f84b790c1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-23 05:55:30 +01:00
Michael Niedermayer
f48d1fb167 Merge remote-tracking branch 'qatar/release/0.6' into release/0.6
* qatar/release/0.6:
  vorbis: Validate that the floor 1 X values contain no duplicates.
  lavfi: avfilter_merge_formats: handle case where inputs are same
  mpegvideo: Don't use ff_mspel_motion() for vc1
  imgconvert: avoid undefined left shift in avcodec_find_best_pix_fmt
  nuv: check RTjpeg header for validity
  vc1dec: add flush function for WMV9 and VC-1 decoders
  mov: set AVCodecContext.width/height for h264
  h264: allow cropping to AVCodecContext.width/height

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-16 18:00:02 +02:00
Carl Eugen Hoyos
7923490712 Fix muxing mjpeg in swf. 2012-09-13 09:26:55 +02:00
Mans Rullgard
44e6cf3f75 mov: set AVCodecContext.width/height for h264
This is required for correct cropping of files from Canon
cameras.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 2fb4be9a99a2c2a9435339830e3d940171cc0d9b)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 0054d70f23edd1f61a10a1c2c687b3a04831feb9)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-06-10 11:24:14 +02:00
Ronald S. Bultje
679de9b5aa ea: check chunk_size for validity.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 273e6af47b38391f2bcc157cca0423fe7fcbf55c)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 6a86b705e1d4b72f0dddfbe23ad3eed9947001d5)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit e74bc64dd376c4691a610ba62a66ed30affc97ec)

Conflicts:

	libavformat/electronicarts.c
2012-06-03 21:35:17 +02:00
Alex Converse
a8f4db0acd dv: Fix small stack overread related to CVE-2011-3929 and CVE-2011-3936.
Found with asan.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Alex Converse <alex.converse@gmail.com>
(cherry picked from commit 2d1c0dea5f6b91bec7f5fa53ec050913d851e366)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 00fa6ffe1a0b252d6a81815e51f125225cd0b97a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-04-08 11:23:19 +02:00
Michael Niedermayer
b46141b0d1 dv: Fix null pointer dereference due to ach=0
dv: Fix null pointer dereference due to ach=0

Fixes part2 of CVE-2011-3929

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Roman Shaposhnik <roman@shaposhnik.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Alex Converse <alex.converse@gmail.com>
(cherry picked from commit 5a396bb3a66a61a68b80f2369d0249729bf85e04)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 44e182d41e3a73548f3f5e8445ec428d3846e6d6)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-04-08 11:23:19 +02:00
Michael Niedermayer
38421f27b3 dv: check stype
dv: check stype

Fixes part1 of CVE-2011-3929
Possibly fixes part of CVE-2011-3936

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Roman Shaposhnik <roman@shaposhnik.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Alex Converse <alex.converse@gmail.com>
(cherry picked from commit 635bcfccd439480003b74a665b5aa7c872c1ad6b)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit bb737d381f6d6413899a0697f426fb082eac66fc)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-04-08 11:23:19 +02:00
Alex Converse
3253dd2b42 nsvdec: Propagate errors
Related to CVE-2011-3940.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit c898431ca5ef2a997fe9388b650f658fb60783e5)

Conflicts:

	libavformat/nsvdec.c

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 0100c4b1b0736e0f5b3c98f9b0ab8acbef574888)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-04-08 11:23:19 +02:00
Alex Converse
87007519c8 nsvdec: Be more careful with av_malloc().
Check results for av_malloc() and fix an overflow in one call.

Related to CVE-2011-3940.

Based in part on work from Michael Niedermayer.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 8fd8a48263ff1437f9d02d7e78dc63efb9b5ed3a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit be524c186b50337db64d34a5726dfe3e8ea94f09)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-04-08 11:23:19 +02:00
Michael Niedermayer
1edf848a81 nsvdec: Fix use of uninitialized streams.
Fixes CVE-2011-3940 (Out of bounds read resulting in out of bounds write)

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5c011706bc752d34bc6ada31d7df2ca0c9af7c6b)

Signed-off-by: Alex Converse <alex.converse@gmail.com>
(cherry picked from commit 6a89b41d9780325ba6d89a37f2aeb925aa68e6a3)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 65beb8c1173906b0541442713cb29e8ba44c47ef)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-04-08 11:23:19 +02:00
Anton Khirnov
f70c720d42 id3v2: fix skipping extended header in id3v2.4
In v2.4, the length includes the length field itself.
(cherry picked from commit ddb4431208745ea270dce8fce4cba999f0ed4303)

Conflicts:

	libavformat/id3v2.c

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-04-01 19:35:11 +02:00
Chris Evans
90a4a46747 matroskadec: Fix a bug where a pointer was cached to an array that might later move due to a realloc()
Fixes bug #190
Chromium bug #100492
related to CVE-2011-3893

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

(cherry-picked from commit faaec4676cb4c7a2303d50df66c6290bc96a7657)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 1f625431e2bb9564760fba3ab8077ae07ce7c7a1)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-01-07 22:03:48 +01:00
Laurent Aimar
23f622de60 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 0e7efb9d23c3641d50caa288818e8c27647ce74d)

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-12-24 12:20:33 +01:00
Laurent Aimar
9f28eede5e Fixed off by one packet size allocation in the smacker demuxer.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit a92d0fa5d234582583d41b67dddecffc2c819573)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-12-24 12:20:33 +01:00
Laurent Aimar
6f70111e81 Check for invalid packet size in the smacker demuxer.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e055932f5636a82275837968eea9c8fcb5bca474)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-12-24 12:20:33 +01:00
Laurent Aimar
4492523938 ape demuxer: fix segfault on memory allocation failure.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 273aab99bf7be2bcda95dd64101c2317ee0fcb99)

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-12-24 12:20:33 +01:00
Kostya Shishkov
f79f3a946f smacker demuxer: handle possible av_realloc() failure.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 47a8589f7bc69d1a29da1dfdfbd0dfa78a9e31fd)

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

Conflicts:

	libavformat/smacker.c

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-12-24 12:20:33 +01:00
Luca Barbato
973bdafe05 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 7f5bf4fbaf1f2142547321a16358f9871fabdcc6)

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

Conflicts:

	libavformat/flvenc.c

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-12-24 12:20:32 +01:00
Alex Converse
e07086d8ae 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 1f6f58d5855288492fc2640a9f1035c01c75d356)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-11-05 13:18:32 +01:00
Jindrich Makovicka
002e6d185c 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 8923cfa328e8eb565aebcfe8672b276fd1c19bf7)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-11-05 13:18:32 +01:00
Clément Bœsch
86849f0976 mxfenc: fix ignored drop flag in binary timecode representation.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 4d5e7ab5c48451404038706ef3113c9925a83087)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-11-05 13:18:32 +01:00
Alex Converse
394c3e78d5 riff: Add mpgv MPEG-2 fourcc
Supported by mplayer and seen in the wild.
(cherry picked from commit 505345ed5d180093a44da8d70ac541898c31c22f)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-11-05 13:18:31 +01:00
Tomas Härdin
2fc39af1de Added M701 codec_tag for mpeg2video
Originally committed as revision 23513 to svn://svn.ffmpeg.org/ffmpeg/trunk
(cherry picked from commit 77d3f1f792c2a0bd455c75b0aa8e356b3a470ea7)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-11-05 13:18:31 +01:00
Michael Niedermayer
222d18ab20 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 956c901c68eff78288f40e3c8f41ee2fa081d4a8)

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 77d2ef13a8fa630e5081f14bde3fd20f84c90aec)

NB: MSVR-11-0080 doesn't seem to exist. This issue seems to be known
as MSVR11-011 instead.

Fixes: CVE-2011-3504

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-11-05 12:31:43 +01:00
Chris Evans
88ea7ca627 oggdec: prevent heap corruption.
Specifically crafted samples can reinit ogg->streams[] while
reading samples, and thus we should not cache old pointers since
these may no longer be valid.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry-picked from commit 4cc3467e7abfea7e8d03b6af511f7719038a5a98)
2011-08-04 22:01:25 +02:00
Reinhard Tartler
9848e1be2d lavf: inspect more frames for fps when container time base is coarse
As per issue2629, most 23.976fps matroska H.264 files are incorrectly
detected as 24fps, as the matroska timestamps usually have only
millisecond precision.

Fix that by doubling the amount of timestamps inspected for frame rate
for streams that have coarse time base. This also fixes 29.970 detection
in matroska.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 78431098f9e306ebe27e7698d0ae539e3df2afe9)

Tested with mplayer based on this report
http://thread.gmane.org/gmane.comp.video.mplayer.user/66043/focus=66063

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 7c152a458d3fb0a2fb1aef1f05bfee90fe70697e)
2011-04-30 08:18:32 +02:00
Janne Grunau
dda2062c31 consolidate .gitignore patters into a single file
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
(cherry picked from commit 2c3589bfda036c7827ded0bf38b16dfe7630bae1)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-03-18 17:47:01 +01:00
Janne Grunau
5d01cd8429 convert svn:ignore properties to .gitignore files
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
(cherry picked from commit 348b8218f7a59374355c966dbe3b851a7275f952)
2011-03-18 17:46:29 +01:00
Kostya
f9bf2a4ab1 Do not attempt to decode APE file with no frames
This fixes invalid reads/writes with this sample:
http://packetstorm.linuxsecurity.com/1103-exploits/vlc105-dos.txt
(cherry picked from commit 8312e3fc9041027a33c8bc667bb99740fdf41dd5)
2011-03-18 17:02:34 +01:00
Reinhard Tartler
93883b0c39 aviobuf: Do short seeks forward by reading and skipping data instead of a proper seek
This improves performance on e.g. seekable http.


backport r24280 by mstorsjo


Originally committed as revision 24335 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-07-19 19:51:29 +00:00
Google
9d1213912f Add VP80 fourcc
Patch by Google

backport r23193 by conrad


Originally committed as revision 23863 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-06-28 20:38:36 +00:00
Reinhard Tartler
edf5072fea Doxygen av_codec_get_id() and av_codec_get_tag().
backport r23102 by stefano


Originally committed as revision 23801 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-06-26 15:32:27 +00:00
Reinhard Tartler
522f1861ca Add compatibility wrappers for functions moved from lavf to lavc
When symbol versioning is enabled, moving symbols from one library to
another breaks binary compatibility.  This adds wrappers with the old
version tag for the av_*packet functions recently moved to lavc.

backport r23611 by mru


Originally committed as revision 23613 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-06-15 13:31:27 +00:00
Reinhard Tartler
44f91788a5 revert r23610, better patch is pending
Originally committed as revision 23612 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-06-15 13:29:20 +00:00
Reinhard Tartler
03b47bb8d7 add symver hacks for gnu linkers
this patch restores binary compatibility for the av_*_packet symbols that have
been moved from libavformat to libavcodec.  This patch works for gnu toolchains
only; support for ARM RCVT will be handed in for a later point release as soon
as the patch is ready and approved by the ARM maintainer(s).


Originally committed as revision 23610 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-06-15 12:29:19 +00:00
James Zern
db06ddf8c6 Add WebM muxer
Patch by James Zern <jzern at google>

backport r23474 by conrad


Originally committed as revision 23549 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-06-09 15:54:27 +00:00
Reinhard Tartler
55291e37f5 Samsung uses SIPP as FourCC for MPEG-4 ASP.
backport r23309 by cehoyos


Originally committed as revision 23384 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-05-29 14:45:13 +00:00
Google
9052b5b73b matroska: Add V_VP8
Patch by Google

backport r23192 by conrad


Originally committed as revision 23376 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-05-29 14:11:03 +00:00
Reinhard Tartler
df62b0d9f5 Display a more descriptive log message when probe buffer limit is
reached.



backport r23288 by jai_menon


Originally committed as revision 23373 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-05-29 13:11:56 +00:00
Reinhard Tartler
7920dc8802 matroskaenc: Write codec time base as default duration for video tracks.
This isn't exactly semantically equivalent, but the field has already been
long abused to mean this, and writing it helps in determining a decent cfr
time base when transcoding from a mkv where the video codec stores none (VP8).

backport r23284 by conrad


Originally committed as revision 23365 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-05-28 20:35:13 +00:00
Reinhard Tartler
057287c9cd Reduce the score for the aea demuxer probing function.
backport r23273 by banan


Originally committed as revision 23356 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-05-27 20:48:19 +00:00
Reinhard Tartler
1746657479 Fix detection of some stereo atrac files by not comparing the
block size mode and info byte.


backport r23272 by banan


Originally committed as revision 23355 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-05-27 20:47:48 +00:00
Reinhard Tartler
0ff244dea2 write 3gp perf tag for artist metadata
backport r23268 by bcoudurier


Originally committed as revision 23354 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-05-27 20:47:03 +00:00
Reinhard Tartler
0078216f07 change author metadata to artist in mov de/muxer
backport r23266 by bcoudurier


Originally committed as revision 23353 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-05-27 20:40:09 +00:00
Reinhard Tartler
b5afece607 matroskaenc: Don't write track timecode scale
It's not required for mkv and unsupported in webm

backport r23247 by conrad


Originally committed as revision 23315 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-05-25 18:22:30 +00:00
Reinhard Tartler
6ae05f541a matroskadec: Allow unknown EBML doctype
backport r23246 by conrad


Originally committed as revision 23314 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-05-25 18:21:59 +00:00
James Zern
9d3bb3501d matroskadec: Support webm doctype
Patch by James Zern <jzern at google>

backport r23245 by conrad


Originally committed as revision 23313 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
2010-05-25 18:20:59 +00:00