video: Don't corrupt caption GstMeta
authorEdward Hervey <edward@centricular.com>
Mon, 16 Apr 2018 15:04:06 +0000 (17:04 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Mon, 16 Apr 2018 15:04:06 +0000 (17:04 +0200)
the meta initialization function is provided *after* the base implementation
fields have been set so do *NOT* reset them otherwise it would result
in corrupted GstMeta.

Instead explicitely set our fields to the default values we actually want.

gst-libs/gst/video/video-anc.c

index eb1c186..32d075e 100644 (file)
@@ -458,8 +458,9 @@ gst_video_caption_meta_init (GstMeta * meta, gpointer params,
 {
   GstVideoCaptionMeta *emeta = (GstVideoCaptionMeta *) meta;
 
-  memset (emeta, 0, sizeof (GstVideoCaptionMeta));
   emeta->caption_type = GST_VIDEO_CAPTION_TYPE_UNKNOWN;
+  emeta->data = NULL;
+  emeta->size = 0;
 
   return TRUE;
 }