ffmpeg/tests/fate
Andreas Rheinhardt e5e5be4c7f avcodec/flac_parser: Fix off-by-one error
The flac parser uses a fifo to buffer its data. Consequently, when
searching for sync codes of flac packets, one needs to take care of
the possibility of wraparound. This is done by using an optimized start
code search that works on each of the continuous buffers separately and
by explicitly checking whether the last pre-wrap byte and the first
post-wrap byte constitute a valid sync code.

Moreover, the last MAX_FRAME_HEADER_SIZE - 1 bytes ought not to be searched
for (the start of) a sync code because a header that might be found in this
region might not be completely available. These bytes ought to be searched
lateron when more data is available or when flushing.

Unfortunately there was an off-by-one error in the calculation of the
length to search of the post-wrap buffer: It was too large, because the
calculation was based on the amount of bytes available in the fifo from
the last pre-wrap byte onwards. This meant that a header might be
parsed twice (once prematurely and once regularly when more data is
available); it could also mean that an invalid header will be treated as
valid (namely if the length of said invalid header is
MAX_FRAME_HEADER_SIZE and the invalid byte that will be treated as the
last byte of this potential header happens to be the right CRC-8).

Should a header be parsed twice, the second instance will be the best child
of the first instance; the first instance's score will be
FLAC_HEADER_BASE_SCORE - FLAC_HEADER_CHANGED_PENALTY ( = 3) higher than
the second instance's score. So the frame belonging to the first
instance will be output and it will be done as a zero length frame (the
difference of the header's offset and the child's offset). This has
serious consequences when flushing, as returning a zero length buffer
signals to the caller that no more data will be output; consequently the
last frames not yet output will be dropped.

Furthermore, a "sample/frame number mismatch in adjacent frames" warning
got output when returning the zero-length frame belonging to the first
header, because the child's sample/frame number of course didn't match
the expected sample frame/number given its parent.

filter/hdcd-mix.flac from the FATE-suite was affected by this (the last
frame was omitted) which is the reason why several FATE-tests needed to
be updated.

