[FFmpeg-devel] [PATCH 2/2] examples/decoding_encoding: check av_samples_get_buffer_size() return code

Stefano Sabatini stefasab at gmail.com
Sun Dec 15 20:15:15 CET 2013


On date Sunday 2013-12-15 19:26:07 +0100, Marton Balint encoded:
> 
> On Fri, 13 Dec 2013, Timothy Gu wrote:
> 
> >Fixes CID1135756.
> >
> >Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
> >---
> >doc/examples/decoding_encoding.c | 4 ++++
> >1 file changed, 4 insertions(+)
> >
> >diff --git a/doc/examples/decoding_encoding.c b/doc/examples/decoding_encoding.c
> >index 8bfc30f..4d2813b 100644
> >--- 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) {
> 
> Why not (buffer_size < 0) ?

Right, I missed it, fixed, thanks.
-- 
FFmpeg = Furious and Freak Magic Philosophical Ecumenical Ghost


More information about the ffmpeg-devel mailing list