Commit d8970900 authored by kabi's avatar kabi

* fixed decoding busy loop


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@203 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0e1977a7
...@@ -2270,7 +2270,7 @@ static int decode_frame(AVCodecContext * avctx, ...@@ -2270,7 +2270,7 @@ static int decode_frame(AVCodecContext * avctx,
len = HEADER_SIZE - len; len = HEADER_SIZE - len;
if (len > buf_size) if (len > buf_size)
len = buf_size; len = buf_size;
else if (len > 0) { if (len > 0) {
memcpy(s->inbuf_ptr, buf_ptr, len); memcpy(s->inbuf_ptr, buf_ptr, len);
buf_ptr += len; buf_ptr += len;
buf_size -= len; buf_size -= len;
...@@ -2280,6 +2280,7 @@ static int decode_frame(AVCodecContext * avctx, ...@@ -2280,6 +2280,7 @@ static int decode_frame(AVCodecContext * avctx,
got_header: got_header:
header = (s->inbuf[0] << 24) | (s->inbuf[1] << 16) | header = (s->inbuf[0] << 24) | (s->inbuf[1] << 16) |
(s->inbuf[2] << 8) | s->inbuf[3]; (s->inbuf[2] << 8) | s->inbuf[3];
if (check_header(header) < 0) { if (check_header(header) < 0) {
/* no sync found : move by one byte (inefficient, but simple!) */ /* no sync found : move by one byte (inefficient, but simple!) */
memcpy(s->inbuf, s->inbuf + 1, s->inbuf_ptr - s->inbuf - 1); memcpy(s->inbuf, s->inbuf + 1, s->inbuf_ptr - s->inbuf - 1);
......
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