Commit Graph

72005 Commits

Author SHA1 Message Date
Luca Barbato
0ac8ff618c avresample: Reallocate the internal buffer to the correct size
Fixes the corner case in which the internal buffer size
is larger than input buffer provided and resizing it
before moving the left over samples would make it write
to now unallocated memory.

Bug-Id: 825
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-04-28 23:51:51 +02:00
Andreas Cadhalpun
7c24ca1bda nutdec: fix illegal count check in decode_main_header
The existing check has two problems:
 1) i + count can overflow, so that the check '< 256' returns true.
 2) In the (i == 'N') case occurs a j-- so that the loop runs once more.

This can trigger the assertion 'nut->header_len[0] == 0' or cause
segmentation faults or infinite hangs.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-28 22:56:14 +02:00
Andreas Cadhalpun
361702660d nutdec: fix memleaks on error in nut_read_header
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-28 22:38:04 +02:00
Andreas Cadhalpun
3ff1af2b0d nutdec: check chapter creation in decode_info_header
This fixes a segmentation fault when accessing the metadata.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-28 22:22:48 +02:00
John Högberg
82de8d7111 mpegts: Update the PSI/SI table only if the version change
If a PAT is finished while a PMT section filter is opened but
not yet finished, the PMT section filter is closed and all
the received data is discarded.

This is usually not an issue but some multiplexers (With very
quick PAT/PMT repetition settings) consistently emit a PMT
section start, then a PAT, and then the rest of the PMT,
causing the aforementioned behavior to result in no PMT being
finished.

In the most pathologic situation the stream information are lost
and the probe fallback miscategorizes subtitles as mp3 audio.

Avoid the issue through eliminating redundant PSI/SI table
updates by checking their version field, which is required by
the standard to be incremented on every change no matter how
minor.

CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-04-28 21:09:59 +02:00
Andreas Cadhalpun
6621105877 nutdec: check for negative frame rate in decode_info_header
A negative frame rate triggers an av_assert2 in av_rescale_rnd.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-28 20:37:11 +02:00
Michael Niedermayer
5bebd13d2d avcodec/vqavideo: Use ff_tlog() for byte and opcode tracing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-28 19:55:39 +02:00
foo86
191dd219d9 avformat/dtsdec: Extend DTS core sync word
Check extended sync word for 16-bit LE and BE core streams to reduce
probability of alias sync detection. Previously sync word extension was
checked only for 14-bit streams.

This follows up the similar change in avcodec/dca_parser.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-28 19:29:47 +02:00
Vittorio Giovara
0c69164f45 h263: Convert function to macro 2015-04-28 16:33:09 +01:00
Vittorio Giovara
59dfc2b0c8 h263: Drop commented-out code and a related otherwise unused function 2015-04-28 16:31:05 +01:00
Vittorio Giovara
c341820130 jpeglsenc: Mark codec as init-thread-safe and init-cleanup
Fixes a memory leak on init failure.
2015-04-28 16:29:29 +01:00
Vittorio Giovara
3919a45726 jpeglsenc: Check memory allocations
Convert exisiting free functions to av_freep() to avoid accidental
double frees, and always intialize all buffers to NULL.
2015-04-28 16:27:16 +01:00
Vittorio Giovara
f5ba67ee13 flacenc: Move a scratch buffer to struct used by the function
This avoids allocating/freeing memory at every function call,
checking its return value, and carrying the error around.
2015-04-28 16:25:09 +01:00
Michael Niedermayer
e2877bdf38 ffmpeg: remove incorrect network deinit
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-28 15:57:21 +02:00
Andreas Cadhalpun
699341d647 apedec: prevent out of array writes in decode_array_0000
s->decoded_buffer is allocated with a min_size of:
    2 * FFALIGN(blockstodecode, 8) * sizeof(*s->decoded_buffer)

Then it is assigned to s->decoded[0] (and s->decoded_buffer + FFALIGN(blockstodecode, 8)
to s->decoded[1]) and passed as out buffer to decode_array_0000.

In this function 64 elements of the out buffer are written
unconditionally and outside the array if blockstodecode is too small.

This causes memory corruption, leading to segmentation faults or other
crashes.

