Commit 64310cf3 authored by Sam Hocevar's avatar Sam Hocevar

* ./modules/access/mms/mms.c: fixed signed/unsigned comparisons, and fixed

    a bug I found in Read(). No idea whether it was triggered before nor what
    it was doing, though :)
parent ee0a2449
......@@ -2,7 +2,7 @@
* buffer.c: MMS access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: buffer.c,v 1.2 2002/11/25 00:22:04 fenrir Exp $
* $Id: buffer.c,v 1.3 2002/12/06 13:05:22 sam Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -118,7 +118,7 @@ void var_buffer_addmemory( var_buffer_t *p_buf, void *p_mem, int i_mem )
void var_buffer_addUTF16( var_buffer_t *p_buf, char *p_str )
{
int i;
unsigned int i;
if( !p_str )
{
var_buffer_add16( p_buf, 0 );
......
......@@ -2,7 +2,7 @@
* mms.c: MMS access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: mms.c,v 1.11 2002/12/04 06:23:08 titer Exp $
* $Id: mms.c,v 1.12 2002/12/06 13:05:22 sam Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -446,7 +446,8 @@ static int Read ( input_thread_t * p_input, byte_t * p_buffer,
}
else
{
if( p_access->i_eos || mms_HeaderMediaRead( p_input, MMS_PACKET_MEDIA ) < 0 );
if( p_access->i_eos
|| mms_HeaderMediaRead( p_input, MMS_PACKET_MEDIA ) < 0 )
{
p_access->i_pos += i_data;
return( i_data );
......@@ -1559,13 +1560,13 @@ static int mms_ParseCommand( input_thread_t *p_input,
}
static int mms_ParsePacket( input_thread_t *p_input,
uint8_t *p_data, int i_data,
uint8_t *p_data, size_t i_data,
int *pi_used )
{
access_t *p_access = (access_t*)p_input->p_access_data;
int i_packet_seq_num;
int i_packet_length;
int i_packet_id;
size_t i_packet_length;
uint32_t i_packet_id;
uint8_t *p_packet;
......
......@@ -2,7 +2,7 @@
* mms.h: MMS access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: mms.h,v 1.5 2002/11/25 15:08:34 fenrir Exp $
* $Id: mms.h,v 1.6 2002/12/06 13:05:22 sam Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -104,8 +104,8 @@ typedef struct access_s
int i_header;
uint8_t *p_media; /* allocated by mms_ReadPacket */
int i_media;
int i_media_used;
size_t i_media;
size_t i_media_used;
/* extracted informations */
int i_command;
......@@ -120,20 +120,20 @@ typedef struct access_s
/* from 0x06 answer */
uint32_t i_flags_broadcast;
uint32_t i_media_length;
int i_packet_length;
size_t i_packet_length;
uint32_t i_packet_count;
int i_max_bit_rate;
int i_header_size;
size_t i_header_size;
} access_t;
static inline uint16_t GetWLE( u8 *p_buff )
static inline uint16_t GetWLE( uint8_t *p_buff )
{
return( (p_buff[0]) + ( p_buff[1] <<8 ) );
}
static inline uint32_t GetDWLE( u8 *p_buff )
static inline uint32_t GetDWLE( uint8_t *p_buff )
{
return( p_buff[0] + ( p_buff[1] <<8 ) +
( p_buff[2] <<16 ) + ( p_buff[3] <<24 ) );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment