From 16860a5c42ce4a0346768a2a2a742d35d263574b Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sat, 6 Mar 2004 01:25:58 +0000 Subject: [PATCH] gst/mpegstream/gstrfc2250enc.c: Fix code that ignores return value of gst_buffer_merge(). (bug #114560) Original commit message from CVS: * gst/mpegstream/gstrfc2250enc.c: (gst_rfc2250_enc_add_slice): Fix code that ignores return value of gst_buffer_merge(). (bug #114560) * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_descramble_segment): * gst/mpegstream/gstrfc2250enc.c: (gst_rfc2250_enc_add_slice): same * testsuite/gst-lint: Check for above. --- ChangeLog | 9 +++++++++ tests/old/testsuite/gst-lint | 19 ++++++++++++------- testsuite/gst-lint | 19 ++++++++++++------- 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4e3e48d0b9..cb88082e1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-03-05 David Schleef + + * gst/mpegstream/gstrfc2250enc.c: (gst_rfc2250_enc_add_slice): + Fix code that ignores return value of gst_buffer_merge(). + (bug #114560) + * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_descramble_segment): + * gst/mpegstream/gstrfc2250enc.c: (gst_rfc2250_enc_add_slice): same + * testsuite/gst-lint: Check for above. + 2004-03-05 David Schleef * gst/udp/gstudpsrc.c: (gst_udpsrc_get): Check for unfixed diff --git a/tests/old/testsuite/gst-lint b/tests/old/testsuite/gst-lint index 98a338485f..710ce9bbb8 100755 --- a/tests/old/testsuite/gst-lint +++ b/tests/old/testsuite/gst-lint @@ -31,7 +31,7 @@ sub check_carriage_returns(); sub check_printf_lld(); sub check_glibisms(); sub check_indentation(); -sub check_gst_props_set(); +sub check_no_ignore(); sub check_deprecated(); sub check_config_h(); sub check_varargs_functions(); @@ -63,7 +63,7 @@ foreach $filename () { # important stuff check_bad_includes(); check_printf_lld(); - check_gst_props_set(); + check_no_ignore(); check_deprecated(); check_config_h(); check_old_typefind(); @@ -263,13 +263,18 @@ sub check_indentation() # -# gst_props_set() returns a value that should never be ignored -# may have false positives +# Check (roughly) for functions whose value should not be ignored # -sub check_gst_props_set() +sub check_no_ignore() { - if (grep { /^\s+gst_props_set\s*\(/; } @lines) { - print "E: return value of gst_props_set() possibly ignored\n"; + if (grep { /^\s+gst_buffer_merge\s*\(/; } @lines) { + print "E: return value of gst_buffer_merge () possibly ignored\n"; + } + if (grep { /^\s+malloc\s*\(/; } @lines) { + print "E: return value of malloc() possibly ignored\n"; + } + if (grep { /^\s+gst_buffer_new\s*\(/; } @lines) { + print "E: return value of gst_buffer_new() possibly ignored\n"; } } diff --git a/testsuite/gst-lint b/testsuite/gst-lint index 98a338485f..710ce9bbb8 100755 --- a/testsuite/gst-lint +++ b/testsuite/gst-lint @@ -31,7 +31,7 @@ sub check_carriage_returns(); sub check_printf_lld(); sub check_glibisms(); sub check_indentation(); -sub check_gst_props_set(); +sub check_no_ignore(); sub check_deprecated(); sub check_config_h(); sub check_varargs_functions(); @@ -63,7 +63,7 @@ foreach $filename () { # important stuff check_bad_includes(); check_printf_lld(); - check_gst_props_set(); + check_no_ignore(); check_deprecated(); check_config_h(); check_old_typefind(); @@ -263,13 +263,18 @@ sub check_indentation() # -# gst_props_set() returns a value that should never be ignored -# may have false positives +# Check (roughly) for functions whose value should not be ignored # -sub check_gst_props_set() +sub check_no_ignore() { - if (grep { /^\s+gst_props_set\s*\(/; } @lines) { - print "E: return value of gst_props_set() possibly ignored\n"; + if (grep { /^\s+gst_buffer_merge\s*\(/; } @lines) { + print "E: return value of gst_buffer_merge () possibly ignored\n"; + } + if (grep { /^\s+malloc\s*\(/; } @lines) { + print "E: return value of malloc() possibly ignored\n"; + } + if (grep { /^\s+gst_buffer_new\s*\(/; } @lines) { + print "E: return value of gst_buffer_new() possibly ignored\n"; } }