File ftbfs-gcc4.7.patch of Package avifile

Index: avifile-0.7-0.7.45/lib/aviread/AsfNetworkInputStream.cpp
===================================================================
--- avifile-0.7-0.7.45.orig/lib/aviread/AsfNetworkInputStream.cpp
+++ avifile-0.7-0.7.45/lib/aviread/AsfNetworkInputStream.cpp
@@ -592,7 +592,7 @@ ok:
 	close(m_iSocket);
     m_iSocket = -1;
     flushPipe();
-    return (void*)result;
+    return (void*)((intptr_t)result);
 }
 
 void* AsfNetworkInputStream::threadStarter(void* arg)
@@ -937,7 +937,7 @@ int AsfNetworkInputStream::readContent()
 	}
 
 	asf_packet* p;
-	unsigned short& size = chhdr.size;
+
 	//printf("STREAMPACKET 0x%x  sz:%d  %lld   seq:%d part:%d  sc:%d\n", chhdr.kind, size, rsize, chhdr.seq, chhdr.partflag, chhdr.size_confirm);
 	switch (chhdr.kind)
 	{
@@ -973,15 +973,15 @@ int AsfNetworkInputStream::readContent()
 		m_bFinished = true;
 		continue;
 	    }
-	    if (size > m_Header.max_pktsize)
+            if (((unsigned short)(chhdr.size)) > m_Header.max_pktsize)
 	    {
-		AVM_WRITE("ASF network reader", "size>m_Header.max_pktsize (%d > %d) ignoring...\n", size, m_Header.max_pktsize);
+                AVM_WRITE("ASF network reader", "size>m_Header.max_pktsize (%d > %d) ignoring...\n", ((unsigned short)(chhdr.size)), m_Header.max_pktsize);
 		continue;
 	    }
 
 	    //AVM_WRITE("ASF network reader", "Packet size %d\n", size);
 	    p = new asf_packet(m_Header.max_pktsize);
-	    if (read(&(*p)[0], size) <= 0)
+            if (read(&(*p)[0], ((unsigned short)(chhdr.size))) <= 0)
 	    {
 		p->release();
 		AVM_WRITE("ASF network reader", "read() no more data\n");
@@ -992,8 +992,8 @@ int AsfNetworkInputStream::readContent()
 	    //for (int i = 0; i < 20; i++)
 	    //    AVM_WRITE("ASF network reader", "%02x ",(uint_t) (*p)[inloaded + i]);
 	    //AVM_WRITE("ASF network reader", "\n");
-	    if (m_lfd >= 0 && size < m_Header.max_pktsize)
-                memset(&(*p)[size], 0, m_Header.max_pktsize - size); // zero padding
+            if (m_lfd >= 0 && ((unsigned short)(chhdr.size)) < m_Header.max_pktsize)
+              memset(&(*p)[((unsigned short)(chhdr.size))], 0, m_Header.max_pktsize - ((unsigned short)(chhdr.size))); // zero padding
 	    //AVM_WRITE("ASF network reader", 0, "Created packet %p  %d - 0x%x (free %d : %.2f)\n", p, p->size(), (*p)[0], m_Header.max_pktsize - size, size/(float)m_Header.max_pktsize);
 	    if (p->init(m_uiTimeshift) == 0)
 	    {