summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorZdenek Kabelac <kabi@informatics.muni.cz>2001-10-31 19:40:53 +0000
committerZdenek Kabelac <kabi@informatics.muni.cz>2001-10-31 19:40:53 +0000
commit92d24f49f8e702140c5b6103464a1bc18c60e7a7 (patch)
tree64289858a7f53d81f1517f1c7005d89c92b04f38 /libavcodec
parentcabad2adbc185c27d2df011be198220f79cdc97f (diff)
downloadffmpeg-streaming-92d24f49f8e702140c5b6103464a1bc18c60e7a7.zip
ffmpeg-streaming-92d24f49f8e702140c5b6103464a1bc18c60e7a7.tar.gz
* fixed decoding busy loop
Originally committed as revision 203 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegaudiodec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 8af8047..bbb3ff1 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -2270,7 +2270,7 @@ static int decode_frame(AVCodecContext * avctx,
len = HEADER_SIZE - len;
if (len > buf_size)
len = buf_size;
- else if (len > 0) {
+ if (len > 0) {
memcpy(s->inbuf_ptr, buf_ptr, len);
buf_ptr += len;
buf_size -= len;
@@ -2280,6 +2280,7 @@ static int decode_frame(AVCodecContext * avctx,
got_header:
header = (s->inbuf[0] << 24) | (s->inbuf[1] << 16) |
(s->inbuf[2] << 8) | s->inbuf[3];
+
if (check_header(header) < 0) {
/* no sync found : move by one byte (inefficient, but simple!) */
memcpy(s->inbuf, s->inbuf + 1, s->inbuf_ptr - s->inbuf - 1);
OpenPOWER on IntegriCloud