Commit ef2a85ac authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'aa9d15d8'

* commit 'aa9d15d8':
  qsvdec: avoid an infinite loop with no consumed data and no output

Conflicts:
	libavcodec/qsvdec.c
Merged-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parents c105e0f0 aa9d15d8
...@@ -339,6 +339,13 @@ int ff_qsv_decode(AVCodecContext *avctx, QSVContext *q, ...@@ -339,6 +339,13 @@ int ff_qsv_decode(AVCodecContext *avctx, QSVContext *q,
break; break;
} }
/* 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 (buffered) { if (buffered) {
qsv_fifo_relocate(q->input_fifo, bs.DataOffset); qsv_fifo_relocate(q->input_fifo, bs.DataOffset);
} else if (bs.DataOffset!=avpkt->size) { } else if (bs.DataOffset!=avpkt->size) {
......
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