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:
66a703e
)
examples/resample_audio: check av_samples_get_buffer_size() return code
author
Timothy Gu
<timothygu99@gmail.com>
Sat, 14 Dec 2013 04:57:23 +0000
(20:57 -0800)
committer
Stefano Sabatini
<stefasab@gmail.com>
Sat, 14 Dec 2013 13:02:33 +0000
(14:02 +0100)
Fixes CID1135757.
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
doc/examples/resampling_audio.c
patch
|
blob
|
history
diff --git
a/doc/examples/resampling_audio.c
b/doc/examples/resampling_audio.c
index
f9bfb92
..
a15e042
100644
(file)
--- 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);