aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/ffmpeg_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-30 19:03:38 +0100
committerMax Kellermann <max@duempel.org>2008-10-30 19:03:38 +0100
commitf3b4a28518e90f98e99e5d5196568136c4ec34f5 (patch)
treea2a204ddd15ada2892f372dbeecf98d04d39d2e8 /src/decoder/ffmpeg_plugin.c
parent130fc58b367001173f5affb7c606f073bf0b2513 (diff)
downloadmpd-f3b4a28518e90f98e99e5d5196568136c4ec34f5.tar.gz
mpd-f3b4a28518e90f98e99e5d5196568136c4ec34f5.tar.xz
mpd-f3b4a28518e90f98e99e5d5196568136c4ec34f5.zip
ffmpeg: output buffer size cannot be negative
Converted the runtime check to an assertion.
Diffstat (limited to 'src/decoder/ffmpeg_plugin.c')
-rw-r--r--src/decoder/ffmpeg_plugin.c12
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