From: Sebastian Dröge Date: Tue, 12 Feb 2019 15:58:19 +0000 (+0200) Subject: dvdreadsrc: Work around GCC9 compiler warning X-Git-Tag: 1.19.3~505^2~103 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aebb6bd9f3acef31eafa1c14f4173323da998026;p=platform%2Fupstream%2Fgstreamer.git dvdreadsrc: Work around GCC9 compiler warning It's technically true but not for this specific type. dvdreadsrc.c:394:65: error: taking address of packed member of ‘struct ’ may result in an unaligned pointer value [-Werror=address-of-packed-member] 394 | gst_dvd_read_src_make_clut_change_event (src, src->cur_pgc->palette); | ~~~~~~~~~~~~^~~~~~~~~ --- diff --git a/ext/dvdread/dvdreadsrc.c b/ext/dvdread/dvdreadsrc.c index 18e9f70..4a8b38f 100644 --- a/ext/dvdread/dvdreadsrc.c +++ b/ext/dvdread/dvdreadsrc.c @@ -78,7 +78,7 @@ static void gst_dvd_read_src_set_property (GObject * object, guint prop_id, static void gst_dvd_read_src_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static GstEvent *gst_dvd_read_src_make_clut_change_event (GstDvdReadSrc * src, - const guint * clut); + const guint32 * clut); static gboolean gst_dvd_read_src_get_size (GstDvdReadSrc * src, gint64 * size); static gboolean gst_dvd_read_src_do_seek (GstBaseSrc * src, GstSegment * s); static gint64 gst_dvd_read_src_convert_timecode (dvd_time_t * time); @@ -348,6 +348,7 @@ static gboolean gst_dvd_read_src_goto_chapter (GstDvdReadSrc * src, gint chapter) { gint i; + const guint8 *palette; /* make sure the chapter number is valid for this title */ if (chapter < 0 || chapter >= src->num_chapters) { @@ -390,8 +391,11 @@ gst_dvd_read_src_goto_chapter (GstDvdReadSrc * src, gint chapter) if (src->pending_clut_event) gst_event_unref (src->pending_clut_event); + /* Work around GCC 9 compiler warning here about taking address of packed + * member, which may result in an unaligned pointer access */ + palette = (const guint8 *) src->cur_pgc->palette; src->pending_clut_event = - gst_dvd_read_src_make_clut_change_event (src, src->cur_pgc->palette); + gst_dvd_read_src_make_clut_change_event (src, (const guint32 *) palette); return TRUE; } @@ -1348,7 +1352,7 @@ gst_dvd_read_src_src_event (GstBaseSrc * basesrc, GstEvent * event) static GstEvent * gst_dvd_read_src_make_clut_change_event (GstDvdReadSrc * src, - const guint * clut) + const guint32 * clut) { GstStructure *structure; gchar name[16];