After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 727460 - mpegts: add atsc terrestrial virtual channel table
mpegts: add atsc terrestrial virtual channel table
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-01 20:49 UTC by Stefan Ringel
Modified: 2014-04-10 07:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add terrestrial virtual channel table (10.59 KB, patch)
2014-04-01 20:50 UTC, Stefan Ringel
needs-work Details | Review
add atsc terrestial virtual channel table (10.82 KB, patch)
2014-04-04 12:34 UTC, Stefan Ringel
needs-work Details | Review
add atsc terrestial virtual channel table (10.98 KB, patch)
2014-04-09 08:15 UTC, Stefan Ringel
committed Details | Review

Description Stefan Ringel 2014-04-01 20:49:09 UTC
add atsc terrestrial virtual channel table
Comment 1 Stefan Ringel 2014-04-01 20:50:08 UTC
Created attachment 273431 [details] [review]
add terrestrial virtual channel table
Comment 2 Sebastian Dröge (slomo) 2014-04-04 08:02:24 UTC
Review of attachment 273431 [details] [review]:

::: gst-libs/gst/mpegts/gst-atsc-section.c
@@ +3,3 @@
+ *
+ * Authors:
+ *   Edward Hervey <edward@collabora.com>

I think that copyright notice here is wrong :)

@@ +96,3 @@
+
+  /* Skip already parsed data */
+  data += 8;

You should check sizes here imho

@@ +109,3 @@
+  for (guint i = 0; i < source_nb; i++) {
+    GstMpegTsAtscTVCTSource *source;
+

And inside the loop, or in front of the loop for the complete loop too
Comment 3 Stefan Ringel 2014-04-04 09:20:09 UTC
(In reply to comment #2)
> Review of attachment 273431 [details] [review]:
> 
> ::: gst-libs/gst/mpegts/gst-atsc-section.c
> @@ +3,3 @@
> + *
> + * Authors:
> + *   Edward Hervey <edward@collabora.com>
> 
> I think that copyright notice here is wrong :)
you right, I have overseen.
> 
> @@ +96,3 @@
> +
> +  /* Skip already parsed data */
> +  data += 8;
> 
> You should check sizes here imho
I don't know how many bytes it has. I can only check a minimum.
> 
> @@ +109,3 @@
> +  for (guint i = 0; i < source_nb; i++) {
> +    GstMpegTsAtscTVCTSource *source;
> +
> 
> And inside the loop, or in front of the loop for the complete loop too

The same like above. But we have a number of entries (source_nb).
Comment 4 Sebastian Dröge (slomo) 2014-04-04 09:21:59 UTC
What I mean is that you should check if you have the data available before you try to read it :) So check that you always have at least as you expect next available.
Comment 5 Stefan Ringel 2014-04-04 10:38:36 UTC
> > 
> > @@ +96,3 @@
> > +
> > +  /* Skip already parsed data */
> > +  data += 8;
> > 
> > You should check sizes here imho
> I don't know how many bytes it has. I can only check a minimum.
2 bytes (protocol_version + num_channels_in_section) before and 2 (descriptor-loop-length) + 4 (crc) after source entry loop is the minimum at this point.
Comment 6 Stefan Ringel 2014-04-04 12:34:22 UTC
Created attachment 273585 [details] [review]
add atsc terrestial virtual channel table
Comment 7 Sebastian Dröge (slomo) 2014-04-08 09:27:01 UTC
Review of attachment 273585 [details] [review]:

::: gst-libs/gst/mpegts/gst-atsc-section.c
@@ +155,3 @@
+    data += 2;
+
+    descriptors_loop_length = GST_READ_UINT16_BE (data) & 0x03FF;

You need to check that you actually have that much data available
Comment 8 Stefan Ringel 2014-04-08 18:36:16 UTC
Review of attachment 273585 [details] [review]:

Doesn't do it gst_mpegts_parse_descriptors?
Comment 9 Sebastian Dröge (slomo) 2014-04-09 06:52:32 UTC
(In reply to comment #8)
> Review of attachment 273585 [details] [review]:
> 
> Doesn't do it gst_mpegts_parse_descriptors?

Yes, with the length you pass to it which comes from the data and which you don't check against the amount of data you really have available.
Comment 10 Stefan Ringel 2014-04-09 08:15:13 UTC
Created attachment 273862 [details] [review]
add atsc terrestial virtual channel table
Comment 11 Sebastian Dröge (slomo) 2014-04-10 07:10:23 UTC
commit f566d172025f785bcc8b4ad4110399140f2512bd
Author: Stefan Ringel <linuxtv@stefanringel.de>
Date:   Wed Apr 9 10:04:46 2014 +0200

    mpegts: add atsc terrestrial virtual channel table
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727460