summaryrefslogtreecommitdiff
path: root/libavcodec/escape124.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-09-30 18:25:04 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-05 14:38:52 +0200
commitfcfa6965e5e398a850d87a276b0deb5dc5d1525e (patch)
tree6ac6af1107c588d64106d5b324e0115c8bfbfc73 /libavcodec/escape124.c
parentfced3a17dbdade0635fe900ad0b748c5278c01a2 (diff)
downloadffmpeg-fcfa6965e5e398a850d87a276b0deb5dc5d1525e.tar.gz
avcodec/escape124: Fix segfault with negative linesizes
Use ptrdiff_t instead of unsigned for linesizes. Fixes the armovie-escape124 FATE test with negative linesizes. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/escape124.c')
-rw-r--r--libavcodec/escape124.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c
index eeeb9bb0f7..024eec59ce 100644
--- a/libavcodec/escape124.c
+++ b/libavcodec/escape124.c
@@ -178,8 +178,8 @@ static void insert_mb_into_sb(SuperBlock* sb, MacroBlock mb, unsigned index) {
dst[4] = mb.pixels32[1];
}
-static void copy_superblock(uint16_t* dest, unsigned dest_stride,
- uint16_t* src, unsigned src_stride)
+static void copy_superblock(uint16_t* dest, ptrdiff_t dest_stride,
+ uint16_t* src, ptrdiff_t src_stride)
{
unsigned y;
if (src)
@@ -211,7 +211,7 @@ static int escape124_decode_frame(AVCodecContext *avctx, AVFrame *frame,
superblocks_per_row = avctx->width / 8, skip = -1;
uint16_t* old_frame_data, *new_frame_data;
- unsigned old_stride, new_stride;
+ ptrdiff_t old_stride, new_stride;
int ret;