ffmpeg: output buffer size cannot be negative
Converted the runtime check to an assertion.
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
#include "../utils.h"
|
#include "../utils.h"
|
||||||
#include "../log.h"
|
#include "../log.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -235,11 +236,12 @@ ffmpeg_send_packet(struct decoder *decoder, const AVPacket *packet,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (audio_size >= 0)
|
assert(audio_size >= 0);
|
||||||
decoder_data(decoder, NULL, 1,
|
|
||||||
audio_buf, audio_size,
|
decoder_data(decoder, NULL, 1,
|
||||||
position,
|
audio_buf, audio_size,
|
||||||
codec_context->bit_rate / 1000, NULL);
|
position,
|
||||||
|
codec_context->bit_rate / 1000, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
|||||||
Reference in New Issue
Block a user