1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-03 05:10:03 +02:00
FFmpeg/libavformat
Andreas Rheinhardt 02bbb37006 avformat/smacker: Avoid potential inifinite loop on error
When reading a new frame, the Smacker demuxer seeks to the next frame
position where it excepts the next frame; then it (potentially) reads
the palette, the audio packets associated with the frame and finally the
actual video frame. It is only at the end that the frame counter as well
as the position where the next frame is expected get updated.

This has a downside: If e.g. invalid data is encountered when reading
the palette, the demuxer returns immediately (with an error) and if the
caller calls av_read_frame again, the demuxer seeks to the position where
it already was, reads the very same palette data again and therefore will
return an error again. If the caller calls av_read_frame repeatedly
(say, until a packet is received or until EOF), this meight become an
infinite loop.

This could also happen if e.g. the size of one of the audio frames was
invalid or if the frame size was gigantic.

This commit changes this by skipping a frame if it turns out to be
invalid or an error happens otherwise. This ensures that EOF will be
returned eventually in the above scenario.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-04 19:19:34 +02:00
..
tests
.gitignore
3dostr.c
4xm.c avformat/4xm: Check that a video stream was created before returning packets for it 2020-06-14 21:22:47 +02:00
a64.c
aacdec.c
aadec.c
ac3dec.c
acm.c
act.c
adp.c
ads.c
adtsenc.c avcodec, avformat: Remove unnecessary initializations of side data size 2020-06-22 12:20:37 +02:00
adxdec.c
aea.c
afc.c
aiff.h
aiffdec.c
aiffenc.c
aixdec.c
allformats.c libavformat/img2dec: Added pgx demuxer 2020-07-03 23:28:26 +02:00
alp.c
amr.c
anm.c
apc.c
ape.c avformat/ape: Cleanup after ape_read_header() failure 2020-06-14 18:20:37 +02:00
apetag.c
apetag.h
apm.c avformat/apm: check codec tag in probe and add constant 2020-06-17 21:45:10 +02:00
apngdec.c
apngenc.c avcodec, avformat: Remove unnecessary initializations of side data size 2020-06-22 12:20:37 +02:00
aptxdec.c
aqtitledec.c avformat/aqtitledec: Fix memleak upon read header failure 2020-06-15 16:54:05 +02:00
argo_asf.c
asf.c
asf.h
asfcrypt.c
asfcrypt.h
asfdec_f.c
asfdec_o.c
asfenc.c
assdec.c avformat/assdec: Fix memleak upon read header failure 2020-06-15 16:54:05 +02:00
assenc.c
ast.c
ast.h
astdec.c
astenc.c
async.c
au.c avformat/au: check return value of au_read_annotation() 2020-07-02 21:12:37 +08:00
av1.c avformat/av1: Avoid using dynamic buffer when assembling av1c 2020-06-26 07:12:31 +02:00
av1.h
av1dec.c
avc.c avformat/avc, mxfenc: Avoid allocation of H264 SPS structure, fix memleak 2020-06-26 12:13:43 +02:00
avc.h avformat/avc, mxfenc: Avoid allocation of H264 SPS structure, fix memleak 2020-06-26 12:13:43 +02:00
avformat.h avformat/avformat: Improve documentation of av_stream_get_side_data 2020-06-22 12:20:23 +02:00
avformatres.rc
avi.h
avidec.c
avienc.c
avio_internal.h
avio.c URLContext: switch to child_class_iterate() 2020-06-10 12:36:44 +02:00
avio.h
aviobuf.c avformat/aviobuf: Also return truncated buffer in avio_get_dyn_buf() 2020-06-11 04:03:38 +02:00
avisynth.c
avlanguage.c
avlanguage.h
avr.c
avs.c
bethsoftvid.c
bfi.c
bink.c
bintext.c
bit.c
bluray.c
bmv.c
boadec.c
brstm.c
c93.c
cache.c
caf.c
caf.h
cafdec.c
cafenc.c
cavsvideodec.c
cdg.c
cdxl.c
chromaprint.c
cinedec.c
codec2.c
concat.c
concatdec.c
crcenc.c
crypto.c
cutils.c
dash.c
dash.h
dashdec.c lavf/dashdec: Add missed side data/disposition 2020-06-18 17:51:41 +08:00
dashenc.c avformat/dashenc: Calculate average bitrate for adaptation sets in static manifest 2020-06-22 10:32:44 +05:30
data_uri.c
dauddec.c
daudenc.c
davs2.c
dcstr.c
derf.c
dfa.c
dhav.c
diracdec.c
dnxhddec.c
dsfdec.c
dsicin.c
dss.c
dtsdec.c
dtshddec.c
dump.c avformat/dump: add a \n for end of ERROR log 2020-07-02 21:12:37 +08:00
dv.c
dv.h
dvbsub.c
dvbtxt.c
dvenc.c avformat/dvenc: return error code of dv_assemble_frame() 2020-06-19 23:12:49 +08:00
dxa.c
eacdata.c
electronicarts.c
epafdec.c
ffmeta.h
ffmetadec.c
ffmetaenc.c
fifo_test.c
fifo.c avformat/fifo: add timeshift option to delay output 2020-06-09 00:57:30 +02:00
file_open.c
file.c
filmstripdec.c
filmstripenc.c
fitsdec.c
fitsenc.c
flac_picture.c
flac_picture.h
flacdec.c
flacenc_header.c
flacenc.c
flacenc.h
flic.c
flv.h
flvdec.c avformat/flvdec: Cosmetics 2020-06-22 12:19:56 +02:00
flvenc.c avcodec, avformat: Remove unnecessary initializations of side data size 2020-06-22 12:20:37 +02:00
format.c
framecrcenc.c
framehash.c
frmdec.c
fsb.c
ftp.c
fwse.c
g722.c
g723_1.c
g726.c
g729dec.c
gdv.c
genh.c
gif.c
gifdec.c
golomb_tab.c
gopher.c
gsmdec.c
gxf.c
gxf.h
gxfenc.c
h261dec.c
h263dec.c
h264dec.c
hashenc.c
hca.c
hcom.c
hdsenc.c
hevc.c avformat/hevc: Defer initializations in ff_isom_write_hvcc() 2020-07-02 02:09:59 +02:00
hevc.h
hevcdec.c
hls.c avformat/hls: Pass a copy of the URL for probing 2020-07-01 11:41:35 +02:00
hlsenc.c avformat/hlsenc: simplify code to pass s directly 2020-07-02 21:12:37 +08:00
hlsplaylist.c
hlsplaylist.h
hlsproto.c
hnm.c
http.c
http.h
httpauth.c
httpauth.h
icecast.c avformat/icecast: Add option to use TLS connection 2020-07-02 17:14:31 +02:00
icodec.c
icoenc.c
id3v1.c
id3v1.h
id3v2.c
id3v2.h
id3v2enc.c
idcin.c
idroqdec.c
idroqenc.c
iff.c
ifv.c
ilbc.c
img2_alias_pix.c
img2_brender_pix.c
img2.c avcodec: add PFM image decoder 2020-05-30 18:02:55 +02:00
img2.h
img2dec.c libavformat/img2dec: Added pgx demuxer 2020-07-03 23:28:26 +02:00
img2enc.c
ingenientdec.c
internal.h
ip.c
ip.h
ipmovie.c
ircam.c
ircam.h
ircamdec.c
ircamenc.c
isom.c avformat/isom: add comment to mov_mdhd_language_map 2020-07-01 11:41:35 +02:00
isom.h
iss.c
iv8.c
ivfdec.c
ivfenc.c
jacosubdec.c avformat/jacosubdec: Fix memleak upon read header failure 2020-06-15 16:54:05 +02:00
jacosubenc.c
jvdec.c
kvag.c avformat: add kvag muxer 2020-05-31 00:55:12 +02:00
latmenc.c avcodec, avformat: Remove unnecessary initializations of side data size 2020-06-22 12:20:37 +02:00
libamqp.c avformat/libamqp: add option delivery_mode 2020-06-24 23:15:52 -04:00
libavformat.v
libgme.c
libmodplug.c
libopenmpt.c
librtmp.c
libsmbclient.c
libsrt.c
libssh.c
libzmq.c
lmlm4.c
loasdec.c
log2_tab.c
lrc.c
lrc.h
lrcdec.c avformat/lrcdec: Fix memleak upon read header failure 2020-06-15 16:54:05 +02:00
lrcenc.c
lvfdec.c
lxfdec.c
m4vdec.c
Makefile avformat: add MCC demuxer 2020-06-18 21:31:13 +02:00
matroska.c
matroska.h
matroskadec.c avformat/matroskadec: Fix memleaks in WebM DASH manifest demuxer 2020-06-15 16:35:28 +02:00
matroskaenc.c avcodec, avformat: Remove unnecessary initializations of side data size 2020-06-22 12:20:37 +02:00
mccdec.c avformat: add MCC demuxer 2020-06-18 21:31:13 +02:00
md5proto.c
metadata.c
metadata.h
mgsts.c
microdvddec.c avformat/microdvddec: skip malformed lines without frame number. 2020-06-25 12:50:22 +02:00
microdvdenc.c
mj2kdec.c
mkvtimestamp_v2.c
mlpdec.c
mlvdec.c avformat/mlvdec: fail reading a packet with 0 streams 2020-06-07 22:01:12 +02:00
mm.c
mmf.c
mms.c
mms.h
mmsh.c
mmst.c
mov_chan.c
mov_chan.h
mov_esds.c
mov.c avformat/mov: fix memleaks 2020-07-01 15:28:03 +02:00
movenc.c lavf/movenc: Use a dynamic buffer when writing the mfra box 2020-06-28 20:16:29 +01:00
movenc.h
movenccenc.c
movenccenc.h
movenchint.c
mp3dec.c Revert "lavf/mp3dec: don't adjust start time; packets are not adjusted." 2020-06-08 22:08:37 +02:00
mp3enc.c avcodec, avformat: Remove unnecessary initializations of side data size 2020-06-22 12:20:37 +02:00
mpc8.c
mpc.c
mpeg.c
mpeg.h
mpegenc.c
mpegts.c
mpegts.h avformat/mpegts: add constants for MPEG-TS transport stream identifiers 2020-06-09 01:01:28 +02:00
mpegtsenc.c avformat/mpegts: add constants for MPEG-TS transport stream identifiers 2020-06-09 01:01:28 +02:00
mpegvideodec.c
mpjpeg.c
mpjpegdec.c
mpl2dec.c avformat/mpl2dec: Avoid variable that is always zero 2020-06-22 13:16:53 +02:00
mpsubdec.c avformat/mpsubdec: Fix memleak upon read header failure 2020-06-15 16:54:05 +02:00
msf.c
msnwc_tcp.c
mtaf.c
mtv.c
musx.c
mux.c
mvdec.c avformat/mvdec: Fix integer overflow with billions of channels 2020-06-27 12:43:51 +02:00
mvi.c
mxf.c
mxf.h
mxfdec.c avformat/mxfdec: free duplicated utf16 strings 2020-06-14 21:22:47 +02:00
mxfenc.c avformat/avc, mxfenc: Avoid allocation of H264 SPS structure, fix memleak 2020-06-26 12:13:43 +02:00
mxg.c
ncdec.c
network.c
network.h
nistspheredec.c
nspdec.c
nsvdec.c
nullenc.c
nut.c
nut.h
nutdec.c
nutenc.c
nuv.c
oggdec.c avformat/oggdec: Disable mid stream codec changes 2020-06-14 18:34:59 +02:00
oggdec.h
oggenc.c
oggparsecelt.c
oggparsedirac.c
oggparseflac.c
oggparseogm.c
oggparseopus.c
oggparseskeleton.c
oggparsespeex.c
oggparsetheora.c avformat/oggparsetheora: Don't update start time when lastpts is AV_NOPTS_VALUE. 2020-05-31 00:52:08 +02:00
oggparsevorbis.c avformat/oggdec: Avoid duplicating buffer when adding side-data 2020-05-28 12:04:26 +02:00
oggparsevp8.c
oma.c
oma.h
omadec.c avformat/omadec: Fix memleaks upon read_header failure 2020-06-15 16:35:29 +02:00
omaenc.c
options_table.h
options.c AVFormatContext: switch to child_class_iterate() 2020-06-10 12:36:44 +02:00
os_support.c
os_support.h
paf.c
pcm.c
pcm.h
pcmdec.c
pcmenc.c
pjsdec.c avformat/pjsdec: Avoid variable that is always zero 2020-06-22 13:16:58 +02:00
pmpdec.c
pp_bnk.c
prompeg.c lavf/prompeg: prompeg_write() must report data all was written 2020-06-14 12:27:49 +08:00
protocols.c URLContext: switch to child_class_iterate() 2020-06-10 12:36:44 +02:00
psxstr.c
pva.c
pvfdec.c
qcp.c
qtpalette.c
qtpalette.h
r3d.c
rawdec.c avformat/rawdec: fix identifier names 2020-06-06 00:25:00 +02:00
rawdec.h avformat/rawdec: fix identifier names 2020-06-06 00:25:00 +02:00
rawenc.c
rawenc.h
rawutils.c
rawvideodec.c
rdt.c
rdt.h
realtextdec.c
redspark.c
replaygain.c
replaygain.h
riff.c
riff.h
riffdec.c
riffenc.c
rl2.c
rm.c
rm.h
rmdec.c
rmenc.c
rmsipr.c
rmsipr.h
rpl.c
rsd.c
rso.c
rso.h
rsodec.c
rsoenc.c
rtmp.h
rtmpcrypt.c
rtmpcrypt.h
rtmpdh.c
rtmpdh.h
rtmpdigest.c
rtmphttp.c
rtmppkt.c
rtmppkt.h
rtmpproto.c
rtp.c
rtp.h
rtpdec_ac3.c
rtpdec_amr.c
rtpdec_asf.c
rtpdec_dv.c
rtpdec_formats.h
rtpdec_g726.c
rtpdec_h261.c
rtpdec_h263_rfc2190.c
rtpdec_h263.c
rtpdec_h264.c
rtpdec_hevc.c
rtpdec_ilbc.c
rtpdec_jpeg.c
rtpdec_latm.c
rtpdec_mpa_robust.c
rtpdec_mpeg4.c
rtpdec_mpeg12.c
rtpdec_mpegts.c
rtpdec_qcelp.c
rtpdec_qdm2.c
rtpdec_qt.c
rtpdec_rfc4175.c
rtpdec_svq3.c
rtpdec_vc2hq.c
rtpdec_vp8.c
rtpdec_vp9.c
rtpdec_xiph.c
rtpdec.c
rtpdec.h
rtpenc_aac.c
rtpenc_amr.c
rtpenc_chain.c
rtpenc_chain.h
rtpenc_h261.c
rtpenc_h263_rfc2190.c
rtpenc_h263.c
rtpenc_h264_hevc.c
rtpenc_jpeg.c
rtpenc_latm.c
rtpenc_mpegts.c
rtpenc_mpv.c
rtpenc_vc2hq.c
rtpenc_vp8.c
rtpenc_vp9.c
rtpenc_xiph.c
rtpenc.c avcodec, avformat: Remove unnecessary initializations of side data size 2020-06-22 12:20:37 +02:00
rtpenc.h
rtpproto.c avformat/rtpproto: av_dict_set() -> av_dict_set_int() 2020-06-02 22:25:11 +08:00
rtpproto.h
rtsp.c
rtsp.h
rtspcodes.h
rtspdec.c avformat/rtspdec: av_dict_set() -> av_dict_set_int() 2020-06-02 22:25:11 +08:00
rtspenc.c
s337m.c
samidec.c avformat/samidec: Fix memleak upon read header failure 2020-06-15 16:54:05 +02:00
sapdec.c
sapenc.c
sauce.c
sauce.h
sbcdec.c
sbgdec.c
sccdec.c avformat/sccdec: Avoid variable that is always zero 2020-06-22 13:17:02 +02:00
sccenc.c
sctp.c
sdp.c
sdr2.c
sdsdec.c
sdxdec.c
segafilm.c
segafilmenc.c
segment.c avcodec, avformat: Remove unnecessary initializations of side data size 2020-06-22 12:20:37 +02:00
serdec.c
shortendec.c
sierravmd.c
siff.c
smacker.c avformat/smacker: Avoid potential inifinite loop on error 2020-07-04 19:19:34 +02:00
smjpeg.c
smjpeg.h
smjpegdec.c
smjpegenc.c
smoothstreamingenc.c avformat/smoothstreaming: Add deinit function 2020-06-27 23:19:58 +02:00
smush.c
sol.c
sox.h
soxdec.c
soxenc.c
spdif.c
spdif.h
spdifdec.c
spdifenc.c
srtdec.c avformat/srtdec: Fix memleak upon read header failure 2020-06-15 16:54:06 +02:00
srtenc.c
srtp.c
srtp.h
srtpproto.c
stldec.c avformat/stldec: Fix memleak upon read header failure 2020-06-15 16:54:06 +02:00
subfile.c
subtitles.c
subtitles.h
subviewer1dec.c avformat/subviewer1dec: Fix memleak upon read header failure 2020-06-15 16:54:06 +02:00
subviewerdec.c avformat/subviewerdec: Fix memleak upon read header failure 2020-06-15 16:54:06 +02:00
supdec.c
supenc.c
svag.c
swf.c
swf.h
swfdec.c
swfenc.c
takdec.c
tcp.c
tedcaptionsdec.c avformat/tedcaptionsdec: Fix memleak upon read header failure 2020-06-15 16:54:06 +02:00
tee_common.c
tee_common.h
tee.c lavf/tee: pass options to protocol. 2020-06-04 10:52:42 +02:00
teeproto.c
thp.c avformat/thp: Check fps 2020-06-13 00:43:09 +02:00
tiertexseq.c
tls_gnutls.c
tls_libtls.c
tls_mbedtls.c
tls_openssl.c
tls_schannel.c
tls_securetransport.c
tls.c
tls.h
tmv.c
tta.c
ttaenc.c
tty.c
txd.c
ty.c
udp.c
uncodedframecrcenc.c
unix.c
url.c avformat/url: check return value of strchr 2020-06-10 09:22:21 +08:00
url.h URLContext: switch to child_class_iterate() 2020-06-10 12:36:44 +02:00
urldecode.c
urldecode.h
utils.c avformat/utils: reorder duration computation to avoid overflow 2020-07-01 11:41:35 +02:00
v210.c
vag.c
vapoursynth.c
vc1dec.c
vc1test.c
vc1testenc.c
version.h libavformat/img2dec: Added pgx demuxer 2020-07-03 23:28:26 +02:00
vividas.c
vivo.c
voc_packet.c
voc.c
voc.h
vocdec.c
vocenc.c
vorbiscomment.c
vorbiscomment.h
vpcc.c
vpcc.h
vpk.c
vplayerdec.c avformat/vplayerdec: Fix memleak upon read header failure 2020-06-15 16:54:06 +02:00
vqf.c
w64.c
w64.h
wavdec.c
wavenc.c
wc3movie.c
webm_chunk.c
webmdashenc.c
webpenc.c
webvttdec.c avformat/webvttdec: Accept \r as newline 2020-06-26 07:48:10 +02:00
webvttenc.c
westwood_aud.c
westwood_vqa.c
wsddec.c
wtv_common.c
wtv.h
wtvdec.c
wtvenc.c
wv.c
wv.h
wvdec.c
wvedec.c
wvenc.c
xa.c
xmv.c
xvag.c
xwma.c
yop.c
yuv4mpeg.h
yuv4mpegdec.c
yuv4mpegenc.c