OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b242c15
)
examples/decoding_encoding: check av_samples_get_buffer_size() return code
author
Timothy Gu
<timothygu99@gmail.com>
Sat, 14 Dec 2013 04:57:24 +0000
(20:57 -0800)
committer
Stefano Sabatini
<stefasab@gmail.com>
Sat, 14 Dec 2013 13:02:49 +0000
(14:02 +0100)
Fixes CID1135756.
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
doc/examples/decoding_encoding.c
patch
|
blob
|
history
diff --git
a/doc/examples/decoding_encoding.c
b/doc/examples/decoding_encoding.c
index
8bfc30f
..
4d2813b
100644
(file)
--- a/
doc/examples/decoding_encoding.c
+++ b/
doc/examples/decoding_encoding.c
@@
-170,6
+170,10
@@
static void audio_encode_example(const char *filename)
* we calculate the size of the samples buffer in bytes */
buffer_size = av_samples_get_buffer_size(NULL, c->channels, c->frame_size,
c->sample_fmt, 0);
+ if (!buffer_size) {
+ fprintf(stderr, "Could not get sample buffer size\n");
+ exit(1);
+ }
samples = av_malloc(buffer_size);
if (!samples) {
fprintf(stderr, "Could not allocate %d bytes for samples buffer\n",