[FFmpeg-cvslog] examples/decoding_encoding: check av_samples_get_buffer_size() for a negative value

Stefano Sabatini git at videolan.org
Sun Dec 15 20:14:11 CET 2013


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Sun Dec 15 20:09:26 2013 +0100| [b2a4316287ea814168b0b794bd7ab0063fd1dd0f] | committer: Stefano Sabatini

examples/decoding_encoding: check av_samples_get_buffer_size() for a negative value

Fix broken != 0 check.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b2a4316287ea814168b0b794bd7ab0063fd1dd0f
---

 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 4d2813b..08e8b92 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);
     }



More information about the ffmpeg-cvslog mailing list