Also add an error message an return a more suitable error code
(INVALIDDATA, not EINVAL);
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
This code changes the input packet, which is read only and can in
rare circumstances lead to decoder errors. (i run into one of these in
the audio decoder, which corrupted the packet during av_find_stream_info()
so that actual decoding that single packet failed later)
Until a better fix is implemented, this commit limits the problem.
A better fix might be to make the subtitle decoders not depend on
data[size] = 0 or to copy their input when this is not the case.
These functions are intended for use with side_data which comes in an
AVPacket.
Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
Reviewed-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This type is intended to be used to allow codecs to pass updated
metadata to applications.
Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
Reviewed-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Some of context fields which must be overrided by this wrapper decoder
may be set and used by user, so we have to save and restore them before
and after invoking the inner decoder to secure user.
* commit '6f1ec8edf2416441e2348f3a0915c9fee179d7da':
avcodec.h: include version.h before using version macro
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'a553c6a347d3d28d7ee44c3df3d5c4ee780dba23':
lavc: use buf[0] instead of data[0] in checks whether a frame is allocated
Conflicts:
libavcodec/h264_refs.c
libavcodec/mpegvideo.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master:
mpegvideo_enc: use the AVFrame API properly.
ffv1: use the AVFrame API properly.
jpegls: use the AVFrame API properly.
huffyuv: use the AVFrame API properly.
Conflicts:
libavcodec/ffv1.c
libavcodec/ffv1.h
libavcodec/ffv1dec.c
libavcodec/ffv1enc.c
Changes to ffv1 are more redone than merged due to them being based on
an ancient codebase and a good part of that having being done already
as well.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'ffe04c330335add4c6d70ab0bb98e6b3f4f7abfa':
libxvid: use the AVFrame API properly.
pcxenc: use the AVFrame API properly.
roqvideo: remove unused variables
libschroedingerenc: use the AVFrame API properly.
Conflicts:
libavcodec/pcxenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '97168b204a0b6b79bb6c5f0d40efdf7fc2262476':
eatgv: use the AVFrame API properly.
libxavs: use the AVFrame API properly.
nuv: use the AVFrame API properly.
flashsvenc: use the AVFrame API properly.
Conflicts:
libavcodec/eatgv.c
libavcodec/nuv.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '57e7b3a89f5a0879ad039e8f04273b48649799a8':
dnxhdenc: use the AVFrame API properly.
libx264: use the AVFrame API properly.
svq1enc: use the AVFrame API properly.
gif: use the AVFrame API properly.
Conflicts:
libavcodec/gif.c
libavcodec/svq1enc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '45bde93eefa78c1bdb0936109fbd2e2fb27fbfe7':
sunrastenc: use the AVFrame API properly.
targaenc: use the AVFrame API properly.
tiffenc: use the AVFrame API properly.
pngenc: use the AVFrame API properly.
Conflicts:
libavcodec/pngenc.c
libavcodec/sunrastenc.c
libavcodec/targaenc.c
libavcodec/tiffenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '0ea430c75b8d90449d2878ad84669a2da2ad3cbc':
lclenc: use the AVFrame API properly.
Conflicts:
libavcodec/lclenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'd48c20630214a4effcc920e93a5044bee4e2002e':
qtrleenc: use the AVFrame API properly.
ulti: use the AVFrame API properly.
vc1: use the AVFrame API properly.
flashsv: use the AVFrame API properly.
Conflicts:
libavcodec/flashsv.c
libavcodec/qtrleenc.c
libavcodec/ulti.c
libavcodec/vc1dec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'e4155f15b35c4272a235f5521d2dc6c2aabdd462':
eamad: use the AVFrame API properly.
dpxenc: use the AVFrame API properly.
bmpenc: use the AVFrame API properly.
sgienc: use the AVFrame API properly.
Conflicts:
libavcodec/bmpenc.c
libavcodec/dpxenc.c
libavcodec/eamad.c
libavcodec/sgienc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '730bac7bab3c7dcd9fcb7c70f154e5f4cfaef9a7':
mss4: use the AVFrame API properly.
mss3: use the AVFrame API properly.
mss2: use the AVFrame API properly.
mss1: use the AVFrame API properly.
Conflicts:
libavcodec/mss1.c
libavcodec/mss2.c
libavcodec/mss3.c
libavcodec/mss4.c
See: 02fe531afe
See: ff1c13b133
See: 310bf28354
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '508b37557bf36eae83c18e64d42f27b44a321d81':
tiertexseqv: use the AVFrame API properly.
smc: use the AVFrame API properly.
truemotion2: use the AVFrame API properly.
truemotion1: use the AVFrame API properly.
Conflicts:
libavcodec/smc.c
libavcodec/tiertexseqv.c
libavcodec/truemotion1.c
libavcodec/truemotion2.c
See: e999f2339a
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '4a4841d4e0f0dc50998511bf6c48b518012024db':
fraps: use the AVFrame API properly.
rpza: use the AVFrame API properly.
motionpixels: use the AVFrame API properly.
vmdvideo: use the AVFrame API properly.
Conflicts:
libavcodec/fraps.c
libavcodec/motionpixels.c
libavcodec/rpza.c
libavcodec/vmdav.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '3c8ea9d4a74fd4d7493d40c818ca64ee492709f3':
vmnc: use the AVFrame API properly.
xan: use the AVFrame API properly.
xxan: use the AVFrame API properly.
zerocodec: use the AVFrame API properly.
Conflicts:
libavcodec/vmnc.c
libavcodec/xan.c
libavcodec/xxan.c
See: cf5ab8b6f7
See: ad438f450b
See: 67607e20e8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'a837c4f2df96a30bf9aa4115b426d608487c7101':
zmbvenc: use the AVFrame API properly.
flicvideo: use the AVFrame API properly.
smacker: use the AVFrame API properly.
mmvideo: use the AVFrame API properly.
Conflicts:
libavcodec/flicvideo.c
libavcodec/mmvideo.c
libavcodec/smacker.c
libavcodec/zmbvenc.c
See: 76e27b1d05
See: 099e57bc38
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '2e09096da912f563c4dd889a8f25c314529bbaa6':
kgv1: use the AVFrame API properly.
indeo2: use the AVFrame API properly.
iff: use the AVFrame API properly.
msrle: use the AVFrame API properly.
Conflicts:
libavcodec/iff.c
libavcodec/indeo2.c
libavcodec/kgv1dec.c
libavcodec/msrle.c
See: 451b2ca1b4
See: 80e9e63c94
See: 057dce5f21
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'b7462a3904d71ff799584faf5b875cad59ca2f31':
jvdec: use the AVFrame API properly.
Conflicts:
libavcodec/jvdec.c
See: 678431d3f2
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '2d2a92f72199823a92e4e226c32e42a27ec801c0':
dxa: use the AVFrame API properly.
qpeg: use the AVFrame API properly.
cin video: use the AVFrame API properly.
msvideo1: use the AVFrame API properly.
Conflicts:
libavcodec/dsicinav.c
libavcodec/dxa.c
libavcodec/msvideo1.c
libavcodec/qpeg.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'a639ea7f4bc44bf6bfa452675558a342924a66a9':
escape124: use the AVFrame API properly.
qtrle: use the AVFrame API properly.
cljr: use the AVFrame API properly.
cinepak: use the AVFrame API properly.
Conflicts:
libavcodec/cinepak.c
libavcodec/cljr.c
libavcodec/qtrle.c
See: 80e9e63c libavcodec/cinepak.c
See: 71c378984b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'cec5ce49229d61e4eb1f331a6d0dff3aa24f6655':
cdxl: remove an unused variable
c93: use the AVFrame API properly.
bethsoftvid: use the AVFrame API properly.
avs: use the AVFrame API properly.
Conflicts:
libavcodec/bethsoftvideo.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '6139f481ac9feb1bee4e7d04789fb15d7f24ebbf':
asvenc: use the AVFrame API properly.
a64multienc: use the AVFrame API properly.
Conflicts:
libavcodec/vaapi_mpeg.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
w and h are both read as uint16 + 1 so this can not happen. A similar
change was introduced in 97962b2 / 72ca830, with the
av_log()+AVERROR_INVALIDDATA form, suggesting it could be triggerable
somehow.
Change suggested by Ronald S. Bultje.
Those should not be necessary.
Original change by one of these developers:
Anton Khirnov <anton@khirnov.net>
Diego Biurrun <diego@biurrun.de>
Luca Barbato <lu_zero@gentoo.org>
Martin Storsjö <martin@martin.st>
See 97962b2 / 72ca830
vp8_rac_get_tree() is called with a tree of size 3, so the returned
value can not be outside [0;3]. All of the [0;3] cases are handled in
the switch, so the assert should not be triggerable by any means. A
similar change was introduced in 97962b2 / 72ca830, with the
av_log()+AVERROR_INVALIDDATA form, suggesting it could be triggerable
somehow. This assert might help static analyzer, or simply the reader.
The operands of an addition can be evaluated in any order, since
the addition isn't a sequence point. The only operators that
have a defined evaluation order are &&, ||, ?: and the sequence
operator ','.
This fixes fate-vp9 on ARM RVCT.