Fix a crash when probing img2 format with a NULL filename.
[ffmpeg.git] / libavformat / img2.c
index 770858406744131ed597cccc2255b77607c68e05..c2538d1e98fe0e9c231d6f66d32c0756efd50821 100644 (file)
@@ -154,7 +154,7 @@ static int find_image_range(int *pfirst_index, int *plast_index,
 
 static int image_probe(AVProbeData *p)
 {
-    if (av_str2id(img_tags, p->filename)) {
+    if (p->filename && av_str2id(img_tags, p->filename)) {
         if (av_filename_number_test(p->filename))
             return AVPROBE_SCORE_MAX;
         else