Commit Graph

90865 Commits

Author SHA1 Message Date
James Almer
4f55b94663 avformat/matroskadec: address some more missing AVPacket frees
Fixes memleaks.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-04 13:53:12 -03:00
James Almer
2f27370111 avcodec/mpeg4videodec: unbreak multithreading decoding
Should fix double free related crashes.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-04 11:09:11 -03:00
James Almer
2f0e0deadc avformat/matroskadec: address a missing AVPacket free
Fixes memleaks.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-04 10:54:14 -03:00
James Almer
2accdd3871 avcodec/libaomdec: fix broken pix_fmt changes from the previous commit
Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-04 02:13:40 -03:00
James Almer
a866cc3ad3 avcodec/mpeg4videodec: free studio profile VLCs when closing the decoder
Fixes memleaks.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-04 00:45:16 -03:00
James Almer
fefe47b701 avcodec/clearvideo: fix mixed code and declarations
Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-04 00:43:01 -03:00
James Almer
d95f15b14d avformat/mp3enc: use AVPacketList helper functions to queue packets
Simplifies code.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-04 00:15:39 -03:00
James Almer
15ca8311e6 avformat/ttaenc: use AVPacketList helper functions to queue packets
Simplifies code.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-04 00:15:38 -03:00
James Almer
78b96be758 avformat/matroskadec: use AVPacketList to queue packets
It's more robust and efficient.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-04 00:15:38 -03:00
James Almer
58ce4fdeae avformat/utils: optimize ff_packet_list_free()
Don't constantly overwrite the list's head pointer.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-04 00:15:38 -03:00
James Almer
3a4d74c1ff avformat/utils: make AVPacketList helper functions shared
Based on a patch by Luca Barbato.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-04 00:15:37 -03:00
Jun Zhao
51e3010575 lavf/hls: Remove the dead code in parse_playlist()
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
2018-04-04 11:04:56 +08:00
James Almer
9df784db6e avcodec/sheervideo: add missing wrappers to sheervideodata.h
Fixes make fate-source

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-03 23:32:03 -03:00
James Almer
4d89b5f844 avcodec/clearvideo: add missing wrappers to clearvideodata.h
Fixes make fate-source

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-03 23:31:36 -03:00
James Almer
f3fae82042 avcodec/libaomdec: add support for monochrome files
All such files are signaled as I42016, as there's no monochrome value
in aom_img_fmt_t.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-03 15:33:48 -03:00
James Almer
d5343a5005 avcodec/libaomdec: remove duplicate code
Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-03 15:27:18 -03:00
Gagandeep Singh
673604e0e3 lavc/cfhd: fix distortion of lowest 8 lines when height is not multiple of 16
Also update fate reference. Fixes ticket #6675.
2018-04-03 18:20:30 +02:00
wm4
d6fc031caf avutil/pixdesc: deprecate AV_PIX_FMT_FLAG_PSEUDOPAL
PSEUDOPAL pixel formats are not paletted, but carried a palette with the
intention of allowing code to treat unpaletted formats as paletted. The
palette simply mapped the byte values to the resulting RGB values,
making it some sort of LUT for RGB conversion.

It was used for 1 byte formats only: RGB4_BYTE, BGR4_BYTE, RGB8, BGR8,
GRAY8. The first 4 are awfully obscure, used only by some ancient bitmap
formats. The last one, GRAY8, is more common, but its treatment is
grossly incorrect. It considers full range GRAY8 only, so GRAY8 coming
from typical Y video planes was not mapped to the correct RGB values.
This cannot be fixed, because AVFrame.color_range can be freely changed
at runtime, and there is nothing to ensure the pseudo palette is
updated.

Also, nothing actually used the PSEUDOPAL palette data, except xwdenc
(trivially changed in the previous commit). All other code had to treat
it as a special case, just to ignore or to propagate palette data.

In conclusion, this was just a very strange old mechnaism that has no
real justification to exist anymore (although it may have been nice and
useful in the past). Now it's an artifact that makes the API harder to
use: API users who allocate their own pixel data have to be aware that
they need to allocate the palette, or FFmpeg will crash on them in
_some_ situations. On top of this, there was no API to allocate the
pseuo palette outside of av_frame_get_buffer().

This patch not only deprecates AV_PIX_FMT_FLAG_PSEUDOPAL, but also makes
the pseudo palette optional. Nothing accesses it anymore, though if it's
set, it's propagated. It's still allocated and initialized for
compatibility with API users that rely on this feature. But new API
users do not need to allocate it. This was an explicit goal of this
patch.

Most changes replace AV_PIX_FMT_FLAG_PSEUDOPAL with FF_PSEUDOPAL. I
first tried #ifdefing all code, but it was a mess. The FF_PSEUDOPAL
macro reduces the mess, and still allows defining FF_API_PSEUDOPAL to 0.

Passes FATE with FF_API_PSEUDOPAL enabled and disabled. In addition,
FATE passes with FF_API_PSEUDOPAL set to 1, but with allocation
functions manually changed to not allocating a palette.
2018-04-03 17:53:00 +02:00
wm4
e53d3348d1 avcodec/xwdenc: do not rely on AV_PIX_FMT_FLAG_PSEUDOPAL palettes
This is the only code I found within FFmpeg that still inherently
requires AV_PIX_FMT_FLAG_PSEUDOPAL. It's easily changed not to require
it.

