diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2007-12-23 13:16:55 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2007-12-23 13:16:55 +0000 |
commit | 88b00723906f68b7563214c30333e48888dddf78 (patch) | |
tree | 9fc1e2f1891a7c76783c0ce7b39c23791450eb3d | |
parent | 08571377e6b3fc09dc139391f3e96a0688d1a07d (diff) | |
download | ffmpeg-88b00723906f68b7563214c30333e48888dddf78.tar.gz |
100l, av_read_packet must check for read_packet error, in case of
error pkt->stream_index could be invalid and must not be used.
Fixes a crash with http://www.cs.berkeley.edu/~dmolnar/2-snippet3.wav
Originally committed as revision 11307 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 59dc8dbacc..dabe025abe 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -497,6 +497,8 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt) AVStream *st; av_init_packet(pkt); ret= s->iformat->read_packet(s, pkt); + if (ret < 0) + return ret; st= s->streams[pkt->stream_index]; switch(st->codec->codec_type){ |