Browse Source

ffmdec: fix infinite loop at EOF

If EOF is reached, while skipping bytes, avio_tell(pb) won't change
anymore, resulting in an infinite loop.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6fa98822eb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4.8
Andreas Cadhalpun Michael Niedermayer 11 years ago
parent
commit
d81150929d
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavformat/ffmdec.c

+ 2
- 2
libavformat/ffmdec.c View File

@@ -354,7 +354,7 @@ static int ffm2_read_header(AVFormatContext *s)
}

/* get until end of block reached */
while ((avio_tell(pb) % ffm->packet_size) != 0)
while ((avio_tell(pb) % ffm->packet_size) != 0 && !pb->eof_reached)
avio_r8(pb);

/* init packet demux */
@@ -481,7 +481,7 @@ static int ffm_read_header(AVFormatContext *s)
}

/* get until end of block reached */
while ((avio_tell(pb) % ffm->packet_size) != 0)
while ((avio_tell(pb) % ffm->packet_size) != 0 && !pb->eof_reached)
avio_r8(pb);

/* init packet demux */


Loading…
Cancel
Save