]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/indeo3.c
Merge commit '2124711b950b03c582a119c75f52a87acc32d6ec'
[ffmpeg] / libavcodec / indeo3.c
index e161f83f91f360a0e5c7cf2ba76fc7f84a66014d..71d478c9fc5b98c0db1a95de8178f307c3a6323d 100644 (file)
@@ -66,7 +66,7 @@ typedef struct Plane {
     uint8_t         *pixels[2]; ///< pointer to the actual pixel data of the buffers above
     uint32_t        width;
     uint32_t        height;
-    uint32_t        pitch;
+    ptrdiff_t       pitch;
 } Plane;
 
 #define CELL_STACK_MAX  20
@@ -166,7 +166,8 @@ static av_cold int allocate_frame_buffers(Indeo3DecodeContext *ctx,
                                           AVCodecContext *avctx, int luma_width, int luma_height)
 {
     int p, chroma_width, chroma_height;
-    int luma_pitch, chroma_pitch, luma_size, chroma_size;
+    int luma_size, chroma_size;
+    ptrdiff_t luma_pitch, chroma_pitch;
 
     if (luma_width  < 16 || luma_width  > 640 ||
         luma_height < 16 || luma_height > 480 ||
@@ -425,7 +426,7 @@ if (*data_ptr >= last_ptr) \
 
 static int decode_cell_data(Indeo3DecodeContext *ctx, Cell *cell,
                             uint8_t *block, uint8_t *ref_block,
-                            int pitch, int h_zoom, int v_zoom, int mode,
+                            ptrdiff_t row_offset, int h_zoom, int v_zoom, int mode,
                             const vqEntry *delta[2], int swap_quads[2],
                             const uint8_t **data_ptr, const uint8_t *last_ptr)
 {
@@ -436,9 +437,8 @@ static int decode_cell_data(Indeo3DecodeContext *ctx, Cell *cell,
     unsigned int  dyad1, dyad2;
     uint64_t      pix64;
     int           skip_flag = 0, is_top_of_cell, is_first_row = 1;
-    int           row_offset, blk_row_offset, line_offset;
+    int           blk_row_offset, line_offset;
 
-    row_offset     =  pitch;
     blk_row_offset = (row_offset << (2 + v_zoom)) - (cell->width << 2);
     line_offset    = v_zoom ? row_offset : 0;
 
@@ -1025,11 +1025,11 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
  *  @param[in]  dst_height   output plane height
  */
 static void output_plane(const Plane *plane, int buf_sel, uint8_t *dst,
-                         int dst_pitch, int dst_height)
+                         ptrdiff_t dst_pitch, int dst_height)
 {
     int             x,y;
     const uint8_t   *src  = plane->pixels[buf_sel];
-    uint32_t        pitch = plane->pitch;
+    ptrdiff_t       pitch = plane->pitch;
 
     dst_height = FFMIN(dst_height, plane->height);
     for (y = 0; y < dst_height; y++) {