Commit 1389ca04 authored by ivoire's avatar ivoire

Revert "RTMP: factorization"

This commit add a deref-after-free bug.

This reverts commit 25cbae45.
parent f7fa395e
......@@ -404,15 +404,19 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
tmp_buffer = rtmp_encode_packet( p_sys->p_thread, rtmp_packet );
i_ret = net_Write( p_sys->p_thread, p_sys->p_thread->fd, NULL, tmp_buffer, rtmp_packet->length_encoded );
free( rtmp_packet->body->body );
free( rtmp_packet->body );
free( rtmp_packet );
free( tmp_buffer );
if( i_ret != rtmp_packet->length_encoded )
{
free( rtmp_packet->body->body );
free( rtmp_packet->body );
free( rtmp_packet );
free( tmp_buffer );
msg_Err( p_access, "failed send publish start" );
return -1;
}
free( rtmp_packet->body->body );
free( rtmp_packet->body );
free( rtmp_packet );
free( tmp_buffer );
}
p_access->info.i_pos += i_len_tmp;
......@@ -422,16 +426,19 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
tmp_buffer = rtmp_encode_packet( p_sys->p_thread, rtmp_packet );
i_ret = net_Write( p_sys->p_thread, p_sys->p_thread->fd, NULL, tmp_buffer, rtmp_packet->length_encoded );
free( rtmp_packet->body->body );
free( rtmp_packet->body );
free( rtmp_packet );
free( tmp_buffer );
if( i_ret != rtmp_packet->length_encoded )
{
free( rtmp_packet->body->body );
free( rtmp_packet->body );
free( rtmp_packet );
free( tmp_buffer );
msg_Err( p_access, "failed send bytes read" );
return -1;
}
free( rtmp_packet->body->body );
free( rtmp_packet->body );
free( rtmp_packet );
free( tmp_buffer );
}
return i_len_tmp;
......
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