summaryrefslogtreecommitdiff
path: root/libavcodec/vp56rac.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-20 09:16:40 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-09-11 22:36:33 +0200
commitb6b9ac5698c8f911841b469af77199153278c55c (patch)
treecc2970f2a67752d1912426a32bb47fa1224dbf78 /libavcodec/vp56rac.c
parentb81a1c5bea34da7b145c4dd95a7680cdfa42168f (diff)
avcodec/vp56rac: delay signaling an error on truncated input
A threshold of 1 is sufficient for simple_dump_cut.webm, 10 is used just to be sure the next truncated file doesnt cause the same issue Obvious alternative fixes are to simply accept that the file is broken or to write some advanced error concealment or to simply accept that the decoder wont stop at the end of input. Fixes: Ticket 8069 (artifacts not the differing md5 which was there before 1afd246960202917e244c844c534e9c1e3c323f5) Fixes: simple_dump_cut.webm Fixes: regression of 1afd246960202917e244c844c534e9c1e3c323f5 fate-vp5 changes because the last frame is truncated and now handled differently. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/vp56rac.c')
-rw-r--r--libavcodec/vp56rac.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/vp56rac.c b/libavcodec/vp56rac.c
index e70302bf85..64fb6a99b4 100644
--- a/libavcodec/vp56rac.c
+++ b/libavcodec/vp56rac.c
@@ -43,6 +43,7 @@ int ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_si
c->bits = -16;
c->buffer = buf;
c->end = buf + buf_size;
+ c->end_reached = 0;
if (buf_size < 1)
return AVERROR_INVALIDDATA;
c->code_word = bytestream_get_be24(&c->buffer);