comparison utils.c @ 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 bc317b8d7090
children e6e210e4581d
comparison
equal deleted inserted replaced
2853:7ad207078047 2854:c56f975e7661
495 { 495 {
496 int ret; 496 int ret;
497 AVStream *st; 497 AVStream *st;
498 av_init_packet(pkt); 498 av_init_packet(pkt);
499 ret= s->iformat->read_packet(s, pkt); 499 ret= s->iformat->read_packet(s, pkt);
500 if (ret < 0)
501 return ret;
500 st= s->streams[pkt->stream_index]; 502 st= s->streams[pkt->stream_index];
501 503
502 switch(st->codec->codec_type){ 504 switch(st->codec->codec_type){
503 case CODEC_TYPE_VIDEO: 505 case CODEC_TYPE_VIDEO:
504 if(s->video_codec_id) st->codec->codec_id= s->video_codec_id; 506 if(s->video_codec_id) st->codec->codec_id= s->video_codec_id;