Thus change decode_array_0000 to write at most blockstodecode elements
of the out buffer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-28 12:43:13 +02:00
Maneesh Gupta
91305c6026 OpenCL: Fix ABI incompatibility issues
AVOpenCLDeviceNode and AVOpenCLPlatformNode used fixed static buffer for holding the device and platform name.
This patch modifies these structures to use pointers instead. The memory required to hold the names is
now dynamically allocated, the size for which is determined by querying appropriate OpenCL runtime APIs.

Signed-off-by: Maneesh Gupta <maneesh.gupta@amd.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-28 12:28:53 +02:00
Maneesh Gupta
cf234552b8 OpenCL: Avoid potential buffer overflow in cmdutils_opencl.c
The opt_opencl_bench function copied the device name using strcpy without checking if the source string was larger.
This patch fixes this by replacing the strcpy with av_strlcpy, with the string copy size capped to the destination buffer size.

Signed-off-by: Maneesh Gupta <maneesh.gupta@amd.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-28 12:18:23 +02:00
Vignesh Venkatasubramanian
b410c69fb6 webmdashenc: Fix UTCTiming Element
Remove the direct profile from UTCTiming element. Per DASH spec,
direct profile value should be the time at which the request was
made to the server and not the time at which the manifest was
written. So ffmpeg cannot write this value. This patch removes
the direct profile and write the UTCTiming element with the http
profile only if a URL is passed as a parameter. Update the fate
test to reflect this change.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-28 03:39:07 +02:00
Andreas Cadhalpun
464c49155c apedec: set s->samples only when init_frame_decoder succeeded
Otherwise range_start_decoding is not necessarily run and thus
ctx->rc.range still 0 in range_dec_normalize leading to an infinite
loop.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-28 03:21:12 +02:00
Vignesh Venkatasubramanian
8ca170a78a libavformat/webm_chunk: Write first audio packet.
Fix a bug where the chunk muxer doesn't write the very first audio
packet (with pts == 0).

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-28 02:27:01 +02:00
Michael Niedermayer
0e7444f6e4 avcodec/hevc: Remove current_sps
The variable should not be needed anymore

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-28 00:04:58 +02:00
Clément Bœsch
2879a4ecb9 tests: make sure subtitles tests are run with a rawdiff
This will test properly CRLF with make fate, make fate-subtitles and any
make fate-sub-* test. Before this commit, the rawdiff was triggered only
by make fate-subtitles.

Also make sure fate-sub-* only match the tests relying on fmtstdout
command, to at least avoid failing on MingW. See
https://ffmpeg.org/pipermail/ffmpeg-devel/2015-April/172395.html
2015-04-27 18:25:38 +02:00
Clément Bœsch
11d29277d6 tests/subtitles: fix microdvd crlf in ref 2015-04-27 18:23:32 +02:00
Alexis Ballier
6fe2afaa71 Adapt libavcodec/tableprint_vlc.h to the av_dlog -> ff_dlog change.
This fixes the build with --enable-hardcoded-tables that was broken since [8f7b022c8c].

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-27 17:57:50 +02:00
ZhouXiaoyong
4a7b50679d makefile: add Loongson-3 support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-27 14:10:28 +02:00
Rong Yan
8a03d428f1 avcodec/ppc/fdctdsp: POWER LE support in ff_fdct_altivec() delete macros VEC_FMERGEH() VEC_FMERGEL(), they where wrong
GCC tool had a bug of PPC intrinsic interpret, which has been fixed in GCC 4.9.1. This bug lead to
errors in two of our previous patches. We found this when we update our GCC tools to 4.9.1 and by
reading the related info on GCC website. We fix our previous error in two separate commits

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-27 12:59:15 +02:00
Rong Yan
603c839398 swscale/ppc/swscale_altivec.c: POWER LE support in yuv2planeX_8() delete macro GET_VF() it was wrong
GCC tool had a bug of PPC intrinsic interpret, which has been fixed in GCC 4.9.1. This bug lead to
errors in two of our previous patches. We found this when we update our GCC tools to 4.9.1 and by
reading the related info on GCC website. We fix our previous error in two separate commits

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-27 12:59:05 +02:00
Michael Niedermayer
46778ab212 avformat/aviobuf: Do not resize the buffer in ffio_ensure_seekback() if there is no read function
Without a read function there can never be more data read than the buffer could
hold

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-27 05:06:36 +02:00
ZhouXiaoyong
0ace686ae8 avcodec: optimize mathops for Loongson-3 v1
HAVE_LOONGSON is replaced by HAVE_LOONGSON3. Even Loongson-2E and 2F support
Loongson SIMD instructs but have low performance for decoding. We plan to focus
on optimizing Loongson-3A1000, 3B1500 and 3A1500, and modify the configure file
to support Loongson-2 series later by adding HAVE_LOONGSON2.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-27 02:25:12 +02:00
Michael Niedermayer
4b8a819496 avcodec/ffv1enc: set bits_per_raw_sample for 8bit based formats
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-26 21:23:14 +02:00
Michael Niedermayer
81e40c26e1 avcodec/ffv1enc: Ensure that bits per raw sample is valid
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-26 21:09:17 +02:00
Matteo Nastasi (mop)
9c3c7b4579 avutil/log: more complete description of av_log function 2015-04-26 16:34:06 +02:00
Michael Niedermayer
7104301638 avcodec/rv10: Use ff_tlog() for block level tracing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-26 16:29:23 +02:00
Michael Niedermayer
e06dde52d7 avcodec/dvbsubdec: Do not return a value from a function returning void
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-26 13:47:12 +02:00
Michael Niedermayer
0b13f42238 avcodec/interplayvideo: Use ff_tlog() for block level decode tracing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-26 12:59:44 +02:00
Michael Niedermayer
febbb3cbd3 avcodec/h264_slice: Change a few asserts to av_assert*
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-26 12:59:30 +02:00
Michael Niedermayer
fa2d3b6dbe Merge commit '5aed1d4240d411533c102eec6944aa925b7f4964'
* commit '5aed1d4240d411533c102eec6944aa925b7f4964':
  vaapi: Fix -Wimplicit-function-declaration for ff_dlog() usage

