Commit Graph

68681 Commits

Author SHA1 Message Date
Michael Niedermayer 00ae76c3d0 ffmpeg: Use correct codec_id for av_parser_change() check
No testcase known

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 45f3d4e63e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer 58e424cdee ffmpeg: Check av_parser_change() for failure
No testcase known

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ac0ba6f233)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Michael Niedermayer 5ab1f18853 ffmpeg: Check for RAWVIDEO and do not relay only on AVFMT_RAWPICTURE
The null muxer has AVFMT_RAWPICTURE set but can be fed with non-raw material

related to Ticket4778

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c8890941d6)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Michael Niedermayer 60e398f280 ffmpeg: check avpicture_fill() return value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 15ff3f3fdf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Michael Niedermayer 905853cd40 avformat/mux: Update sidedata in ff_write_chained()
Fixes Ticket4777

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit db91e0edb6)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Michael Niedermayer e11f85a4a5 avcodec/flashsvenc: Correct max dimension in error message
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b1f59bb660)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Michael Niedermayer 0bdf0cfa00 avcodec/svq1enc: Check dimensions
Fixes assertion failure

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 88fe45e0fe)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Michael Niedermayer 27ffd266fc avcodec/dcaenc: clear bitstream end
This avoids leaving uninitialized bits in the output

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e322b7061f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Emanuel Czirai 3d1cbf388d libavcodec/aacdec_template: Use init_get_bits8() in aac_decode_frame()
related to ticket4749

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7ab1c57a64)

Conflicts:

	libavcodec/aacdec_template.c
(cherry picked from commit dabb6dd98af52a22a922bca4a9196acf68b084dd)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Andreas Cadhalpun cc0e35c441 mxfdec: check edit_rate also for physical_track
Previously only the edit_rate of material_track was checked.
If it's negative, it causes assertion failures in av_rescale_rnd.

Reviewed-by: Tim Nicholson <nichot20-at-yahoo.com@ffmpeg.org>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 047bf82c18)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun d52df5cffa mpegvideo: clear overread in clear_context
Otherwise the h263p decoder can try to copy overread bytes, even though
buffer is NULL.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 6a69a175e7)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun b6a4abc770 dvdsubdec: validate offset2 similar to offset1
If it is negative, it causes segmentation faults in decode_rle.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f621749d11)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Michael Niedermayer 8beb5d17f1 avcodec/takdec: Use memove, avoid undefined memcpy() use
Fixes: e214333cbd94c91228e624ff39329ce6/asan_generic_4a5159_6412_96cda2530e80607210ab41ccae3d456d.tak

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7cea3430a5)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun 4636eb8968 jvdec: avoid unsigned overflow in comparison
The return type of strlen is size_t, i.e. unsigned, so if pd->buf_size
is 3, the right side overflows leading to a wrong result of the
comparison and subsequently a heap buffer overflow.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit db374790c7)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Michael Niedermayer 54133b7aeb avcodec/mpeg12dec: Do not call show_bits() with invalid bits
Fixes assertion failure
Fixes: 63e50545709a6440d3d59f6426d58db9/signal_sigabrt_7ffff6ae7cc9_8189_3272a3010fd98ddf947c662bbde1ac13.ts

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 973c3dba27)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun 0cf02e015b riffdec: prevent negative bit rate
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 189420cb56)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Michael Niedermayer 4202e9d972 Merge commit 'd80811c94e068085aab797f9ba35790529126f85'
* 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>
(cherry picked from commit ba77fb61f7)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun 6c36f0b57c imc: use correct position for flcoeffs2 calculation
flcoeffs2[pos] should be the log2 of flcoeffs1[pos].
flcoeffs1[0] can be 0 here, thus flcoeffs2[pos] gets set to -inf,
causing problems further down.

