avoid strcmp NULL, fix segv on mingw
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Tue, 14 Apr 2009 00:12:29 +0000 (00:12 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Tue, 14 Apr 2009 00:12:29 +0000 (00:12 +0000)
Originally committed as revision 18502 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/imgconvert.c

index ffc0f08..46b4cbb 100644 (file)
@@ -494,7 +494,7 @@ static enum PixelFormat avcodec_get_pix_fmt_internal(const char *name)
     int i;
 
     for (i=0; i < PIX_FMT_NB; i++)
-         if (!strcmp(pix_fmt_info[i].name, name))
+        if (pix_fmt_info[i].name && !strcmp(pix_fmt_info[i].name, name))
              return i;
     return PIX_FMT_NONE;
 }