]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cinepak.c
oggparsevorbis: Add some sanity checks to header packet ordering/presence.
[ffmpeg] / libavcodec / cinepak.c
index 78ddde2eb90467f18356fd52183c73967d1a2156..8e7aa5aa998d5d85234817fb8e298e96f2c765b2 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 /**
- * @file cinepak.c
+ * @file
  * Cinepak video decoder
  * by Ewald Snel <ewald@rambo.its.tudelft.nl>
  * For more information on the Cinepak algorithm, visit:
@@ -32,7 +32,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
@@ -358,7 +357,7 @@ static int cinepak_decode (CinepakContext *s)
         if ((s->data + 12) > eod)
             return -1;
 
-        s->strips[i].id = AV_RB16 (s->data);
+        s->strips[i].id = s->data[0];
         s->strips[i].y1 = y0;
         s->strips[i].x1 = 0;
         s->strips[i].y2 = y0 + AV_RB16 (&s->data[8]);
@@ -411,8 +410,10 @@ static av_cold int cinepak_decode_init(AVCodecContext *avctx)
 
 static int cinepak_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;
     CinepakContext *s = avctx->priv_data;
 
     s->data = buf;
@@ -456,7 +457,7 @@ static av_cold int cinepak_decode_end(AVCodecContext *avctx)
 
 AVCodec cinepak_decoder = {
     "cinepak",
-    CODEC_TYPE_VIDEO,
+    AVMEDIA_TYPE_VIDEO,
     CODEC_ID_CINEPAK,
     sizeof(CinepakContext),
     cinepak_decode_init,