changeset 2854:c56f975e7661 libavformat

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
author reimar
date Sun, 23 Dec 2007 13:16:55 +0000
parents 7ad207078047
children 46729b573b25
files utils.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Sat Dec 22 16:18:07 2007 +0000
+++ b/utils.c	Sun Dec 23 13:16:55 2007 +0000
@@ -497,6 +497,8 @@
     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){