Browse Source

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

Fix broken != 0 check.
tags/n2.2-rc1
Stefano Sabatini 12 years ago
parent
commit
b2a4316287
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      doc/examples/decoding_encoding.c

+ 1
- 1
doc/examples/decoding_encoding.c View File

@@ -170,7 +170,7 @@ static void audio_encode_example(const char *filename)
* we calculate the size of the samples buffer in bytes */ * we calculate the size of the samples buffer in bytes */
buffer_size = av_samples_get_buffer_size(NULL, c->channels, c->frame_size, buffer_size = av_samples_get_buffer_size(NULL, c->channels, c->frame_size,
c->sample_fmt, 0); c->sample_fmt, 0);
if (!buffer_size) {
if (buffer_size < 0) {
fprintf(stderr, "Could not get sample buffer size\n"); fprintf(stderr, "Could not get sample buffer size\n");
exit(1); exit(1);
} }


Loading…
Cancel
Save