Commit 2904aae1 authored by reimar's avatar reimar

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


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11307 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 563f243c
...@@ -497,6 +497,8 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -497,6 +497,8 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt)
AVStream *st; AVStream *st;
av_init_packet(pkt); av_init_packet(pkt);
ret= s->iformat->read_packet(s, pkt); ret= s->iformat->read_packet(s, pkt);
if (ret < 0)
return ret;
st= s->streams[pkt->stream_index]; st= s->streams[pkt->stream_index];
switch(st->codec->codec_type){ switch(st->codec->codec_type){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment