Commit b2a43162 authored by Stefano Sabatini's avatar Stefano Sabatini

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

Fix broken != 0 check.
parent 81eff6e7
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment