diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-29 23:24:27 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-29 23:24:27 +0200 |
commit | 2f8418b584d2e3d742b6c1c3b320e37c55a3df95 (patch) | |
tree | 3b6e899c5a5bd420e8074ae02c20f94262d14aac | |
parent | 9e58d46edf95e5da585e613b22e1255cf279b5cf (diff) | |
parent | 28ff439efd2362fb21e1a78610737f2e26a72d8f (diff) | |
download | ffmpeg-2f8418b584d2e3d742b6c1c3b320e37c55a3df95.tar.gz |
Merge commit '28ff439efd2362fb21e1a78610737f2e26a72d8f'
* commit '28ff439efd2362fb21e1a78610737f2e26a72d8f':
mvi: Add sanity checking for the audio frame size
Conflicts:
libavformat/mvi.c
See: ea1d8465e6eca582c09e2526f677033b62576fda
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/mvi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/mvi.c b/libavformat/mvi.c index 953c1824fa..bd1f3c66f9 100644 --- a/libavformat/mvi.c +++ b/libavformat/mvi.c @@ -96,10 +96,12 @@ static int read_header(AVFormatContext *s) mvi->get_int = (vst->codec->width * vst->codec->height < (1 << 16)) ? avio_rl16 : avio_rl24; mvi->audio_frame_size = ((uint64_t)mvi->audio_data_size << MVI_FRAC_BITS) / frames_count; - if (!mvi->audio_frame_size) { - av_log(s, AV_LOG_ERROR, "audio_frame_size is 0\n"); + if (mvi->audio_frame_size <= 1 << MVI_FRAC_BITS - 1) { + av_log(s, AV_LOG_ERROR, "Invalid audio_data_size (%d) or frames_count (%d)\n", + mvi->audio_data_size, frames_count); return AVERROR_INVALIDDATA; } + mvi->audio_size_counter = (ast->codec->sample_rate * 830 / mvi->audio_frame_size - 1) * mvi->audio_frame_size; mvi->audio_size_left = mvi->audio_data_size; |