1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

Merge commit '28ff439efd2362fb21e1a78610737f2e26a72d8f'

* commit '28ff439efd2362fb21e1a78610737f2e26a72d8f':
  mvi: Add sanity checking for the audio frame size

Conflicts:
	libavformat/mvi.c

See: ea1d8465e6
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-09-29 23:24:27 +02:00
commit 2f8418b584

View File

@ -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;