Preparation for the next patch.
2018-04-03 17:52:06 +02:00
Paul B Mahol
be3a051ca8 avcodec/sheervideo: move tables to own header
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-04-03 17:28:16 +02:00
Paul B Mahol
a874586994 avcodec/clearvideo: add inter-frame decoding
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-04-03 17:28:16 +02:00
Simon Thelen
8c2c97403b avcodec/imgconvert: fix possible null pointer dereference
regression since 354b26a394
2018-04-03 16:20:31 +02:00
Tobias Rapp
4b736bc921 fftools/cmdutils: add support for level flag in loglevel option parser
Allows to manage the AV_LOG_PRINT_LEVEL flag as a prefix to the loglevel
option value, similar to the existing AV_LOG_SKIP_REPEATE flag. Adds
support for setting flags relative to the existing value by using a +/-
prefix.

Previous version reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2018-04-03 10:17:38 +02:00
Michael Niedermayer
197a4e8fee avcodec/aacdec_fixed: Fix integer overflow in apply_independent_coupling_fixed()
I was not able to reproduce this, this fix is based on just the fuzzer log.
Fixes: 4959/clusterfuzz-testcase-minimized-6035350934781952

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-02 23:27:51 +02:00
Michael Niedermayer
d52be5d4e9 avcodec/cscd: Error out when LZ* decompression fails
Fixes: Timeout
Fixes: 6304/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CSCD_fuzzer-5754772461191168

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-02 23:27:51 +02:00
Jun Zhao
c6c20249e7 avformat/options_table: Change the seek2any location in opt table.
Change the seek2any location in avformat_options to make code more
readable.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-02 23:27:51 +02:00
James Almer
4897c80cc6 avcodec/libaomdec: remove references to gbrp pixfmt
Support for this needs testing, so remove for now.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-02 17:54:36 -03:00
James Almer
877aff2bea avcodec/libaomenc: remove references to gbrp pixfmt
Support for this needs testing, so remove for now.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-02 17:54:36 -03:00
Paul B Mahol
46129b4044 avformat/rmdec: make use of avio_get_str()
Also do not set empty metadata.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-04-02 22:44:26 +02:00
Marton Balint
37d472a906 avformat/concatdec: only set output stream index before returning packet
Fixes ticket #6434.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
2018-04-02 20:41:53 +02:00
Paul B Mahol
5710fdaeae avcodec/aic: fix decoding of videos which height is not multiple of 16
Fate output changes and under close inspection looks more correct.
Fixes #6187.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-04-02 16:17:18 +02:00
Paul B Mahol
324954cf96 avcodec/scpr: fix decoding of prev+top-topleft prediction in keyframes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-04-02 16:05:23 +02:00
Kieran Kunhya
f9d3841ae6 mpeg4video: Add support for MPEG-4 Simple Studio Profile.
This is a profile supporting > 8-bit video and has a higher quality DCT
2018-04-02 13:06:23 +01:00
Kieran Kunhya
699fa8f382 simple_idct: Template functions to support an input bitdepth parameter 2018-04-02 13:06:19 +01:00
Paul B Mahol
22a878ecd1 avcodec/scpr: check for possible out of array access
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-04-02 09:02:25 +02:00
James Almer
02ae52db87 avformat/utils: use av_packet_make_refcounted to ensure packets are ref counted
Simplifies code, while also fixing a potential leak of side data in pkt.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-02 00:37:51 -03:00
James Almer
265ec55983 avcodec/bsf: use av_packet_make_refcounted to ensure packets are ref counted
Simplifies code.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-02 00:37:46 -03:00
James Almer
38fa61b947 avdevice/decklink_dec: use av_packet_make_refcounted to ensure packets are ref counted
Partially reverts commit e91f0c4f8b, simplifying code.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-02 00:36:24 -03:00
James Almer
e61d8b82a2 avcodec/encode: use av_packet_make_refcounted to ensure packets are ref counted
Simplifies code.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-01 23:40:42 -03:00
James Almer
de0526070e avcodec/frame_thread_encoder: remove usage of av_dup_packet()
Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-01 23:40:41 -03:00
James Almer
860086ee16 avcodec/avpacket: add av_packet_make_refcounted()
It works as a drop in replacement for the deprecated av_dup_packet(),
to ensure a packet is reference counted.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-01 23:40:41 -03:00
Josh de Kock
e0f3228686 lavf/img2dec: use new iteration API
Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-04-02 03:26:22 +01:00
Josh de Kock
89029bd2c7 lav*,tests: remove several register_all calls
avdevice_register_all() is still required to register devices into
lavf (this is required due to lavd being somewhat of a hack).

Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-04-02 03:26:22 +01:00
Josh de Kock
d1221f3351 lavf/format: use const AVInputFormat for iteration
Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-04-02 03:26:22 +01:00
Josh de Kock
85bf89885a Revert "avformat/format: temporarily use old next api"
This reverts commit 909e00ae81.

There is no need to use the old API anymore as the new API now
behaves in the same way (treating devices as formats when loaded).

Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-04-02 03:26:22 +01:00
James Almer
f1805d160d avfilter: bump version for the latest API change
And fix the entry in doc/APIchanges

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-01 23:22:18 -03:00
James Almer
ef06ed5b18 libaom: remove references to yuv440p pixfmt
Support for it was apparently never in the codebase, and the enum
values were recently removed from the public headers [1]

Fixes build with latest libaom build.

[1] https://aomedia.googlesource.com/aom/+/2e3cd5c5c30fa02134681cda900c32486807af3f

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-01 22:50:42 -03:00
Jun Zhao
9b125826ed cmdutils: fix new API break the "ffmpeg -muxers/demuxers"
fix commit 2238190 break the "ffmpeg -muxers/demuxers".

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-04-02 02:19:26 +01:00
Josh de Kock
db85d657fa lavf/allformats: remove left-over index decrement
Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-04-02 02:18:21 +01:00
Josh de Kock
42d26145e9 lavf: move avpriv function definition to internal.h
Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-04-02 02:16:14 +01:00