]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/pcx.c
libavcodec/x86/mpegvideo: switch to av_assert2
[ffmpeg] / libavcodec / pcx.c
index 722e89ff96b1b25ee67d94aa5921095d6769f92f..bac818c58629604d2d650cedfd9c6781dfc99839 100644 (file)
@@ -26,6 +26,7 @@
 #include "avcodec.h"
 #include "bytestream.h"
 #include "get_bits.h"
+#include "internal.h"
 
 typedef struct PCXContext {
     AVFrame picture;
@@ -74,7 +75,7 @@ static void pcx_palette(GetByteContext *gb, uint32_t *dst, int pallen)
         memset(dst, 0, (256 - pallen) * sizeof(*dst));
 }
 
-static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
+static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
                             AVPacket *avpkt)
 {
     PCXContext * const s = avctx->priv_data;
@@ -150,7 +151,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
         return AVERROR_INVALIDDATA;
     if (w != avctx->width || h != avctx->height)
         avcodec_set_dimensions(avctx, w, h);
-    if ((ret = avctx->get_buffer(avctx, p)) < 0) {
+    if ((ret = ff_get_buffer(avctx, p)) < 0) {
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         return ret;
     }
@@ -239,7 +240,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     }
 
     *picture = s->picture;
-    *data_size = sizeof(AVFrame);
+    *got_frame = 1;
 
 end:
     av_free(scanline);