]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/idcin.c
use ff_neterrno() and FF_NETERROR() for networking error handling
[ffmpeg] / libavformat / idcin.c
index 48d1e250d79d87a053edca4a53fbf10a96355385..5f2c9cffd89e04822b7d7e42ababcaf9fa64e1c8 100644 (file)
@@ -104,32 +104,28 @@ static int idcin_probe(AVProbeData *p)
      * audio channels: 0 for no audio, or 1 or 2
      */
 
-    /* cannot proceed without 20 bytes */
-    if (p->buf_size < 20)
-        return 0;
-
     /* check the video width */
-    number = LE_32(&p->buf[0]);
+    number = AV_RL32(&p->buf[0]);
     if ((number == 0) || (number > 1024))
        return 0;
 
     /* check the video height */
-    number = LE_32(&p->buf[4]);
+    number = AV_RL32(&p->buf[4]);
     if ((number == 0) || (number > 1024))
        return 0;
 
     /* check the audio sample rate */
-    number = LE_32(&p->buf[8]);
+    number = AV_RL32(&p->buf[8]);
     if ((number != 0) && ((number < 8000) | (number > 48000)))
         return 0;
 
     /* check the audio bytes/sample */
-    number = LE_32(&p->buf[12]);
+    number = AV_RL32(&p->buf[12]);
     if (number > 2)
         return 0;
 
     /* check the audio channels */
-    number = LE_32(&p->buf[16]);
+    number = AV_RL32(&p->buf[16]);
     if (number > 2)
         return 0;
 
@@ -141,7 +137,7 @@ static int idcin_read_header(AVFormatContext *s,
                              AVFormatParameters *ap)
 {
     ByteIOContext *pb = &s->pb;
-    IdcinDemuxContext *idcin = (IdcinDemuxContext *)s->priv_data;
+    IdcinDemuxContext *idcin = s->priv_data;
     AVStream *st;
     unsigned int width, height;
     unsigned int sample_rate, bytes_per_sample, channels;
@@ -218,7 +214,7 @@ static int idcin_read_packet(AVFormatContext *s,
     int ret;
     unsigned int command;
     unsigned int chunk_size;
-    IdcinDemuxContext *idcin = (IdcinDemuxContext *)s->priv_data;
+    IdcinDemuxContext *idcin = s->priv_data;
     ByteIOContext *pb = &s->pb;
     int i;
     int palette_scale;