]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/msrledec.c
lavc: Add spherical packet side data API
[ffmpeg] / libavcodec / msrledec.c
index af2a2478b1a6ef30754b9584f659e762460ebef1..f45179f26eb4e38f25b0b4759497b84a79e9e526 100644 (file)
@@ -30,7 +30,7 @@
 #include "avcodec.h"
 #include "msrledec.h"
 
-static int msrle_decode_pal4(AVCodecContext *avctx, AVPicture *pic,
+static int msrle_decode_pal4(AVCodecContext *avctx, AVFrame *pic,
                              GetByteContext *gb)
 {
     unsigned char rle_code;
@@ -39,7 +39,7 @@ static int msrle_decode_pal4(AVCodecContext *avctx, AVPicture *pic,
     unsigned int pixel_ptr = 0;
     int row_dec = pic->linesize[0];
     int row_ptr = (avctx->height - 1) * row_dec;
-    int frame_size = row_dec * avctx->height;
+    int frame_size = FFABS(row_dec) * avctx->height;
     int i;
 
     while (row_ptr >= 0) {
@@ -128,7 +128,7 @@ static int msrle_decode_pal4(AVCodecContext *avctx, AVPicture *pic,
 }
 
 
-static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic,
+static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVFrame *pic,
                                    int depth, GetByteContext *gb)
 {
     uint8_t *output, *output_end;
@@ -243,7 +243,7 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic,
 }
 
 
-int ff_msrle_decode(AVCodecContext *avctx, AVPicture *pic,
+int ff_msrle_decode(AVCodecContext *avctx, AVFrame *pic,
                     int depth, GetByteContext *gb)
 {
     switch(depth){