1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Check sub_packet_size against 0 to avoid div by zero later.

Fixes issue473

Originally committed as revision 15739 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2008-10-29 00:16:50 +00:00
parent 8ff8de73a4
commit f23938f5b7

View File

@ -138,6 +138,11 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVStream *st,
return -1;
}
if(sub_packet_size <= 0){
av_log(s, AV_LOG_ERROR, "sub_packet_size is invalid\n");
return -1;
}
if (!strcmp(buf, "cook")) st->codec->codec_id = CODEC_ID_COOK;
else if (!strcmp(buf, "sipr")) st->codec->codec_id = CODEC_ID_SIPR;
else st->codec->codec_id = CODEC_ID_ATRAC3;