X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fffv1dec_template.c;h=1b7f6c4bf560432228d75e14b09421979da226dc;hb=7f3d39b21f893145dcfd33abf6f6a2c994b246ec;hp=fecdbd0025c9733d8b5366b790d8cbe11c835d5d;hpb=50ae1f7e0ff1fa00236622415039f7e28d919a25;p=ffmpeg diff --git a/libavcodec/ffv1dec_template.c b/libavcodec/ffv1dec_template.c index fecdbd0025c..1b7f6c4bf56 100644 --- a/libavcodec/ffv1dec_template.c +++ b/libavcodec/ffv1dec_template.c @@ -50,6 +50,11 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w, for (x = 0; x < w; x++) { int diff, context, sign; + if (!(x & 1023)) { + if (is_input_end(s)) + return AVERROR_INVALIDDATA; + } + context = RENAME(get_context)(p, sample[1] + x, sample[0] + x, sample[1] + x); if (context < 0) { context = -context; @@ -81,6 +86,11 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w, run_mode = 2; } } + while (run_count > 1 && w-x > 1) { + sample[1][x] = RENAME(predict)(sample[1] + x, sample[0] + x); + x++; + run_count--; + } run_count--; if (run_count < 0) { run_mode = 0;