diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index c88db69782a2aad2dd6c2767538281fb787d2eb3..70bef9d40502cbeb274ed4ef47a9eeea6854d294 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -703,6 +703,7 @@ AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\
     .read_header    = ff_img_read_header,\
     .read_packet    = ff_img_read_packet,\
     .priv_class     = & imgname ## _class,\
+    .flags          = AVFMT_GENERIC_INDEX, \
     .raw_codec_id   = codecid,\
 };