diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c index 9a1952a625..dadd7f01e8 100644 --- a/libavcodec/libopusenc.c +++ b/libavcodec/libopusenc.c @@ -324,7 +324,7 @@ static int libopus_encode(AVCodecContext *avctx, AVPacket *avpkt, } else audio = frame->data[0]; } else { - if (!opus->afq.remaining_samples) + if (!opus->afq.remaining_samples || (!opus->afq.frame_alloc && !opus->afq.frame_count)) return 0; audio = opus->samples; memset(audio, 0, opus->opts.packet_size * sample_size);