summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/img2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/img2.c b/libavformat/img2.c
index 413f5d02e6..7619d7fbc8 100644
--- a/libavformat/img2.c
+++ b/libavformat/img2.c
@@ -46,8 +46,9 @@ static const IdStrMap img_tags[] = {
static enum CodecID av_str2id(const IdStrMap *tags, const char *str)
{
- while(*str && *str!='.') str++;
- if(*str) str++;
+ str= strrchr(str, '.');
+ if(!str) return CODEC_ID_NONE;
+ str++;
while (tags->id) {
int i;