diff --git a/configure.ac b/configure.ac index bd7ad821fc..d6cc49b1f3 100644 --- a/configure.ac +++ b/configure.ac @@ -71,6 +71,8 @@ AG_GST_GETTEXT([gst-plugins-ugly-$GST_MAJORMINOR]) dnl *** check for arguments to configure *** +AG_GST_ARG_DISABLE_FATAL_WARNINGS + AG_GST_ARG_DEBUG AG_GST_ARG_PROFILING AG_GST_ARG_VALGRIND @@ -189,14 +191,14 @@ AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO], [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO]) dnl define an ERROR_CFLAGS Makefile variable -AG_GST_SET_ERROR_CFLAGS($GST_GIT, [ +AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [ -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs ]) dnl define an ERROR_CXXFLAGS Makefile variable -AG_GST_SET_ERROR_CXXFLAGS($GST_GIT, [ +AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [ -Wmissing-declarations -Wredundant-decls -Wwrite-strings -Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return diff --git a/ext/a52dec/gsta52dec.c b/ext/a52dec/gsta52dec.c index 370d11e625..161cf5c76f 100644 --- a/ext/a52dec/gsta52dec.c +++ b/ext/a52dec/gsta52dec.c @@ -308,7 +308,7 @@ gst_a52dec_parse (GstAudioDecoder * bdec, GstAdapter * adapter, bit_rate = a52dec->bit_rate; sample_rate = a52dec->sample_rate; flags = 0; - while (av >= 7) { + while (size >= 7) { length = a52_syncinfo ((guint8 *) data, &flags, &sample_rate, &bit_rate); if (length == 0) { diff --git a/ext/amrnb/amrnbdec.c b/ext/amrnb/amrnbdec.c index a3fe067df2..0b9a09cbe4 100644 --- a/ext/amrnb/amrnbdec.c +++ b/ext/amrnb/amrnbdec.c @@ -249,7 +249,7 @@ gst_amrnbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter, gst_audio_decoder_get_parse_state (dec, &sync, &eos); /* need to peek data to get the size */ - if (gst_adapter_available (adapter) < 1) + if (size < 1) return GST_FLOW_ERROR; gst_adapter_copy (adapter, head, 0, 1); @@ -272,6 +272,9 @@ gst_amrnbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter, GST_DEBUG_OBJECT (amrnbdec, "mode %d, block %d", mode, block); + if (block > size) + return GST_FLOW_UNEXPECTED; + *offset = 0; *length = block; diff --git a/ext/amrwbdec/amrwbdec.c b/ext/amrwbdec/amrwbdec.c index 6286efcf1a..5a6e73ae96 100644 --- a/ext/amrwbdec/amrwbdec.c +++ b/ext/amrwbdec/amrwbdec.c @@ -178,7 +178,7 @@ gst_amrwbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter, gst_audio_decoder_get_parse_state (dec, &sync, &eos); /* need to peek data to get the size */ - if (gst_adapter_available (adapter) < 1) + if (size < 1) return GST_FLOW_ERROR; gst_adapter_copy (adapter, header, 0, 1); @@ -188,6 +188,8 @@ gst_amrwbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter, GST_DEBUG_OBJECT (amrwbdec, "mode %d, block %d", mode, block); if (block) { + if (block > size) + return GST_FLOW_UNEXPECTED; *offset = 0; *length = block; } else { diff --git a/ext/dvdread/dvdreadsrc.c b/ext/dvdread/dvdreadsrc.c index 87f94beeb7..53e0aa3292 100644 --- a/ext/dvdread/dvdreadsrc.c +++ b/ext/dvdread/dvdreadsrc.c @@ -327,11 +327,14 @@ cur_title_get_chapter_bounds (GstDvdReadSrc * src, gint chapter, *p_first_cell = pgc->program_map[pgn - 1] - 1; if (chapter == (src->num_chapters - 1)) { - *p_last_cell = pgc->nr_of_cells; + *p_last_cell = pgc->nr_of_cells - 1; } else { pgn_next_ch = src->vts_ptt_srpt->title[src->ttn - 1].ptt[chapter + 1].pgn; *p_last_cell = pgc->program_map[pgn_next_ch - 1] - 1; } + + GST_DEBUG_OBJECT (src, "Chapter %d bounds: %d %d (within %d cells)", + chapter, *p_first_cell, *p_last_cell, pgc->nr_of_cells); } static gboolean diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c index 3fcce51a98..12c1523ad9 100644 --- a/ext/x264/gstx264enc.c +++ b/ext/x264/gstx264enc.c @@ -431,7 +431,7 @@ gst_x264_enc_build_tunings_string (GstX264Enc * x264enc) { int i = 1; - if (x264enc->tunings && x264enc->tunings->len) + if (x264enc->tunings) g_string_free (x264enc->tunings, TRUE); if (x264enc->psy_tune) { @@ -948,7 +948,7 @@ gst_x264_enc_finalize (GObject * object) #define FREE_STRING(ptr) \ if (ptr) \ - ptr = (GString *)g_string_free (ptr, TRUE); + g_string_free (ptr, TRUE); FREE_STRING (encoder->tunings); FREE_STRING (encoder->option_string);