summaryrefslogtreecommitdiff
path: root/ffplay.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-21 15:55:04 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-21 18:56:18 +0200
commit047716bbd8f5ffad3fed160edeb8ad1e9d24a936 (patch)
tree872d5e4dffd4b3986d7cd8368d2e4da878fe9fdf /ffplay.c
parent3e40b85683e6a4c299e1f95383be4046a2dd9e9c (diff)
ffplay: check av_samples_get_buffer_size() return
Fixes CID1005310 Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ffplay.c b/ffplay.c
index e2014be941..ca0a8289f4 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -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) {