diff options
author | Patrik Kullman <patrik@yes.nu> | 2009-02-21 21:09:38 +0000 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2009-02-21 21:09:38 +0000 |
commit | 7e10145976866fc6227d3ccc697a7c9fee862a77 (patch) | |
tree | 91008b58085ef8c7f6c800123e16f40edd03ee3a | |
parent | 154d432cc4db96a0320afe948b78d18320a3174a (diff) | |
download | ffmpeg-7e10145976866fc6227d3ccc697a7c9fee862a77.tar.gz |
Check the return values of a few functions to avoid the corresponding warnings.
patch by Patrik Kullman, patrik yes nu
Originally committed as revision 17501 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | vhook/ppm.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/vhook/ppm.c b/vhook/ppm.c index 0e37ac412e..86fad1dc59 100644 --- a/vhook/ppm.c +++ b/vhook/ppm.c @@ -56,8 +56,11 @@ static rwpipe *rwpipe_open( int argc, char *argv[] ) int input[ 2 ]; int output[ 2 ]; - pipe( input ); - pipe( output ); + if (!pipe( input )) + return NULL; + + if (!pipe( output )) + return NULL; this->pid = fork(); @@ -160,7 +163,9 @@ static int rwpipe_read_ppm_header( rwpipe *rw, int *width, int *height ) FILE *in = rwpipe_reader( rw ); int max; - fgets( line, 3, in ); + if (!fgets( line, 3, in )) + return -1; + if ( !strncmp( line, "P6", 2 ) ) { *width = rwpipe_read_number( rw ); |