slomo gst-plugins-bad: gst-plugins-bad/ gst-plugins-bad/gst/mxf/

[email protected]
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gst-plugins-bad
Changes by:     slomo
Date:           Sun Nov 23 2008  11:25:45 UTC

Log message:
* gst/mxf/mxfdemux.c: (gst_mxf_demux_pull_klv_packet),
(gst_mxf_demux_chain):
Actually we support a length stored inside 8 bytes but it must
be smaller than G_MAXUINT for GstBuffer.

Modified files:
    .               : ChangeLog
    gst/mxf         : mxfdemux.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.3731&r2=1.3732
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/mxf/mxfdemux.c.diff?r1=1.3&r2=1.4

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v
retrieving revision 1.3731
retrieving revision 1.3732
diff -u -d -r1.3731 -r1.3732
--- ChangeLog	23 Nov 2008 11:16:35 -0000	1.3731
+++ ChangeLog	23 Nov 2008 11:25:29 -0000	1.3732
@@ -1,5 +1,12 @@
 2008-11-23  Sebastian Dröge  <[email protected]>
 
+	* gst/mxf/mxfdemux.c: (gst_mxf_demux_pull_klv_packet),
+	(gst_mxf_demux_chain):
+	Actually we support a length stored inside 8 bytes but it must
+	be smaller than G_MAXUINT for GstBuffer.
+
+2008-11-23  Sebastian Dröge  <[email protected]>
 	Patch by: Tal Shalif <tshalif at nargila dot org>
 	* ext/resindvd/resindvdsrc.c:
Index: mxfdemux.c
RCS file: /cvs/gstreamer/gst-plugins-bad/gst/mxf/mxfdemux.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mxfdemux.c	22 Nov 2008 14:51:06 -0000	1.3
+++ mxfdemux.c	23 Nov 2008 11:25:30 -0000	1.4
@@ -1127,9 +1127,8 @@
           MXFMetadataEssenceContainerData, i);
       for (j = 0; j < demux->content_storage.n_essence_container_data; j++) {
-        if (mxf_ul_is_equal (&demux->
-                content_storage.essence_container_data_uids[j],
-                &data->instance_uid)) {
+        if (mxf_ul_is_equal (&demux->content_storage.
+                essence_container_data_uids[j], &data->instance_uid)) {
           demux->content_storage.essence_container_data[j] = data;
           break;
         }
@@ -1982,7 +1981,7 @@
   GstBuffer *buffer = NULL;
   const guint8 *data;
   guint64 data_offset = 0;
-  guint length;
+  guint64 length;
   gchar key_str[48];
   GstFlowReturn ret = GST_FLOW_OK;
@@ -2014,17 +2013,13 @@
     data_offset = 16 + 1 + slen;
     gst_buffer_unref (buffer);
+    buffer = NULL;
-    /* Must be at most 8 according to SMPTE-379M 5.3.4 and
-     * GStreamer buffers can only have a 4 bytes length */
+    /* Must be at most 8 according to SMPTE-379M 5.3.4 */
     if (slen > 8) {
       GST_ERROR_OBJECT (demux, "Invalid KLV packet length: %u", slen);
       ret = GST_FLOW_ERROR;
       goto beach;
-    } else if (slen > 4) {
-      GST_ERROR_OBJECT (demux, "Unsupported KLV packet length: %u", slen);
-      ret = GST_FLOW_ERROR;
-      goto beach;
     }
     /* Now pull the length of the packet */
@@ -2042,6 +2037,16 @@
   }
   gst_buffer_unref (buffer);
+  buffer = NULL;
+  /* GStreamer's buffer sizes are stored in a guint so we
+   * limit ourself to G_MAXUINT large buffers */
+  if (length > G_MAXUINT) {
+    GST_ERROR_OBJECT (demux,
+        "Unsupported KLV packet length: %" G_GUINT64_FORMAT, length);
+    ret = GST_FLOW_ERROR;
+    goto beach;
+  }
   /* Pull the complete KLV packet */
   if ((ret = gst_mxf_demux_pull_range (demux, offset + data_offset, length,
@@ -2406,7 +2411,7 @@
   GstMXFDemux *demux = NULL;
   MXFUL key;
   const guint8 *data = NULL;
-  guint length = 0;
+  guint64 length = 0;
   guint64 offset = 0;
@@ -2507,10 +2512,6 @@
         GST_ERROR_OBJECT (demux, "Invalid KLV packet length: %u", slen);
         ret = GST_FLOW_ERROR;
         break;
-      } else if (slen > 4) {
-        GST_ERROR_OBJECT (demux, "Unsupported KLV packet length: %u", slen);
-        ret = GST_FLOW_ERROR;
-        break;
       }
       if (gst_adapter_available (demux->adapter) < 17 + slen)
@@ -2527,6 +2528,15 @@
+    /* GStreamer's buffer sizes are stored in a guint so we
+     * limit ourself to G_MAXUINT large buffers */
+    if (length > G_MAXUINT) {
+      GST_ERROR_OBJECT (demux,
+          "Unsupported KLV packet length: %" G_GUINT64_FORMAT, length);
+      ret = GST_FLOW_ERROR;
+      break;
+    }
     if (gst_adapter_available (demux->adapter) < offset + length)
       break;

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
gstreamer-cvs-verbose mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs-verbose
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.