vhook/ppm.c:162: error: Null Dereference
  pointer `in` last assigned on line 159 could be null and is dereferenced by call to `fgets()` at line 162, column 5.

vhook/ppm.c:156:1: start of procedure rwpipe_read_ppm_header()
154. */
155. 
156. static int rwpipe_read_ppm_header( rwpipe *rw, int *width, int *height )
     ^
157. {
158.     char line[ 3 ];

vhook/ppm.c:159:5: 
157. {
158.     char line[ 3 ];
159.     FILE *in = rwpipe_reader( rw );
         ^
160.     int max;
161. 

vhook/ppm.c:103:1: start of procedure rwpipe_reader()
  101. */
  102. 
  103. static FILE *rwpipe_reader( rwpipe *this )
       ^
  104. {
  105.     if ( this != NULL )

vhook/ppm.c:105:10: Taking false branch
  103. static FILE *rwpipe_reader( rwpipe *this )
  104. {
  105.     if ( this != NULL )
                ^
  106.         return this->reader;
  107.     else

vhook/ppm.c:108:9: 
  106.         return this->reader;
  107.     else
  108.         return NULL;
               ^
  109. }
  110. 

vhook/ppm.c:109:1: return from a call to rwpipe_reader
  107.     else
  108.         return NULL;
  109. }
       ^
  110. 
  111. /** Write data to the pipe.

vhook/ppm.c:162:5: 
160.     int max;
161. 
162.     fgets( line, 3, in );
         ^
163.     if ( !strncmp( line, "P6", 2 ) )
164.     {

static int rwpipe_read_ppm_header( rwpipe *rw, int *width, int *height )
{
    char line[ 3 ];
    FILE *in = rwpipe_reader( rw );
    int max;
    fgets( line, 3, in );
    if ( !strncmp( line, "P6", 2 ) )
    {
        *width = rwpipe_read_number( rw );
        *height = rwpipe_read_number( rw );
        max = rwpipe_read_number( rw );
        return max != 255 || *width <= 0 || *height <= 0;
    }
    return 1;
}
['static int rwpipe_read_ppm_header( rwpipe *rw, int *width, int *height )\n{\n    char line[ 3 ];\n    FILE *in = rwpipe_reader( rw );\n    int max;\n    fgets( line, 3, in );\n    if ( !strncmp( line, "P6", 2 ) )\n    {\n        *width = rwpipe_read_number( rw );\n        *height = rwpipe_read_number( rw );\n        max = rwpipe_read_number( rw );\n        return max != 255 || *width <= 0 || *height <= 0;\n    }\n    return 1;\n}', 'static FILE *rwpipe_reader( rwpipe *this )\n{\n    if ( this != NULL )\n        return this->reader;\n    else\n        return NULL;\n}']