Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> --- libavcodec/ffv1dec.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 261e0cf70c..e37deaec33 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -311,7 +311,10 @@ static int decode_slice(AVCodecContext *c, void *arg) if (fs->ac == AC_GOLOMB_RICE) { if (f->version == 3 && f->micro_version > 1 || f->version > 3) - get_rac(&fs->c, (uint8_t[]) { 129 }); + if (ff_rac_check_termination(&fs->c, 1) < 0) { + av_log(f->avctx, AV_LOG_ERROR, "bytestream termination mismatching\n"); + fs->slice_damaged = 1; + } fs->ac_byte_count = f->version > 2 || (!x && !y) ? fs->c.bytestream - fs->c.bytestream_start - 1 : 0; init_get_bits(&fs->gb, fs->c.bytestream_start + fs->ac_byte_count, @@ -350,7 +353,10 @@ static int decode_slice(AVCodecContext *c, void *arg) } if (fs->ac != AC_GOLOMB_RICE && f->version > 2) { int v; - get_rac(&fs->c, (uint8_t[]) { 129 }); + if (ff_rac_check_termination(&fs->c, 1) < 0) { + av_log(f->avctx, AV_LOG_ERROR, "bytestream termination mismatching\n"); + fs->slice_damaged = 1; + } v = fs->c.bytestream_end - fs->c.bytestream - 2 - 5*f->ec; if (v) { av_log(f->avctx, AV_LOG_ERROR, "bytestream end mismatching by %d\n", v); -- 2.20.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel