ffmpeg: output buffer size cannot be negative

Converted the runtime check to an assertion.
This commit is contained in:
Max Kellermann 2008-10-30 19:03:38 +01:00
parent 130fc58b36
commit f3b4a28518
1 changed files with 7 additions and 5 deletions

View File

@ -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