Commit 305d2ca1 authored by Jean-Paul Saman's avatar Jean-Paul Saman

packetizer_copy: fix potential memleak

parent f86d0e82
......@@ -101,7 +101,7 @@ static int Open( vlc_object_t *p_this )
case VLC_FOURCC( 'X', 'v', 'i', 'D'):
case VLC_FOURCC( 'x', 'v', 'i', 'd'):
case VLC_FOURCC( 'D', 'X', '5', '0'):
case VLC_FOURCC( 0x04, 0, 0, 0):
case VLC_FOURCC( 0x04, 0, 0, 0 ):
case VLC_FOURCC( '3', 'I', 'V', '2'):
p_dec->fmt_out.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v');
break;
......@@ -182,7 +182,7 @@ static int Open( vlc_object_t *p_this )
break;
default:
msg_Err( p_dec, "unknown raw audio sample size" );
return VLC_EGENERIC;
goto error;
}
break;
......@@ -203,7 +203,7 @@ static int Open( vlc_object_t *p_this )
break;
default:
msg_Err( p_dec, "unknown raw audio sample size" );
return VLC_EGENERIC;
goto error;
}
break;
......@@ -224,17 +224,24 @@ static int Open( vlc_object_t *p_this )
break;
default:
msg_Err( p_dec, "unknown raw audio sample size" );
return VLC_EGENERIC;
goto error;
}
break;
}
p_dec->p_sys = p_sys = malloc( sizeof( block_t ) );
if( !p_sys )
{
es_format_Clean( &p_dec->fmt_out );
return VLC_ENOMEM;
p_sys->p_block = NULL;
}
p_sys->p_block = NULL;
return VLC_SUCCESS;
error:
es_format_Clean( &p_dec->fmt_out );
return VLC_EGENERIC;
}
/*****************************************************************************
......
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