]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/dxa.c
Remove unnecessary header inclusion directives.
[ffmpeg] / libavformat / dxa.c
index 5b6cd67b59a462250c5913211569103f790b9576..c00c917d0b9c776276e78e1aebbc0cfbd690e359 100644 (file)
@@ -36,9 +36,15 @@ typedef struct{
 
 static int dxa_probe(AVProbeData *p)
 {
+    int w, h;
+    if (p->buf_size < 15)
+        return 0;
+    w = AV_RB16(p->buf + 11);
+    h = AV_RB16(p->buf + 13);
     /* check file header */
     if (p->buf[0] == 'D' && p->buf[1] == 'E' &&
-        p->buf[2] == 'X' && p->buf[3] == 'A')
+        p->buf[2] == 'X' && p->buf[3] == 'A' &&
+        w && w <= 2048 && h && h <= 2048)
         return AVPROBE_SCORE_MAX;
     else
         return 0;
@@ -113,7 +119,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
     }
 
     /* now we are ready: build format streams */
-    st->codec->codec_type = CODEC_TYPE_VIDEO;
+    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
     st->codec->codec_id   = CODEC_ID_DXA;
     st->codec->width      = w;
     st->codec->height     = h;