Bug#421695: Refined patch
Rob Sims
debbugs-z at robsims.com
Fri May 4 12:11:07 UTC 2007
Sorry for the noise. The preceding patch fails if frame size reaches
10k.
--- mpjpeg.c 2007-05-04 06:02:49.000000000 -0600
+++ vlc-0.8.6.a.debian/modules/mux/mpjpeg.c 2007-05-03 17:45:48.000000000 -0600
@@ -183,7 +183,7 @@
sout_mux_sys_t *p_sys = p_mux->p_sys;
int i_count;
/* Content-Length:.......\r\n */
- char psz_content_length[25];
+ char psz_content_length[30];
if( p_sys->b_send_headers )
{
@@ -191,9 +191,9 @@
char *psz_separator = var_CreateGetString( p_mux,
SOUT_CFG_PREFIX "separator" );
char *psz_separator_block = (char *)malloc( strlen( psz_separator ) +
- 2 + strlen( CONTENT_TYPE ) );
+ 7 + strlen( CONTENT_TYPE ) );
- sprintf( psz_separator_block, "%s\r\n%s\r\n", psz_separator,
+ sprintf( psz_separator_block, "%s\r\n%s\r\n\r\n", psz_separator,
CONTENT_TYPE );
p_header = block_New( p_mux, strlen( psz_separator_block ) );
@@ -211,14 +211,13 @@
i_count = p_fifo->i_depth;
while( i_count > 0 )
{
- block_t *p_length = block_New( p_mux, 25 );
block_t *p_data = block_FifoGet( p_fifo );
sout_AccessOutWrite( p_mux->p_access,
block_Duplicate( p_sys->p_separator ) );
- memset( psz_content_length, 0, 25 );
- snprintf( psz_content_length, 25, "Content-Length: %i\r\n\r\n",
+ snprintf( psz_content_length, 30, "Content-Length: %i\r\n\r\n",
p_data->i_buffer );
- memcpy( p_length->p_buffer, psz_content_length, 25 );
+ block_t *p_length = block_New( p_mux, strlen(psz_content_length) );
+ memcpy( p_length->p_buffer, psz_content_length, p_length->i_buffer );
sout_AccessOutWrite( p_mux->p_access, p_length );
sout_AccessOutWrite( p_mux->p_access, p_data );
--
Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20070504/c9154940/attachment.pgp
More information about the pkg-multimedia-maintainers
mailing list