]> git.sesse.net Git - ffmpeg/commitdiff
mp3dec: forward errors for av_get_packet().
authorAnton Khirnov <anton@khirnov.net>
Sat, 28 Jul 2012 10:21:21 +0000 (12:21 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sat, 28 Jul 2012 12:37:00 +0000 (14:37 +0200)
Don't invent a bogus EIO error.

The code now doesn't check for ret == 0, but that check is redundant,
av_get_packet() never returns 0.

libavformat/mp3dec.c

index 11e684d7f362a95499e1f54a45c7a779626e4479..a2084889308ccf5173dedb3af8b91a1f717c84a8 100644 (file)
@@ -188,11 +188,10 @@ static int mp3_read_packet(AVFormatContext *s, AVPacket *pkt)
     int ret;
 
     ret = av_get_packet(s->pb, pkt, MP3_PACKET_SIZE);
+    if (ret < 0)
+        return ret;
 
     pkt->stream_index = 0;
-    if (ret <= 0) {
-        return AVERROR(EIO);
-    }
 
     if (ret > ID3v1_TAG_SIZE &&
         memcmp(&pkt->data[ret - ID3v1_TAG_SIZE], "TAG", 3) == 0)