1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00
Commit Graph

17097 Commits

Author SHA1 Message Date
Michael Niedermayer
48e53620e0 avformat/mov: Do not read ACLR into extradata for H.264
Fixes regression decoding AVCI
Fixes Ticket4493

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-15 10:04:50 +02:00
Vittorio Giovara
536093824d lavf: Reset global flag on deinit
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32da94fa7f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-15 10:04:50 +02:00
Vittorio Giovara
485f53548b network: Do not leave context locked on error
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 45340f9fc7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-15 10:04:50 +02:00
Michael Niedermayer
b942813a41 avformat/utils: Ensure that AVFMT_FLAG_CUSTOM_IO is set before use
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ba631b7914)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-15 10:04:50 +02:00
Michael Niedermayer
a75f293264 avformat/img2dec: do not rewind custom io buffers
Fixes double free with some applications

Fixes vlc ticket14121
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e6e8cc8ce9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-15 10:04:50 +02:00
James Almer
9fc45b313c dashenc: replace attribute id with contentType for the AdaptationSet element
id should be an integer, not a string. It is also optional, so use
contentType instead which is the proper attribute for these values.

This addresses ticket #4545, fixing an MPD validation error.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32a4177a62)
2015-05-14 20:57:24 -03:00
Michael Niedermayer
d9390b9d64 avformat/matroskaenc: Use avoid_negative_ts_use_pts if no stream writes dts
This reduces the number of cases where timestamps need to be shifted

Fixes Ticket4487

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9d4fdfe24c)
2015-05-14 19:52:02 -03:00
Michael Niedermayer
5a8b43285b avformat/mux: Add avoid_negative_ts_use_pts
This allows using pts instead of dts for negative TS avoidance

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7ac5c38ec5)
2015-05-14 19:51:55 -03:00
Andreas Cadhalpun
73cf5d9a28 cafdec: free extradata before allocating it
This fixes a memleak if read_kuki_chunk is executed more than once.

Reviewed-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit cb7c4f73e5)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:14:32 +02:00
Andreas Cadhalpun
ac83399281 cafdec: check avio_read return value
If avio_read fails, the buffer can contain uninitialized values.

Reviewed-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit a3ede6b742)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:14:19 +02:00
Andreas Cadhalpun
66b95ee4df id3v2: catch avio_read errors in check_tag
Since len is an unsigned int, the comparison is currently treated as
unsigned and thus ignores all errors from avio_read.

Thus cast len to int, which is unproblematic, because at that point len
is between 0 and 4.

This fixes 'Conditional jump or move depends on uninitialised value'
valgrind warnings in is_tag.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0382c94f13)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:13:49 +02:00
Andreas Cadhalpun
0f7e67be3a avi: Validate sample_size
And either error out or set it to 0 if it is negative.

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 4d0ee4962b)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>

Conflicts:
	libavformat/avidec.c
2015-05-14 19:13:13 +02:00
Andreas Cadhalpun
0cb8d786f2 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-05-14 19:09:47 +02:00
Michael Niedermayer
c74846388b avformat/matroskadec: Use tracks[k]->stream instead of s->streams[k]
The later is not correct

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5d309d3091)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:09:37 +02:00
Andreas Cadhalpun
35013fa23a matroskadec: check s->streams[k] before using it
This fixes a segmentation fault.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e54540655f)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:09:32 +02:00
Andreas Cadhalpun
33d77bc384 matroskadec: use uint64_t instead of int for index_scale
index_scale is set to matroska->time_scale of type uint64_t.

When index_scale is int, the assignment can overflow and e.g. result
in index_scale = 0. This causes a floating point exception due to the
division by index_scale.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eb9fb508b0)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:09:19 +02:00
Andreas Cadhalpun
2f290cf881 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>
(cherry picked from commit 7c24ca1bda)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:08:38 +02:00
Andreas Cadhalpun
2523bdcd67 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>
(cherry picked from commit 361702660d)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:08:26 +02:00
Andreas Cadhalpun
9b87d15ca8 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>
(cherry picked from commit 3ff1af2b0d)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:08:02 +02:00
Andreas Cadhalpun
a13a288ec8 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>
(cherry picked from commit 6621105877)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:07:55 +02:00
Andreas Cadhalpun
787e094ed0 bink: check vst->index_entries before using it
This fixes a NULL pointer dereference if vst->duration is 0.