See: 8f7b022c8c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-26 01:22:39 +02:00
Michael Niedermayer
7b94a2f4b1 avcodec/ituh263dec: Use ff_tlog() for block level information
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-26 01:00:05 +02:00
Michael Niedermayer
d52a8bf158 avcodec/h264_cabac: Use ff_tlog() for block level information
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-26 00:58:51 +02:00
Rico Tzschichholz
5aed1d4240 vaapi: Fix -Wimplicit-function-declaration for ff_dlog() usage
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-04-26 00:07:41 +02:00
Michael Niedermayer
9d3357391c avcodec/mpeg12dec: Make ff_dlog() messages more clear
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 20:23:28 +02:00
Michael Niedermayer
f4c311fef4 avcodec/mpeg12dec: Change mb decode tracing stuff to use ff_tlog()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 19:42:49 +02:00
Michael Niedermayer
a3110beebd avutil/softfloat: document av_int2sf()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 14:51:02 +02:00
ZhouXiaoyong
663321ed50 configure: add Loongson-3 support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 13:45:19 +02:00
ZhouXiaoyong
6c5ef7f657 avcodec/mips: disable assembly not supported for Loongson-3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 13:17:28 +02:00
Michael Niedermayer
d49210788b avcodec/snowenc: Mark as FF_CODEC_CAP_INIT_THREADSAFE and FF_CODEC_CAP_INIT_CLEANUP
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 12:58:17 +02:00
Michael Niedermayer
ee8ce211ea libavcodec/snowdec: Mark as FF_CODEC_CAP_INIT_THREADSAFE and FF_CODEC_CAP_INIT_CLEANUP
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 04:50:47 +02:00
Michael Niedermayer
75a730a22b avformat/format: Add generic trace av_log in av_probe_input_format3()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 03:43:59 +02:00
Niklesh
0ec3abeb8d avcodec/movtextdec: Decoding of Bold-Italic_Underlined styles for 3gpp timed text subtitles
Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in>
Previous version reviewed-by: Philip Langdale <philipl@overt.org>
Previous version reviewed-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-25 00:23:44 +02:00
Michael Niedermayer
cea62a90c0 Merge commit 'cfdaa4de6c496b0b761c763cd18067cb1af268a7'
* commit 'cfdaa4de6c496b0b761c763cd18067cb1af268a7':
  dss_sp: use lowercase codec name without whitespace

See: 35e855d5b6
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-24 23:24:16 +02:00