From: <tp...@ke...> - 2006-08-23 16:11:36
|
CVS Root: /cvs/gstreamer Module: gst-plugins-base Changes by: tpm Date: Wed Aug 23 2006 12:14:32 UTC Log message: * ext/ogg/gstogmparse.c: (gst_ogm_parse_chain): Fix crash due to broken bitstream parsing on x86-64: can't make any assumptions about sizeof(struct) due to alignment/packing differences on different architectures. Fixes #351790. Modified files: . : ChangeLog ext/ogg : gstogmparse.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ChangeLog.diff?r1=1.2840&r2=1.2841 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/ogg/gstogmparse.c.diff?r1=1.25&r2=1.26 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v retrieving revision 1.2840 retrieving revision 1.2841 diff -u -d -r1.2840 -r1.2841 --- ChangeLog 22 Aug 2006 16:31:47 -0000 1.2840 +++ ChangeLog 23 Aug 2006 12:14:20 -0000 1.2841 @@ -1,3 +1,10 @@ +2006-08-23 Tim-Philipp Müller <tim at centricular dot net> + + * ext/ogg/gstogmparse.c: (gst_ogm_parse_chain): + Fix crash due to broken bitstream parsing on x86-64: can't make + any assumptions about sizeof(struct) due to alignment/packing + differences on different architectures. Fixes #351790. 2006-08-22 Wim Taymans <wi...@fl...> * gst-libs/gst/riff/riff-read.c: (gst_riff_read_chunk), Index: gstogmparse.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/ogg/gstogmparse.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- gstogmparse.c 14 Jun 2006 14:34:28 -0000 1.25 +++ gstogmparse.c 23 Aug 2006 12:14:20 -0000 1.26 @@ -51,7 +51,7 @@ (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_OGM_PARSE, GstOgmParse)) #define GST_IS_OGM_PARSE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_OGM_PARSE)) -#define GST_IS_OGM_PARSE_CLASS(obj) \ +#define GST_IS_OGM_PARSE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_OGM_PARSE)) #define GST_OGM_PARSE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_OGM_PARSE, GstOgmParseClass)) @@ -87,6 +87,10 @@ gint32 avgbytespersec; } stream_header_audio; +/* sizeof(stream_header) might differ due to structure packing and + * alignment differences on some architectures, so not using that */ +#define OGM_STREAM_HEADER_SIZE (8+4+4+8+8+4+4+4+8) typedef struct _stream_header { gchar streamtype[8]; @@ -527,7 +531,7 @@ GstCaps *caps = NULL; /* stream header */ - if (size < sizeof (stream_header) + 1) { + if (size < (1 + OGM_STREAM_HEADER_SIZE)) { GST_ELEMENT_ERROR (ogm, STREAM, WRONG_TYPE, ("Buffer too small"), (NULL)); break; |