diff options
author | Max Kellermann <max@duempel.org> | 2008-10-30 19:03:38 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-30 19:03:38 +0100 |
commit | f3b4a28518e90f98e99e5d5196568136c4ec34f5 (patch) | |
tree | a2a204ddd15ada2892f372dbeecf98d04d39d2e8 | |
parent | 130fc58b367001173f5affb7c606f073bf0b2513 (diff) | |
download | mpd-f3b4a28518e90f98e99e5d5196568136c4ec34f5.tar.gz mpd-f3b4a28518e90f98e99e5d5196568136c4ec34f5.tar.xz mpd-f3b4a28518e90f98e99e5d5196568136c4ec34f5.zip |
ffmpeg: output buffer size cannot be negative
Converted the runtime check to an assertion.
-rw-r--r-- | src/decoder/ffmpeg_plugin.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/decoder/ffmpeg_plugin.c b/src/decoder/ffmpeg_plugin.c index 30b469c22..5f00ead29 100644 --- a/src/decoder/ffmpeg_plugin.c +++ b/src/decoder/ffmpeg_plugin.c @@ -21,6 +21,7 @@ #include "../utils.h" #include "../log.h" +#include <assert.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> @@ -235,11 +236,12 @@ ffmpeg_send_packet(struct decoder *decoder, const AVPacket *packet, return; } - if (audio_size >= 0) - decoder_data(decoder, NULL, 1, - audio_buf, audio_size, - position, - codec_context->bit_rate / 1000, NULL); + assert(audio_size >= 0); + + decoder_data(decoder, NULL, 1, + audio_buf, audio_size, + position, + codec_context->bit_rate / 1000, NULL); } static bool |