From f3b4a28518e90f98e99e5d5196568136c4ec34f5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 30 Oct 2008 19:03:38 +0100 Subject: ffmpeg: output buffer size cannot be negative Converted the runtime check to an assertion. --- src/decoder/ffmpeg_plugin.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/decoder/ffmpeg_plugin.c') 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 #include #include #include @@ -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 -- cgit v1.2.3