[FFmpeg-cvslog] mp3dec: forward errors for av_get_packet().

Anton Khirnov git at videolan.org
Sun Jul 29 02:26:23 CEST 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Jul 28 12:21:21 2012 +0200| [f73e3938ac70524826664855210446c3739c4a5e] | committer: Anton Khirnov

mp3dec: forward errors for av_get_packet().

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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f73e3938ac70524826664855210446c3739c4a5e
---

 libavformat/mp3dec.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 11e684d..a208488 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -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)



More information about the ffmpeg-cvslog mailing list