aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
authorGravatar alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-27 11:39:47 +0000
committerGravatar alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-27 11:39:47 +0000
commit9ceaa48f020f98a4f18fca2b87ec9ec6ed2fb3d8 (patch)
tree17fe01fff24417559e82f5eb2ae836071d2d7343 /libmpdemux
parent46fb559fd70bd26da60ff44d7c750fa95fda53e8 (diff)
fixed YUV4MPEG frame reader
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3791 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_y4m.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libmpdemux/demux_y4m.c b/libmpdemux/demux_y4m.c
index 5484e2c7cd..298cbce006 100644
--- a/libmpdemux/demux_y4m.c
+++ b/libmpdemux/demux_y4m.c
@@ -81,7 +81,17 @@ int demux_y4m_fill_buffer(demuxer_t *demux) {
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);