changeset 1305:0a8237e28ce0

Use FOURCC macro to encode fcc values. Avoids accessing 32-bit data from unaligned memory locations and improves portability
author jkeil
date Thu, 12 Jul 2001 15:10:06 +0000
parents ecb834719dc9
children 7ce37211e454
files codec-cfg.c
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/codec-cfg.c	Thu Jul 12 15:08:02 2001 +0000
+++ b/codec-cfg.c	Thu Jul 12 15:10:06 2001 +0000
@@ -15,6 +15,9 @@
 #include <assert.h>
 #include <string.h>
 
+#include "loader.h"	  // loader+avifmt for mmioFOURCC
+#include "wine/avifmt.h"
+
 #include "libvo/img_format.h"
 #include "codec-cfg.h"
 
@@ -34,7 +37,7 @@
 		unsigned int *map)
 {
 	int i, j, freeslots;
-	char **aliasp;
+	char *aliasp;
 	unsigned int tmp;
 
 	/* find first unused slot */
@@ -44,14 +47,14 @@
 	if (!freeslots)
 		goto err_out_too_many;
 
-	aliasp = (alias) ? &alias : &s;
+	aliasp = (alias) ? alias : s;
 	do {
-		tmp = *((unsigned int *) s);
+		tmp = mmioFOURCC(s[0], s[1], s[2], s[3]);
 		for (j = 0; j < i; j++)
 			if (tmp == fourcc[j])
 				goto err_out_duplicated;
 		fourcc[i] = tmp;
-		map[i] = *((unsigned int *) (*aliasp));
+		map[i] = mmioFOURCC(aliasp[0], aliasp[1], aliasp[2], aliasp[3]);
 		s += 4;
 		i++;
 	} while ((*(s++) == ',') && --freeslots);