Mercurial > mplayer.hg
changeset 3790:f21832490974
fixed YUV4MPEG frame reader
author | alex |
---|---|
date | Thu, 27 Dec 2001 11:39:47 +0000 |
parents | 811b2e1ff030 |
children | 60956df64e77 |
files | libmpdemux/demux_y4m.c |
diffstat | 1 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_y4m.c Thu Dec 27 11:30:07 2001 +0000 +++ b/libmpdemux/demux_y4m.c Thu Dec 27 11:39:47 2001 +0000 @@ -81,7 +81,17 @@ if (priv->is_older) { - stream_skip(demux->stream, 6); /* FRAME\n */ + int c; + + c = stream_read_char(demux->stream); /* F */ + if (c == -256) + return 0; /* EOF */ + if (c != 'F') + { + printf("Bad frame at %p\n", stream_tell(demux->stream)-1); + return 0; + } + stream_skip(demux->stream, 5); /* RAME\n */ stream_read(demux->stream, buf[0], size); stream_read(demux->stream, buf[1], size/4); stream_read(demux->stream, buf[2], size/4);