summaryrefslogtreecommitdiff
path: root/libavformat/os_support.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/os_support.c')
-rw-r--r--libavformat/os_support.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index e28a7bc748..5342a02ed0 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -46,16 +46,17 @@ int inet_aton (const char * str, struct in_addr * add)
add1 = atoi(pch);
pch = strpbrk(pch,".");
- if (pch == 0 || ++pch == 0) goto done;
+ if (pch == 0 || ++pch == 0) return 0;
add2 = atoi(pch);
pch = strpbrk(pch,".");
- if (pch == 0 || ++pch == 0) goto done;
+ if (pch == 0 || ++pch == 0) return 0;
add3 = atoi(pch);
pch = strpbrk(pch,".");
- if (pch == 0 || ++pch == 0) goto done;
+ if (pch == 0 || ++pch == 0) return 0;
add4 = atoi(pch);
-done:
+ if (!add1 || (add1|add2|add3|add4) > 255) return 0;
+
add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1;
return 1;