Commit 2f8418b5 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '28ff439e'

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

Conflicts:
	libavformat/mvi.c

See: ea1d8465Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 9e58d46e 28ff439e
...@@ -96,10 +96,12 @@ static int read_header(AVFormatContext *s) ...@@ -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->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; mvi->audio_frame_size = ((uint64_t)mvi->audio_data_size << MVI_FRAC_BITS) / frames_count;
if (!mvi->audio_frame_size) { if (mvi->audio_frame_size <= 1 << MVI_FRAC_BITS - 1) {
av_log(s, AV_LOG_ERROR, "audio_frame_size is 0\n"); 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; return AVERROR_INVALIDDATA;
} }
mvi->audio_size_counter = (ast->codec->sample_rate * 830 / mvi->audio_frame_size - 1) * mvi->audio_frame_size; 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; mvi->audio_size_left = mvi->audio_data_size;
......
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