changeset 8852:668cc9e77d2d

check if prop_hdr==NULL insteda of sig11
author arpi
date Thu, 09 Jan 2003 18:00:58 +0000
parents 636c1e894a27
children 27705ba7ffa9
files libmpdemux/pnm.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/pnm.c	Thu Jan 09 09:37:53 2003 +0000
+++ b/libmpdemux/pnm.c	Thu Jan 09 18:00:58 2003 +0000
@@ -512,10 +512,11 @@
     ptr+=chunk_size;
   }
   
-  /* set pre-buffer to a low number */
-  /* prop_hdr[36]=0x01;
-  prop_hdr[37]=0xd6; */
-
+  if (!prop_hdr) {
+    printf("input_pnm: error while parsing headers.\n");
+    return 0;
+  }
+  
   /* set data offset */
   size--;
   prop_hdr[42]=(size>>24)%0xff;
@@ -740,7 +741,7 @@
 pnm_t *pnm_connect(int fd, char *path) {
   
   pnm_t *p=malloc(sizeof(pnm_t));
-  int need_response;
+  int need_response=0;
   
   p->path=strdup(path);
   p->s=fd;