This seems to have been copied from imc_decode_level_coefficients in
commit 4eb4bb3 without updating the position.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 75fd5ce4c1)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun 10bf3c2559 wavpack: limit extra_bits to 32 and use get_bits_long
More than 32 bits can't be stored in an integer and get_bits should not
be used with more than 25 bits.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit d0eff8857c)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun 87781f952b wavpack: use get_bits_long to read up to 32 bits
get_bits should not be used for more than 25 bits.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f9883a669c)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun 85ef06c666 nutdec: check maxpos in read_sm_data before returning success
Otherwise sm_size can be larger than size, which results in a negative
packet size.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 6b9fdf7f4f)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun d4aeaa2173 s302m: fix arithmetic exception
If nb_samples is zero, the bit_rate calculation results in a division by
zero.

Since ff_get_buffer fails if frame->nb_samples is zero, this can be
fixed by moving the bit_rate calculation after that function call.

That also makes it possible to reuse the already calculated
frame->nb_samples value.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 04dfbc9441)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:55 +01:00
Michael Niedermayer 761bd6df06 avcodec/s302m: Only set the sample rate when some data is output
This way ffplay chooses the mp2 stream for Ticket3890

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 802cca5905)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:55 +01:00
Ronald S. Bultje 1548223d29 vp9: add support for resolution changes in inter frames.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e8b4f6d6be)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:55 +01:00
Andreas Cadhalpun cd76447d3d alsdec: limit avctx->bits_per_raw_sample to 32
avctx->bits_per_raw_sample is used in get_sbits_long, which only
supports up to 32 bits.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4c2b88678b)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:55 +01:00
wm4 22dbde85e7 vp9: avoid infinite loop with broken files
With a certain fuzzed file, the parser will always return 0 consumed
bytes, which makes calling code call the parser infinitely. Return the
full packet size on error instead. (Here it would be nice if parsers
could return errors at all.)

Additionally, _if_ there's some data left, return that too, which might
help with somewhat broken but still somehow playable files.

Fixes ticket #4242.

Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 09b4ad1568)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:52 +01:00
Ronald S. Bultje 11579f7e4e videodsp: don't overread edges in vfix3 emu_edge.
Fixes trac ticket 3226. Also see Andreas' analysis in
https://bugs.debian.org/801745, which was very helpful.
(cherry picked from commit 52f84d82bd)
2015-10-25 01:17:03 +02:00
Michael Niedermayer 8b158bf62c avcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size check
Fixes Ticket4778

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2bb54b82b5)
2015-10-09 21:58:11 +02:00
Michael Niedermayer 1024bcab62 avformat/oggenc: Check segments_count for headers too
Fixes infinite loop and segfault in ogg_buffer_data()
Fixes Ticket4806

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 81a8701eb5)
2015-10-09 21:58:00 +02:00
Michael Niedermayer 66b6ab355d avformat/avidec: Workaround broken initial frame
Fixes Ticket4851

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3e2ef00394)
2015-10-09 21:57:24 +02:00
Hendrik Leppkes 7b6fced6b4 hevc: properly handle no_rasl_output_flag when removing pictures from the DPB
Fixes ticket #4185.

Reviewed-By: Mickael Raulet <Mickael.Raulet@insa-rennes.fr>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
(cherry picked from commit 0118158efa)
2015-10-09 21:57:05 +02:00
Ronald S. Bultje cac62c8ad9 hevc: fix wpp threading deadlock.
Fixes ticket 4258.
(cherry picked from commit 74e4948235)
2015-10-09 21:56:52 +02:00
Michael Niedermayer 3b7d4d8bd6 avcodec/ffv1: seperate slice_count from max_slice_count
Fix segfault with too large slice_count
Fixes Ticket4879

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit aa6c43f3fd)

Conflicts:
	libavcodec/ffv1enc.c
	libavcodec/ffv1.c
2015-10-09 21:56:33 +02:00
Przemysław Sobala eb681e1fac lavf/img2dec: Fix memory leak
Fixes #4886

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 01dd7e025c)
2015-10-09 21:56:15 +02:00
wm4 9177bcc06c avcodec/mp3: fix skipping zeros
Commits 43bc5cf9 and c5371f77 add code for skipping initial zeros in mp3
packets. This code forgot to report to the user that data was skipped at
all.

Since audio codecs allow partial packet decoding, the user application
has to rely on the return value. It will remove the data reported as
consumed by the decoder, and feed it to the decoder again. This resulted
in the mp3 frame after the zero region to be decoded over and over
again, until the zero region was finally skipped by the application.

