summaryrefslogtreecommitdiff
path: root/tests/fate
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-12-28 03:40:33 +0100
committerJames Almer <jamrial@gmail.com>2019-12-28 22:40:13 -0300
commit2ff687c17f3542b0e95c3b95fe6c844f3e809ed8 (patch)
tree6d5dc4ccffc93d79bcef09e5e1534ec5f91c19b8 /tests/fate
parent6c735b96ee45bce24be6513bb9b292b5c7ecd8ee (diff)
avformat/matroskadec: Fix lzo decompression
When a Matroska Block is only stored in compressed form, the size of the uncompressed block is not explicitly coded and therefore not known before decompressing it. Therefore the demuxer uses a guess for the uncompressed size: The first guess is three times the compressed size and if this is not enough, it is repeatedly incremented by a factor of three. But when this happens with lzo, the decompression is neither resumed nor started again. Instead when av_lzo1x_decode indicates that x bytes of input data could not be decoded, because the output buffer is already full, the first (not the last) x bytes of the input buffer are resent for decoding in the next try; they overwrite already decoded data. This commit fixes this by instead restarting the decompression anew, just with a bigger buffer. This seems to be a regression since 935ec5a1. A FATE-test for this has been added. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'tests/fate')
-rw-r--r--tests/fate/matroska.mak4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak
index 597be7346c..4aca4dc8eb 100644
--- a/tests/fate/matroska.mak
+++ b/tests/fate/matroska.mak
@@ -22,6 +22,10 @@ fate-matroska-xiph-lacing: CMD = framecrc -i $(TARGET_SAMPLES)/mkv/xiph_lacing.m
FATE_MATROSKA-$(call ALLYES, MATROSKA_DEMUXER ZLIB) += fate-matroska-zlib-decompression
fate-matroska-zlib-decompression: CMD = framecrc -i $(TARGET_SAMPLES)/mkv/subtitle_zlib.mks -c:s copy
+# This tests that the matroska demuxer can decompress lzo compressed tracks.
+FATE_MATROSKA-$(call ALLYES, MATROSKA_DEMUXER LZO) += fate-matroska-lzo-decompression
+fate-matroska-lzo-decompression: CMD = framecrc -i $(TARGET_SAMPLES)/mkv/lzo.mka -c copy
+
# This tests that the matroska demuxer correctly propagates
# the channel layout contained in vorbis comments in the CodecPrivate
# of flac tracks. It also tests header removal compression.