# HG changeset patch # User Matti Hamalainen # Date 1351934056 -7200 # Node ID 77fae3e4e4d317a3c2627d64fb894d084c50c979 # Parent e2f8c9cbc17a7903058a13abda5e6f167b01f0b4 Fix a segfault due to not checking for NULL file extension entries in dmGetFormatByExt(). diff -r e2f8c9cbc17a -r 77fae3e4e4d3 gfxconv.c --- a/gfxconv.c Sat Nov 03 11:13:33 2012 +0200 +++ b/gfxconv.c Sat Nov 03 11:14:16 2012 +0200 @@ -210,10 +210,14 @@ BOOL dmGetFormatByExt(const char *fext, int *format, int *subformat) { int i; + if (fext == NULL) + return FALSE; + for (i = 0; i < nconvFormatList; i++) { DMConvFormat *fmt = &convFormatList[i]; - if (strcasecmp(fext, fmt->fext) == 0) + if (fmt->fext != NULL && + strcasecmp(fext, fmt->fext) == 0) { *format = fmt->format; *subformat = fmt->subformat;