The problem was introduced in commit 0588acaf.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 86d00ede4f)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:07:01 +02:00
wm4
262c678357 matroskadec: export cover art correctly
Generally, libavformat exports cover art pictures as video streams with
1 packet and AV_DISPOSITION_ATTACHED_PIC set. Only matroskadec exported
it as attachment with codec_id set to AV_CODEC_ID_MJPEG.

Obviously, this should be consistent, so change the Matroska demuxer to
export a AV_DISPOSITION_ATTACHED_PIC pseudo video stream.

Matroska muxing is probably incorrect too. I know that it can create
broken files with an audio track and just 1 video frame when e.g.
remuxing mp3 with APIC to mkv. But for now this commit does not change
anything about muxing, and also continues to write attachments with
AV_CODEC_ID_MJPEG should the muxer application have special knowledge
that the Matroska is broken in this way.

Fixes trac #4423.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 511585ce7f)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:04:55 +02:00
Andreas Cadhalpun
763ab41f77 mxfenc: don't try to write footer without header
This fixes a crash, when trying to mux h264 into mxf_opatom.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Previous version reviewed-by: tomas.hardin@codemill.se
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

(cherry picked from commit b61cb61ab8)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:04:33 +02:00
Andreas Cadhalpun
76ee9fdb61 mxfenc: fix memleaks in mxf_write_footer
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: tomas.hardin@codemill.se
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 39ddda12f1)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:04:17 +02:00
Martin Storsjö
692fd5635f rtpenc_mpegts: Set chain->rtp_ctx only after avformat_write_header succeeded
By making sure we at each time only have one pointer set, either a
local variable or one in the context, we avoid potential double frees
in the cleanup routines. If chain->rtp_ctx is set, it is closed by
calling avformat_write_trailer, but that shouldn't be called unless
avformat_write_header succeeded.

This issue was pointed out by Andreas Cadhalpun.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit cf402d6fa8)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:04:05 +02:00
Martin Storsjö
c3b1261afa rtpenc_mpegts: Free the right ->pb in the error path in the init function
This fixes a typo from 8e32b1f096.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit c83dd2d2a4)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:03:26 +02:00
Michael Niedermayer
ac07ab7db7 avformat/utils: avoid discarded streams in av_find_default_stream_index()
Fixes Ticket2010

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-11 22:01:46 +02:00
Micah Galizia
f90c9bbbca avformat/http: replace cookies with updated values instead of appending forever
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c59654d67d)
Signed-off-by: Micah Galizia <micahgalizia@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-28 11:59:35 +01:00
Micah Galizia
f2abcdedfe avformat/hls: refactor repeated HLS option updates
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fca0851879)
Signed-off-by: Micah Galizia <micahgalizia@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-28 11:59:24 +01:00
Micah Galizia
eebd161e76 avformat/hls: store cookies returned in HLS key response
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7859618aff)
Signed-off-by: Micah Galizia <micahgalizia@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-28 11:59:09 +01:00
Michael Niedermayer
6a4d1325e2 avformat/rmdec: fix support for 0 sized mdpr
Fixes Ticket4393

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-28 11:59:05 +01:00
Michael Niedermayer
f6327e5fa6 avformat/mov: Disallow ".." in dref unless use_absolute_path is set
as this kind of allows to circumvent it to some extend.
We also could add a separate parameter or value to choose this

Found-by: ramiro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1e4d0498df)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-16 04:01:58 +01:00
Michael Niedermayer
37469af294 avformat/mov: Check for string truncation in mov_open_dref()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8003816e16)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 21:59:47 +01:00
Michael Niedermayer
350054e8e2 avformat/mov: Use sizeof(filename) instead of a literal number
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 21a53dd08d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 21:58:26 +01:00
Andreas Cadhalpun
39c9b47bb6 asfenc: fix leaking asf->index_ptr on error
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2c8cff2be4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 13:04:31 +01:00
Andreas Cadhalpun
d9dbd2362d ffmdec: limit the backward seek to the last resync position
If resyncing leads to the same position as previously, it will again
lead to a resync attempt, resulting in an infinite loop.

