Commit f3b4a285 authored by Max Kellermann's avatar Max Kellermann

ffmpeg: output buffer size cannot be negative

Converted the runtime check to an assertion.
parent 130fc58b
...@@ -21,6 +21,7 @@ ...@@ -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, ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment