]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - libavcodec/loco.c
Fix segault
[frescor/ffmpeg.git] / libavcodec / loco.c
index fcf93151e1e7be66d34d4e5e714273185da7c3a7..4fd64f4bdafd480ef8fac910c0da88718f6d013e 100644 (file)
  */
 
 /**
- * @file loco.c
+ * @file libavcodec/loco.c
  * LOCO codec.
  */
 
 #include "avcodec.h"
-#include "bitstream.h"
+#include "get_bits.h"
 #include "golomb.h"
+#include "mathops.h"
 
 enum LOCO_MODE {LOCO_UNKN=0, LOCO_CYUY2=-1, LOCO_CRGB=-2, LOCO_CRGBA=-3, LOCO_CYV12=-4,
  LOCO_YUY2=1, LOCO_UYVY=2, LOCO_RGB=3, LOCO_RGBA=4, LOCO_YV12=5};
@@ -157,8 +158,10 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh
 
 static int decode_frame(AVCodecContext *avctx,
                         void *data, int *data_size,
-                        const uint8_t *buf, int buf_size)
+                        AVPacket *avpkt)
 {
+    const uint8_t *buf = avpkt->data;
+    int buf_size = avpkt->size;
     LOCOContext * const l = avctx->priv_data;
     AVFrame * const p= (AVFrame*)&l->pic;
     int decoded;
@@ -282,5 +285,5 @@ AVCodec loco_decoder = {
     NULL,
     decode_frame,
     CODEC_CAP_DR1,
-    .long_name = "LOCO",
+    .long_name = NULL_IF_CONFIG_SMALL("LOCO"),
 };