diff options
author | Timothy Gu <timothygu99@gmail.com> | 2013-12-13 20:57:23 -0800 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2013-12-14 14:02:33 +0100 |
commit | b242c156e5b92b44976baa0560e4b427fa1a5a81 (patch) | |
tree | 6fe676b903db962c2c43fd3c28ea11c23ee5ef6f /doc/examples | |
parent | 66a703ea01687bbe57469116bbe7ab0c414b3509 (diff) | |
download | ffmpeg-b242c156e5b92b44976baa0560e4b427fa1a5a81.tar.gz |
examples/resample_audio: check av_samples_get_buffer_size() return code
Fixes CID1135757.
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Diffstat (limited to 'doc/examples')
-rw-r--r-- | doc/examples/resampling_audio.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/examples/resampling_audio.c b/doc/examples/resampling_audio.c index f9bfb92cfd..a15e04226b 100644 --- a/doc/examples/resampling_audio.c +++ b/doc/examples/resampling_audio.c @@ -184,6 +184,10 @@ int main(int argc, char **argv) } dst_bufsize = av_samples_get_buffer_size(&dst_linesize, dst_nb_channels, ret, dst_sample_fmt, 1); + if (dst_bufsize < 0) { + fprintf(stderr, "Could not get sample buffer size\n"); + goto end; + } printf("t:%f in:%d out:%d\n", t, src_nb_samples, ret); fwrite(dst_data[0], 1, dst_bufsize, dst_file); } while (t < 10); |