aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cdxl.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-09-22 23:10:51 +0200
committerPaul B Mahol <onemda@gmail.com>2023-09-22 23:12:55 +0200
commit445167d5fd64c685f9d908cba12de40c1d58d875 (patch)
treebb7c56d43f2644dae08398b91d15a4efc780d9e9 /libavcodec/cdxl.c
parent24f63cb2b753c5b8bdd56b5b70feeb251c422cca (diff)
downloadffmpeg-445167d5fd64c685f9d908cba12de40c1d58d875.tar.gz
avcodec/cdxl: fix decoding with AVFrame's negative linesize
Diffstat (limited to 'libavcodec/cdxl.c')
-rw-r--r--libavcodec/cdxl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c
index 885047af84..6843fceb2f 100644
--- a/libavcodec/cdxl.c
+++ b/libavcodec/cdxl.c
@@ -125,9 +125,10 @@ static void chunky2chunky(CDXLVideoContext *c, int linesize, uint8_t *out)
}
}
-static void import_format(CDXLVideoContext *c, int linesize, uint8_t *out)
+static void import_format(CDXLVideoContext *c, ptrdiff_t linesize, uint8_t *out)
{
- memset(out, 0, linesize * c->avctx->height);
+ for (int y = 0; y < c->avctx->height; y++)
+ memset(out + y * linesize, 0, c->avctx->width);
switch (c->format) {
case BIT_PLANAR: