summaryrefslogtreecommitdiff
path: root/libavcodec/sanm.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2016-08-26 12:44:37 +0200
committerDiego Biurrun <diego@biurrun.de>2016-09-04 12:19:58 +0200
commit5b5ed92d92252a685e891a5d636870e223b63228 (patch)
tree5f55682ab5ca952d7dbeffe6d32de8bbd32f70d8 /libavcodec/sanm.c
parent73f5e17a203713c4ac4e5a821809823b383b195f (diff)
downloadffmpeg-5b5ed92d92252a685e891a5d636870e223b63228.tar.gz
sanm: Change type of array pitch parameters to ptrdiff_t
ptrdiff_t is the correct type for array pitches and similar.
Diffstat (limited to 'libavcodec/sanm.c')
-rw-r--r--libavcodec/sanm.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c
index 6436f84895..3d231957ae 100644
--- a/libavcodec/sanm.c
+++ b/libavcodec/sanm.c
@@ -217,7 +217,7 @@ typedef struct SANMVideoContext {
uint32_t pal[PALETTE_SIZE];
int16_t delta_pal[PALETTE_DELTA];
- int pitch;
+ ptrdiff_t pitch;
int width, height;
int aligned_width, aligned_height;
int prev_seq;
@@ -571,7 +571,7 @@ static inline void codec37_mv(uint8_t *dst, const uint8_t *src,
static int old_codec37(SANMVideoContext *ctx, int top,
int left, int width, int height)
{
- int stride = ctx->pitch;
+ ptrdiff_t stride = ctx->pitch;
int i, j, k, t;
uint8_t *dst, *prev;
int skip_run = 0;
@@ -809,7 +809,7 @@ static int old_codec47(SANMVideoContext *ctx, int top,
{
uint32_t decoded_size;
int i, j;
- int stride = ctx->pitch;
+ ptrdiff_t stride = ctx->pitch;
uint8_t *dst = (uint8_t *)ctx->frm0 + left + top * stride;
uint8_t *prev1 = (uint8_t *)ctx->frm1;
uint8_t *prev2 = (uint8_t *)ctx->frm2;
@@ -962,11 +962,11 @@ static int decode_nop(SANMVideoContext *ctx)
return AVERROR_PATCHWELCOME;
}
-static void copy_block(uint16_t *pdest, uint16_t *psrc, int block_size, int pitch)
+static void copy_block(uint16_t *pdest, uint16_t *psrc, int block_size, ptrdiff_t pitch)
{
uint8_t *dst = (uint8_t *)pdest;
uint8_t *src = (uint8_t *)psrc;
- int stride = pitch * 2;
+ ptrdiff_t stride = pitch * 2;
switch (block_size) {
case 2:
@@ -981,7 +981,7 @@ static void copy_block(uint16_t *pdest, uint16_t *psrc, int block_size, int pitc
}
}
-static void fill_block(uint16_t *pdest, uint16_t color, int block_size, int pitch)
+static void fill_block(uint16_t *pdest, uint16_t color, int block_size, ptrdiff_t pitch)
{
int x, y;
@@ -993,7 +993,7 @@ static void fill_block(uint16_t *pdest, uint16_t color, int block_size, int pitc
static int draw_glyph(SANMVideoContext *ctx, uint16_t *dst, int index,
uint16_t fg_color, uint16_t bg_color, int block_size,
- int pitch)
+ ptrdiff_t pitch)
{
int8_t *pglyph;
uint16_t colors[2] = { fg_color, bg_color };
@@ -1013,7 +1013,7 @@ static int draw_glyph(SANMVideoContext *ctx, uint16_t *dst, int index,
return 0;
}
-static int opcode_0xf7(SANMVideoContext *ctx, int cx, int cy, int block_size, int pitch)
+static int opcode_0xf7(SANMVideoContext *ctx, int cx, int cy, int block_size, ptrdiff_t pitch)
{
uint16_t *dst = ctx->frm0 + cx + cy * ctx->pitch;
@@ -1047,7 +1047,7 @@ static int opcode_0xf7(SANMVideoContext *ctx, int cx, int cy, int block_size, in
return 0;
}
-static int opcode_0xf8(SANMVideoContext *ctx, int cx, int cy, int block_size, int pitch)
+static int opcode_0xf8(SANMVideoContext *ctx, int cx, int cy, int block_size, ptrdiff_t pitch)
{
uint16_t *dst = ctx->frm0 + cx + cy * ctx->pitch;
@@ -1317,8 +1317,8 @@ static int copy_output(SANMVideoContext *ctx, SANMFrameHeader *hdr)
{
uint8_t *dst;
const uint8_t *src = (uint8_t*) ctx->frm0;
- int ret, dstpitch, height = ctx->height;
- int srcpitch = ctx->pitch * (hdr ? sizeof(ctx->frm0[0]) : 1);
+ int ret, height = ctx->height;
+ ptrdiff_t dstpitch, srcpitch = ctx->pitch * (hdr ? sizeof(ctx->frm0[0]) : 1);
if ((ret = ff_get_buffer(ctx->avctx, ctx->frame, 0)) < 0)
return ret;