From 1e1ddbb70dd13c00c2e7378c17b3435325b856cf Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 27 Sep 2022 20:29:41 +0200 Subject: [PATCH] avcodec/zerocodec: Avoid undefined NULL - 0 Fixes the zerocodec FATE-test. Signed-off-by: Andreas Rheinhardt --- libavcodec/zerocodec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/zerocodec.c b/libavcodec/zerocodec.c index 93fc2834e4..42fb24ff6c 100644 --- a/libavcodec/zerocodec.c +++ b/libavcodec/zerocodec.c @@ -84,11 +84,12 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, AVFrame *pic, return AVERROR_INVALIDDATA; } - if (!(avpkt->flags & AV_PKT_FLAG_KEY)) + if (!(avpkt->flags & AV_PKT_FLAG_KEY)) { for (j = 0; j < avctx->width << 1; j++) dst[j] += prev[j] & -!dst[j]; + prev -= prev_pic->linesize[0]; + } - prev -= prev_pic->linesize[0]; dst -= pic->linesize[0]; }