Fix this by including the amount of skipped bytes to the number of
consumed bytes returned by the decode call.

Fixes trac ticket #4890.
(cherry picked from commit cb1da9fb8d)
2015-10-09 21:56:00 +02:00
Clément Bœsch f2c07de0a5 avformat/srtdec: make sure we probe a number
Fixes regression since 7218352e0228028dfa009a3799ec93fd041065f1: WebVTT
files were matching the SRT probing.
(cherry picked from commit 40d9d6de90)
2015-10-09 21:55:47 +02:00
Clément Bœsch 2e575c1e8d avformat/srtdec: more lenient first line probing
Fixes Ticket #4898
(cherry picked from commit 7218352e02)
2015-10-09 21:55:34 +02:00
James Almer 628479b096 doc: mention libavcodec can decode Opus natively
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit fd9ac48dc8)
2015-09-20 23:27:45 -03:00
Michael Niedermayer af098adca3 MAINTAINERS: Remove myself as leader
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f2c58931e6)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-31 18:35:31 +02:00
wm4 1eb646ec9f rawdec: fix mjpeg probing buffer size check
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4c6beaed92)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-30 19:27:45 +02:00
wm4 c809cf1c5b rawdec: fix mjpeg probing
There can be other headers than "Content-Type:" (in this case, a
"Content-Length:" header was following), so checking for a trailing
newline is wrong.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bf51fcd304)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-30 19:27:45 +02:00
Andreas Cadhalpun 5e833d958c Changelog update
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:54:25 +02:00
Andreas Cadhalpun ffcfab882b snow: remove an obsolete av_assert2
It asserts that the frame linesize is larger than 37, but it can be
smaller and decoding such frames works.

Before commit cc884a35 src_stride > 7*MB_SIZE was necessary, because the
blocks were interleaved in the tmp buffer and the last block was added
with an offset of 6*MB_SIZE.
It was changed for src_stride <= 7*MB_SIZE to write the blocks
sequentially, hence the larger tmp_step.
After that the assert was only necessary to make sure that the buffer
remained large enough.
Since commit bd2b6b33 s->scratchbuf is used as tmp buffer.
As part of commit 86e107a7 the minimal scratchbuf size was increased to
256*7*MB_SIZE, which is enough for any src_stride <= 7*MB_SIZE.

Also add a comment explaining the tmp_step calculation.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 3526a120f9)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:53:34 +02:00
Andreas Cadhalpun d8c82ed321 huffyuvdec: validate image size
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9a345802ed)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:53:29 +02:00
Andreas Cadhalpun 983dc64772 vc1dec: use get_bits_long and limit the read bits to 32
get_bits should not be used with more than 25 bits.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 1f1e0a2971)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:53:24 +02:00
Andreas Cadhalpun 98aedbf9fe mpegaudiodec: copy AVFloatDSPContext from first context to all contexts
This fixes a segfault when decoding multi-channel MP3onMP4 files.

This is similar to commit cb72230d for MPADSPContext.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 151dbe4579)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:53:19 +02:00
Andreas Cadhalpun 18189ebab3 libshine: fix support for shine 3.0
shine_encode_buffer expects written to be an int pointer, while the
previous shine_encode_frame expected it to be a long pointer.

Thus encoding with libshine currently always fails with
"internal buffer too small", because a negative return value of
shine_encode_buffer is interpreted as a very large long value.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit e48a9ac9af)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:53:15 +02:00
Andreas Cadhalpun 74a88a509c avidec: check for valid bit_rate range
If bit_rate is negative, it can trigger an av_assert2 in av_rescale_rnd.

Since av_rescale returns int64_t, but st->codec_bit_rate is int, it can
also overflow into a negative value.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0eec40b713)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:53:10 +02:00
Paul B Mahol ff68bf7a1b avformat/nut: support WavPack
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 64815d1f0c)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:53:05 +02:00
Michael Niedermayer ef905b1b27 avcodec/diracdec: Check slices malloc and propagate error code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a4d3cf10b2)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:52:58 +02:00