Thus don't seek back beyond the last syncpoint.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6b8263b03a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 13:04:31 +01:00
Andreas Cadhalpun
a613dd627c ffmdec: make sure the time base is valid
A negative time base can trigger assertions.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4c91d81be2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 13:04:31 +01:00
Andreas Cadhalpun
1903d6d2b0 ffmdec: fix infinite loop at EOF
If EOF is reached, while skipping bytes, avio_tell(pb) won't change
anymore, resulting in an infinite loop.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6fa98822eb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 13:04:31 +01:00
Andreas Cadhalpun
2319fddfd3 ffmdec: initialize f_cprv, f_stvi and f_stau
They are used in a switch statement, but it is not guaranteed that the
COMM case (where they are set to 0) is reached before the other cases.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 66879ee125)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 13:04:31 +01:00
Martin Storsjö
28e17ba220 mxfdec: Fix the error handling for when strftime fails
The str variable is a char ** here.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 13:04:31 +01:00
Carl Eugen Hoyos
1a89aab3c0 lavf: Do not list mov-only codecs in riff.c.
Instead check for all mov code-points when demuxing avi
and print a warning if a video codec is found like this.
Fixes a regression similar to the one described in ticket #4307.
(cherry picked from commit 2e0b5f5c90)
2015-03-13 09:14:26 +01:00
Andreas Cadhalpun
4e2cab5a79 fix spelling errors
opttimizations -> optimizations
 grabing        -> grabbing
 many resource  -> many resources
 isnt           -> isn't
 silcense       -> silence

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 482c86f231)
2015-03-06 22:26:53 +01:00
selsta
6c8a158989 hls: detect SAMPLE-AES encryption
SAMPLE-AES encryption is not commonly used yet, but without this patch
ffmpeg is thinking that the hls segments are not encrypted which
produces broken files.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-05 23:08:38 +01:00
Michael Niedermayer
be07270bca Merge commit 'bb4edddd9389cc1601db618ed3c1375b62628d04'
* commit 'bb4edddd9389cc1601db618ed3c1375b62628d04':
  rmenc: limit packet size

Conflicts:
	libavformat/rmenc.c

See: 08728f400b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-05 20:24:58 +01:00
Michael Niedermayer
8c013a9e55 avformat/avidec: Check avio_read() return before using the results for meta-data
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-05 19:38:20 +01:00
Michael Niedermayer
8a048fe6f8 avformat/avidec: initialize header array
Fixes use of uninitialized memory in case read fails

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-05 18:41:03 +01:00
Andreas Cadhalpun
bb4edddd93 rmenc: limit packet size
The chunk size is limited to UINT16_MAX (written by avio_wb16), so make
sure that the packet size is not too large.

Such large frames need to be split into slices smaller than 64 kB, but
that is currently supported neither by the rv10/rv20 encoders nor the rm
muxer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-03-05 15:51:05 +01:00
Kevin Wheatley
45555a20c6 avformat/movenc: Add support for writing 'gama' atom to QuickTime .mov files.
As this is depricated it should not be on by default, it is only
supported for MOV containers, depends on avpriv_get_gamma_from_trc()

Enable by:

-movflags +write_gama

This will use the color_trc to supply a gamma value, if desired an
explicit value may be supplied using the -mov_gamma option supplying
a suitable floating point value, values <=1e-6 will not be written.

Signed-off-by: Kevin Wheatley <kevin.j.wheatley@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-05 12:26:37 +01:00
Vilius Grigaliūnas
2af260e3a8 avformat/mxfdec: Detect XYZ pixel format for digital cinema files
While the native jpeg2000 decoder can determine pixel format correctly
from the codestream, libopenjpeg wrapper cannot. To make sure that
the output is correct when using libopenjpeg to decode digital
cinema files, we do detection from the metadata included in the MXF
wrapper.

If the container has "JPEG 2000 Coding Parameters" metadata element
with Rsiz value set to one of digital cinema profiles, we can safely
assume that the given input file is DCI compliant, therefore the
pixel format should be XYZ.

Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-05 11:47:11 +01:00
Timo Rothenpieler
f5668e614b avformat/dashenc: Update extradata for mov muxer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-05 10:33:03 +01:00