Fixes ticket #5937.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-10-07 22:27:18 +02:00
..
aac.mak fate: remove the fate-aac-ltp-encode test 2018-01-13 12:03:49 +00:00
ac3.mak fate: add test for eac3 dependant stream 2018-03-30 14:05:10 -03:00
acodec.mak avcodec/dcaenc: Use ffmpeg mdct instead of own implementation 2018-01-13 18:13:58 +00:00
adpcm.mak
alac.mak
als.mak fate/als: Add test for conformance file with 512 channels. 2019-08-24 09:33:44 +02:00
amrnb.mak
amrwb.mak
api.mak tests: Add EXESUF to program calls. 2019-04-19 01:11:39 +02:00
apng.mak
atrac.mak
audio.mak fate: add dst decoder test 2019-06-10 09:44:11 +10:00
bmp.mak
build.mak Merge commit 'db869f4ea4405fb8f9736e5ecdca70f77621a28e' 2017-10-11 19:02:04 -03:00
canopus.mak
cbs.mak cbs_h265: Add PTL parsing for sublayers 2018-11-11 17:22:09 +00:00
cdxl.mak
checkasm.mak checkasm/vf_eq: add test for vf_eq 2019-09-26 08:10:31 +08:00
concatdec.mak
cover-art.mak
dca.mak fate: add a dca_core bitstream filter test 2018-03-17 12:34:46 -03:00
demux.mak tests/fate/demux: Add test for d25c945247 2018-07-07 12:09:34 +02:00
dfa.mak
dnn.mak FATE/dnn: add unit test for layer maximum 2019-09-20 10:57:23 -03:00
dnxhd.mak
dpcm.mak
ea.mak
exif.mak
ffmpeg.mak fate: add test for stream_loop 2019-09-05 23:23:24 +05:30
ffprobe.mak
fft.mak tests: Add EXESUF to program calls. 2019-04-19 01:11:39 +02:00
fifo-muxer.mak tests/fate/fifo-muxer: update fifo-muxer dependencies 2017-05-08 08:42:00 +02:00
filter-audio.mak avcodec/flac_parser: Fix off-by-one error 2019-10-07 22:27:18 +02:00
filter-video.mak lavfi/concat: allow to support inputs with different frame rates 2019-09-08 16:48:28 +02:00
fits.mak fate: Fix fitsdec-gbrap16 test on big-endian hardware. 2017-11-04 00:47:37 +01:00
flac.mak
flvenc.mak fate/flvenc: set bitexact output format flag explicitly 2017-08-30 23:28:21 -03:00
gapless.mak lavc: prefer the mp3float decoder to the mp3 decoder 2018-04-01 13:02:12 +01:00
gif.mak fate: add accurate_rnd+bitexact sws_flags for fate-gifenc 2019-08-17 17:33:16 +02:00
h264.mak fate: add h264 timecode test 2018-10-23 15:46:30 +01:00
hap.mak fate: fix hapqa-extract-nosnappy tests on small builds 2018-09-06 19:24:14 -03:00
hevc.mak FATE: Add test for HEVC files that claim to have two first slices 2019-04-05 14:16:52 +01:00
hlsenc.mak FATE: add hls single file mode test case 2019-08-01 19:25:29 +08:00
hw.mak tests: Add EXESUF to program calls. 2019-04-19 01:11:39 +02:00
id3v2.mak fate: add id3v2 test 2018-02-02 12:16:56 -03:00
image.mak fate/exr : add test for long name flag 2018-02-24 21:42:46 +01:00
indeo.mak
lavf-audio.mak Merge commit 'eb8a8115994434b548523cf0bca6a4a74784e79c' 2019-03-14 14:19:03 -03:00
lavf-container.mak lavf/movenc: fix tmcd writing for non-MP4/MOV modes 2019-04-03 15:50:22 +05:30
lavf-image.mak fate/lavf-image: fix passed arguments for some high bit depth tests 2019-03-14 17:15:28 -03:00
lavf-image2pipe.mak tests: Convert image2pipe tests to non-legacy test scripts 2019-02-16 18:15:11 +01:00
lavf-video.mak Merge commit 'f8df5e2f31a5ba7b30a0e1caaaf5a03c753b3f9b' 2019-03-14 14:59:45 -03:00
libavcodec.mak lavc/h265_profile_level: Add unit test 2019-07-07 13:29:50 +01:00
libavdevice.mak
libavformat.mak tests: Add EXESUF to program calls. 2019-04-19 01:11:39 +02:00
libavresample.mak
libavutil.mak tests: Add EXESUF to program calls. 2019-04-19 01:11:39 +02:00
libswresample.mak Merge commit '4141a5a240fba44b4b4a1c488c279d7dd8a11ec7' 2017-10-03 21:28:07 -03:00
libswscale.mak tests: Add EXESUF to program calls. 2019-04-19 01:11:39 +02:00
lossless-audio.mak
lossless-video.mak
matroska.mak avformat/matroskaenc: Don't waste bytes writing level 1 elements 2019-05-08 13:02:30 -03:00
microsoft.mak fate: Add test for vc1test demuxer 2018-11-12 19:13:36 +08:00
monkeysaudio.mak
mov.mak fate: add prog suffix in fate-mov-mp4-with-mov-in24-ver 2018-12-11 20:51:17 +05:30
mp3.mak Merge commit '4141a5a240fba44b4b4a1c488c279d7dd8a11ec7' 2017-10-03 21:28:07 -03:00
mpc.mak Use modern avconv syntax for codec selection in documentation and tests 2017-02-27 10:36:45 +01:00
mpeg4.mak
mpegps.mak fate/mpegps: add tests for PCM_DVD stream remux 2018-02-16 21:53:22 +01:00
mpegts.mak avformat/mpegts: add merge_pmt_versions option 2018-05-18 19:00:29 -07:00
mxf.mak fate/mxf: add mxf user comments tests 2019-03-13 12:39:51 +01:00
opus.mak avcodec/opus: set skip_samples 2018-11-28 10:26:07 +01:00
pcm.mak Merge commit '043b0b9fb1481053b712d06d2c5b772f1845b72b' 2017-03-24 11:40:35 +01:00
pixfmt.mak Merge commit '896fe15dbb7b78de495c4a7dd75e7faec66778da' 2019-03-14 14:31:48 -03:00
pixlet.mak fate/pixlet : add test for rgb 2017-08-31 02:53:11 +02:00
probe.mak
prores.mak avcodec/proresdec : add 12b decoding 2018-12-02 12:55:57 +01:00
qt.mak fate: disable fate-svq3-2 2017-10-02 21:42:34 -03:00
qtrle.mak fate/qtrle : change 32b test to output bgra instead of rgb24 2019-03-04 13:03:34 +01:00
real.mak Merge commit '043b0b9fb1481053b712d06d2c5b772f1845b72b' 2017-03-24 11:40:35 +01:00
screen.mak Merge commit '4d4d7cf9d539a053f531f662a972b23d335738eb' 2017-10-27 21:16:18 -03:00
seek.mak Merge commit 'f8df5e2f31a5ba7b30a0e1caaaf5a03c753b3f9b' 2019-03-14 14:59:45 -03:00
segment.mak Merge commit 'f8df5e2f31a5ba7b30a0e1caaaf5a03c753b3f9b' 2019-03-14 14:59:45 -03:00
source-check.sh tests/fate/source-check: Use git grep in place of grep 2017-03-30 03:12:05 +02:00
source.mak
speedhq.mak speedhq: add FATE tests 2017-08-03 16:36:02 -03:00
subtitles.mak avcodec/mpeg12dec: parse A53 caption data embedded in SCTE-20 user data 2017-11-15 18:14:39 -08:00
utvideo.mak avcodec/utvideoenc: switch to planar RGB formats 2018-01-02 13:41:50 +01:00
vcodec.mak fate/proresenc_aw : add test for interlace and 444 encoding 2019-02-27 17:59:53 +01:00
video.mak fate: add a case for ticket #3229 2019-08-13 10:46:20 +08:00
voice.mak
vorbis.mak
vpx.mak fate: add VP4 test 2019-06-12 20:06:20 +10:00
vqf.mak Merge commit '4141a5a240fba44b4b4a1c488c279d7dd8a11ec7' 2017-10-03 21:28:07 -03:00
wavpack.mak avformat/matroskaenc: Don't waste bytes writing level 1 elements 2019-05-08 13:02:30 -03:00
wma.mak
xvid.mak