Fix assertion fail on audio files with invalid sample rates,

fixes issue 2475.

Patch by Daniel Kang, daniel.d.kang at gmail

Originally committed as revision 26240 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Daniel Kang 2011-01-06 03:30:19 +00:00 committed by Carl Eugen Hoyos
parent 6bbdba08c2
commit 6cbce63650

View File

@ -812,7 +812,7 @@ static void compute_frame_duration(int *pnum, int *pden, AVStream *st,
break;
case AVMEDIA_TYPE_AUDIO:
frame_size = get_audio_frame_size(st->codec, pkt->size);
if (frame_size < 0)
if (frame_size <= 0 || st->codec->sample_rate <= 0)
break;
*pnum = frame_size;
*pden = st->codec->sample_rate;