From b2a4316287ea814168b0b794bd7ab0063fd1dd0f Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sun, 15 Dec 2013 20:09:26 +0100 Subject: [PATCH] examples/decoding_encoding: check av_samples_get_buffer_size() for a negative value Fix broken != 0 check. --- doc/examples/decoding_encoding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/decoding_encoding.c b/doc/examples/decoding_encoding.c index 4d2813b052..08e8b9212c 100644 --- a/doc/examples/decoding_encoding.c +++ b/doc/examples/decoding_encoding.c @@ -170,7 +170,7 @@ 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) { + if (buffer_size < 0) { fprintf(stderr, "Could not get sample buffer size\n"); exit(1); }