diff --git a/libfreerdp/codec/dsp_ffmpeg.c b/libfreerdp/codec/dsp_ffmpeg.c index f907f2724..810b01738 100644 --- a/libfreerdp/codec/dsp_ffmpeg.c +++ b/libfreerdp/codec/dsp_ffmpeg.c @@ -472,7 +472,16 @@ static BOOL ffmpeg_encode_frame(AVCodecContext* WINPR_RESTRICT context, AVFrame* if (ret < 0) { const char* err = av_err2str(ret); + // Ignore errors: AAC encoder sometimes returns -22 + // The log message from ffmpeg is '[aac @ 0x7f140db753c0] Input contains (near) NaN/+-Inf' + if (ret == AVERROR(EINVAL)) + { + WLog_DBG(TAG, "Error submitting the packet to the encoder %s [%d], ignoring", err, ret); + return TRUE; + } + WLog_ERR(TAG, "Error submitting the packet to the encoder %s [%d]", err, ret); + return FALSE; }