[vlc-commits] rtp: jpeg: fix memory leaks
Tristan Matthews
git at videolan.org
Thu Jan 15 06:35:53 CET 2015
vlc/vlc-2.2 | branch: master | Tristan Matthews <tmatth at videolan.org> | Thu Jan 15 00:18:14 2015 -0500| [a40eb079b3f8438b555f6146fe4d3b2058f54429] | committer: Tristan Matthews
rtp: jpeg: fix memory leaks
(cherry picked from commit cbcbd32c1e62235877288bc0e0b54aad400a305f)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=a40eb079b3f8438b555f6146fe4d3b2058f54429
---
modules/stream_out/rtpfmt.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/modules/stream_out/rtpfmt.c b/modules/stream_out/rtpfmt.c
index ff7ea10..633fa19 100644
--- a/modules/stream_out/rtpfmt.c
+++ b/modules/stream_out/rtpfmt.c
@@ -1569,11 +1569,14 @@ static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, block_t *in )
int i_payload = __MIN( i_data, (int)(rtp_mtu (id) - hdr_size) );
if ( i_payload <= 0 )
- return VLC_EGENERIC;
+ goto error;
block_t *out = block_Alloc( 12 + hdr_size + i_payload );
if( out == NULL )
+ {
+ block_Release( in );
return VLC_ENOMEM;
+ }
uint8_t *p = out->p_buffer + 12;
/* set main header */
More information about the vlc-commits
mailing list