Commit 6cbce636 authored by Daniel Kang's avatar Daniel Kang Committed by Carl Eugen Hoyos

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