Skip to content
Snippets Groups Projects
Commit 047716bb authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

ffplay: check av_samples_get_buffer_size() return


Fixes CID1005310
Reviewed-by: default avatarMarton Balint <cus@passwd.hu>
Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
parent 3e40b856
No related branches found
No related tags found
No related merge requests found
......@@ -2262,6 +2262,10 @@ static int audio_decode_frame(VideoState *is)
int out_count = (int64_t)wanted_nb_samples * is->audio_tgt.freq / is->frame->sample_rate + 256;
int out_size = av_samples_get_buffer_size(NULL, is->audio_tgt.channels, out_count, is->audio_tgt.fmt, 0);
int len2;
if (out_size < 0) {
fprintf(stderr, "av_samples_get_buffer_size() failed\n");
break;
}
if (wanted_nb_samples != is->frame->nb_samples) {
if (swr_set_compensation(is->swr_ctx, (wanted_nb_samples - is->frame->nb_samples) * is->audio_tgt.freq / is->frame->sample_rate,
wanted_nb_samples * is->audio_tgt.freq / is->frame->sample_rate) < 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment