summaryrefslogtreecommitdiff
path: root/gst/pcapparse/gstpcapparse.c
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2010-11-03 18:02:49 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2010-11-03 18:02:49 -0400
commitec16c22f54fc6ac177b317bbe3940527869d12d6 (patch)
tree312222d7ad2a75a6415d749cb876a956e9136306 /gst/pcapparse/gstpcapparse.c
parent891e08f22025de0452de91ea0d06b63496d197aa (diff)
downloadgstreamer-plugins-bad-ec16c22f54fc6ac177b317bbe3940527869d12d6.tar.gz
pcapparse: Send error GstMessage if stream doesn't have the expected magic
Diffstat (limited to 'gst/pcapparse/gstpcapparse.c')
-rw-r--r--gst/pcapparse/gstpcapparse.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gst/pcapparse/gstpcapparse.c b/gst/pcapparse/gstpcapparse.c
index b3a345046..401e20f83 100644
--- a/gst/pcapparse/gstpcapparse.c
+++ b/gst/pcapparse/gstpcapparse.c
@@ -41,7 +41,7 @@
*/
#ifdef HAVE_CONFIG_H
-# include <config.h>
+#include <config.h>
#endif
#include "gstpcapparse.h"
@@ -483,8 +483,11 @@ gst_pcap_parse_chain (GstPad * pad, GstBuffer * buffer)
self->swap_endian = FALSE;
else if (magic == 0xd4c3b2a1)
self->swap_endian = TRUE;
- else
+ else {
+ GST_ELEMENT_ERROR (self, STREAM, WRONG_TYPE, (NULL),
+ ("File is not a libpcap file version 2, magic is %X", magic));
ret = GST_FLOW_ERROR;
+ }
if (ret == GST_FLOW_OK)
self->initialized = TRUE;