view barpainet.c @ 667:57e9d1bdcb09 libavformat

VMD playing error patch by (Kostya (cannonball bw-team com>) "I recently got a game called Lighthouse from Sierra with FMV in VMD format. Some of them played OK, some of them FFmpeg refused to open, some caused a crash. I investigated files which couldn't be opened by FFmpeg and it appeared that they had no audio (and bytes 2-3 from beginning of file contained 01 00, all other have 00 00 insted). Attached patch fixes this issue."
author michael
date Fri, 04 Feb 2005 03:38:33 +0000
parents 05318cf2e886
children da1d5db0ce5c
line wrap: on
line source


#include <stdlib.h>
#include <strings.h>
#include "barpainet.h"

int inet_aton (const char * str, struct in_addr * add) {
	const char * pch = str;
	unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0;
	
	add1 = atoi(pch);
	pch = strpbrk(pch,".");
	if (pch == 0 || ++pch == 0) goto done;
	add2 = atoi(pch);
	pch = strpbrk(pch,".");
	if (pch == 0 || ++pch == 0) goto done;
	add3 = atoi(pch);
	pch = strpbrk(pch,".");
	if (pch == 0 || ++pch == 0) goto done;
	add4 = atoi(pch);

done:
	add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1;
	
	return 1;	
}