提交 aa9d15d8 编写于 作者: A Anton Khirnov

qsvdec: avoid an infinite loop with no consumed data and no output

This is triggerable with the HEVC decoder. It is unclear yet whether the
bug is in the calling code or the MSDK, but it seems better to check for
this in any case.
上级 c9edbe4a
......@@ -245,6 +245,13 @@ int ff_qsv_decode(AVCodecContext *avctx, QSVContext *q,
return ff_qsv_error(ret);
}
/* make sure we do not enter an infinite loop if the SDK
* did not consume any data and did not return anything */
if (!sync && !bs.DataOffset) {
av_log(avctx, AV_LOG_WARNING, "A decode call did not consume any data\n");
bs.DataOffset = avpkt->size;
}
if (sync) {
QSVFrame *out_frame = find_frame(q, outsurf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册