summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Holst <holstsn@users.sourceforge.net>2002-12-26 20:30:00 +0000
committerStefan Holst <holstsn@users.sourceforge.net>2002-12-26 20:30:00 +0000
commitc42215d759320ab0cfb4d997064535c0bf32f785 (patch)
treee165ba181dbba77172dcc292f7a4484d768dd411 /src
parentc5f00d72fde0d76912089905b8e20c1fa8ecdfdb (diff)
downloadxine-lib-c42215d759320ab0cfb4d997064535c0bf32f785.tar.gz
xine-lib-c42215d759320ab0cfb4d997064535c0bf32f785.tar.bz2
catch a possible segfault
CVS patchset: 3685 CVS date: 2002/12/26 20:30:00
Diffstat (limited to 'src')
-rw-r--r--src/input/pnm.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/input/pnm.c b/src/input/pnm.c
index da91d67ad..a3bcac484 100644
--- a/src/input/pnm.c
+++ b/src/input/pnm.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: pnm.c,v 1.7 2002/12/26 14:57:33 holstsn Exp $
+ * $Id: pnm.c,v 1.8 2002/12/26 20:30:00 holstsn Exp $
*
* pnm protocol implementation
* based upon code from joschka
@@ -548,11 +548,12 @@ static int pnm_get_headers(pnm_t *p, int *need_response) {
size+=chunk_size;
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;
@@ -780,7 +781,7 @@ pnm_t *pnm_connect(const char *mrl) {
int pathbegin, hostend;
pnm_t *p=malloc(sizeof(pnm_t));
int fd;
- int need_response;
+ int need_response=0;
if (strncmp(mrl,"pnm://",6))
{