hash
int64 -9,197,960,073,880,366,000
9,199,363,627B
| project
stringclasses 2
values | size
int64 2
5.68k
| label
int64 0
1
| functionSource
stringlengths 31
235k
|
---|---|---|---|---|
-8,620,097,311,326,519,000 | chrome | 35 | 0 | err_status_t srtp_stream_clone ( const srtp_stream_ctx_t * stream_template , uint32_t ssrc , srtp_stream_ctx_t * * str_ptr ) {
err_status_t status ;
srtp_stream_ctx_t * str ;
debug_print ( mod_srtp , "cloning stream (SSRC: 0x%08x)" , ssrc ) ;
str = ( srtp_stream_ctx_t * ) crypto_alloc ( sizeof ( srtp_stream_ctx_t ) ) ;
if ( str == NULL ) return err_status_alloc_fail ;
* str_ptr = str ;
str -> rtp_cipher = stream_template -> rtp_cipher ;
str -> rtp_auth = stream_template -> rtp_auth ;
str -> rtcp_cipher = stream_template -> rtcp_cipher ;
str -> rtcp_auth = stream_template -> rtcp_auth ;
status = key_limit_clone ( stream_template -> limit , & str -> limit ) ;
if ( status ) {
crypto_free ( * str_ptr ) ;
* str_ptr = NULL ;
return status ;
}
status = rdbx_init ( & str -> rtp_rdbx , rdbx_get_window_size ( & stream_template -> rtp_rdbx ) ) ;
if ( status ) {
crypto_free ( * str_ptr ) ;
* str_ptr = NULL ;
return status ;
}
rdb_init ( & str -> rtcp_rdb ) ;
str -> allow_repeat_tx = stream_template -> allow_repeat_tx ;
str -> ssrc = ssrc ;
str -> direction = stream_template -> direction ;
str -> rtp_services = stream_template -> rtp_services ;
str -> rtcp_services = stream_template -> rtcp_services ;
str -> ekt = stream_template -> ekt ;
memcpy ( str -> salt , stream_template -> salt , SRTP_AEAD_SALT_LEN ) ;
memcpy ( str -> c_salt , stream_template -> c_salt , SRTP_AEAD_SALT_LEN ) ;
str -> next = NULL ;
return err_status_ok ;
} |
-7,990,991,774,694,156,000 | debian | 24 | 1 | static void vp3_draw_horiz_band ( Vp3DecodeContext * s , int y ) {
int h , cy , i ;
int offset [ AV_NUM_DATA_POINTERS ] ;
if ( HAVE_THREADS && s -> avctx -> active_thread_type & FF_THREAD_FRAME ) {
int y_flipped = s -> flipped_image ? s -> avctx -> height - y : y ;
ff_thread_report_progress ( & s -> current_frame , y_flipped == s -> avctx -> height ? INT_MAX : y_flipped - 1 , 0 ) ;
}
if ( s -> avctx -> draw_horiz_band == NULL ) return ;
h = y - s -> last_slice_end ;
s -> last_slice_end = y ;
y -= h ;
if ( ! s -> flipped_image ) {
y = s -> avctx -> height - y - h ;
}
cy = y >> s -> chroma_y_shift ;
offset [ 0 ] = s -> current_frame . linesize [ 0 ] * y ;
offset [ 1 ] = s -> current_frame . linesize [ 1 ] * cy ;
offset [ 2 ] = s -> current_frame . linesize [ 2 ] * cy ;
for ( i = 3 ;
i < AV_NUM_DATA_POINTERS ;
i ++ ) offset [ i ] = 0 ;
emms_c ( ) ;
s -> avctx -> draw_horiz_band ( s -> avctx , & s -> current_frame , offset , y , 3 , h ) ;
} |
1,760,449,185,745,615,400 | debian | 3 | 0 | TSVConn TSHttpConnect ( sockaddr const * addr ) {
return TSHttpConnectWithPluginId ( addr , "plugin" , 0 ) ;
} |
-4,106,680,724,983,639,000 | chrome | 15 | 1 | static void sbr_qmf_analysis ( AVFloatDSPContext * dsp , FFTContext * mdct , SBRDSPContext * sbrdsp , const float * in , float * x , float z [ 320 ] , float W [ 2 ] [ 32 ] [ 32 ] [ 2 ] , int buf_idx ) {
int i ;
memcpy ( x , x + 1024 , ( 320 - 32 ) * sizeof ( x [ 0 ] ) ) ;
memcpy ( x + 288 , in , 1024 * sizeof ( x [ 0 ] ) ) ;
for ( i = 0 ;
i < 32 ;
i ++ ) {
dsp -> vector_fmul_reverse ( z , sbr_qmf_window_ds , x , 320 ) ;
sbrdsp -> sum64x5 ( z ) ;
sbrdsp -> qmf_pre_shuffle ( z ) ;
mdct -> imdct_half ( mdct , z , z + 64 ) ;
sbrdsp -> qmf_post_shuffle ( W [ buf_idx ] [ i ] , z ) ;
x += 32 ;
}
} |
-3,889,154,245,145,552,000 | debian | 15 | 0 | static void parse_cat_blob ( const char * p ) {
struct object_entry * oe = oe ;
unsigned char sha1 [ 20 ] ;
if ( * p == ':' ) {
oe = find_mark ( parse_mark_ref_eol ( p ) ) ;
if ( ! oe ) die ( "Unknown mark: %s" , command_buf . buf ) ;
hashcpy ( sha1 , oe -> idx . sha1 ) ;
}
else {
if ( get_sha1_hex ( p , sha1 ) ) die ( "Invalid dataref: %s" , command_buf . buf ) ;
if ( p [ 40 ] ) die ( "Garbage after SHA1: %s" , command_buf . buf ) ;
oe = find_object ( sha1 ) ;
}
cat_blob ( oe , sha1 ) ;
} |
1,353,431,100,313,404,400 | chrome | 15 | 0 | static int tile_worker_hook ( TileWorkerData * const tile_data , const TileInfo * const tile ) {
int mi_row , mi_col ;
for ( mi_row = tile -> mi_row_start ;
mi_row < tile -> mi_row_end ;
mi_row += MI_BLOCK_SIZE ) {
vp9_zero ( tile_data -> xd . left_context ) ;
vp9_zero ( tile_data -> xd . left_seg_context ) ;
for ( mi_col = tile -> mi_col_start ;
mi_col < tile -> mi_col_end ;
mi_col += MI_BLOCK_SIZE ) {
decode_partition ( tile_data -> cm , & tile_data -> xd , tile , mi_row , mi_col , & tile_data -> bit_reader , BLOCK_64X64 ) ;
}
}
return ! tile_data -> xd . corrupted ;
} |
7,320,640,583,188,909,000 | debian | 21 | 1 | static int remoteStreamHandleWriteData ( struct qemud_client * client , struct qemud_client_stream * stream , struct qemud_client_message * msg ) {
remote_error rerr ;
int ret ;
VIR_DEBUG ( "stream=%p proc=%d serial=%d len=%d offset=%d" , stream , msg -> hdr . proc , msg -> hdr . serial , msg -> bufferLength , msg -> bufferOffset ) ;
memset ( & rerr , 0 , sizeof rerr ) ;
ret = virStreamSend ( stream -> st , msg -> buffer + msg -> bufferOffset , msg -> bufferLength - msg -> bufferOffset ) ;
if ( ret > 0 ) {
msg -> bufferOffset += ret ;
if ( msg -> bufferOffset < msg -> bufferLength ) return 1 ;
}
else if ( ret == - 2 ) {
return 1 ;
}
else {
VIR_INFO0 ( "Stream send failed" ) ;
stream -> closed = 1 ;
remoteDispatchConnError ( & rerr , client -> conn ) ;
return remoteSerializeReplyError ( client , & rerr , & msg -> hdr ) ;
}
return 0 ;
} |
-2,723,830,976,796,502,500 | chrome | 5 | 0 | static vpx_codec_err_t ctrl_set_static_thresh ( vpx_codec_alg_priv_t * ctx , va_list args ) {
struct vp9_extracfg extra_cfg = ctx -> extra_cfg ;
extra_cfg . static_thresh = CAST ( VP8E_SET_STATIC_THRESHOLD , args ) ;
return update_extra_cfg ( ctx , & extra_cfg ) ;
} |
1,223,258,652,239,369,200 | debian | 14 | 0 | static inline void spl_filesystem_object_get_file_name ( spl_filesystem_object * intern TSRMLS_DC ) {
char slash = SPL_HAS_FLAG ( intern -> flags , SPL_FILE_DIR_UNIXPATHS ) ? '/' : DEFAULT_SLASH ;
switch ( intern -> type ) {
case SPL_FS_INFO : case SPL_FS_FILE : if ( ! intern -> file_name ) {
php_error_docref ( NULL TSRMLS_CC , E_ERROR , "Object not initialized" ) ;
}
break ;
case SPL_FS_DIR : if ( intern -> file_name ) {
efree ( intern -> file_name ) ;
}
intern -> file_name_len = spprintf ( & intern -> file_name , 0 , "%s%c%s" , spl_filesystem_object_get_path ( intern , NULL TSRMLS_CC ) , slash , intern -> u . dir . entry . d_name ) ;
break ;
}
} |
927,123,821,003,322,000 | chrome | 4 | 0 | IN_PROC_BROWSER_TEST_F ( SessionRestorePageLoadMetricsBrowserTest , NoSessionRestore ) {
ui_test_utils : : NavigateToURL ( browser ( ) , GetTestURL ( ) ) ;
ExpectFirstPaintMetricsTotalCount ( 0 ) ;
} |
6,871,081,691,104,220,000 | debian | 30 | 0 | static void fill_scaling_lists ( struct dxva_context * ctx , const H264Context * h , DXVA_Qmatrix_H264 * qm ) {
unsigned i , j ;
memset ( qm , 0 , sizeof ( * qm ) ) ;
if ( ctx -> workaround & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG ) {
for ( i = 0 ;
i < 6 ;
i ++ ) for ( j = 0 ;
j < 16 ;
j ++ ) qm -> bScalingLists4x4 [ i ] [ j ] = h -> pps . scaling_matrix4 [ i ] [ j ] ;
for ( i = 0 ;
i < 64 ;
i ++ ) {
qm -> bScalingLists8x8 [ 0 ] [ i ] = h -> pps . scaling_matrix8 [ 0 ] [ i ] ;
qm -> bScalingLists8x8 [ 1 ] [ i ] = h -> pps . scaling_matrix8 [ 3 ] [ i ] ;
}
}
else {
for ( i = 0 ;
i < 6 ;
i ++ ) for ( j = 0 ;
j < 16 ;
j ++ ) qm -> bScalingLists4x4 [ i ] [ j ] = h -> pps . scaling_matrix4 [ i ] [ zigzag_scan [ j ] ] ;
for ( i = 0 ;
i < 64 ;
i ++ ) {
qm -> bScalingLists8x8 [ 0 ] [ i ] = h -> pps . scaling_matrix8 [ 0 ] [ ff_zigzag_direct [ i ] ] ;
qm -> bScalingLists8x8 [ 1 ] [ i ] = h -> pps . scaling_matrix8 [ 3 ] [ ff_zigzag_direct [ i ] ] ;
}
}
} |
9,175,972,616,340,456,000 | debian | 17 | 0 | static char * * create_argv_help ( const char * path , const char * command , const char * subcommand ) {
char * * req_argv = NULL ;
const char * program ;
if ( subcommand == NULL ) req_argv = xcalloc ( 3 , sizeof ( char * ) ) ;
else req_argv = xcalloc ( 4 , sizeof ( char * ) ) ;
program = strrchr ( path , '/' ) ;
if ( program == NULL ) program = path ;
else program ++ ;
req_argv [ 0 ] = xstrdup ( program ) ;
req_argv [ 1 ] = xstrdup ( command ) ;
if ( subcommand == NULL ) req_argv [ 2 ] = NULL ;
else {
req_argv [ 2 ] = xstrdup ( subcommand ) ;
req_argv [ 3 ] = NULL ;
}
return req_argv ;
} |
-6,126,432,314,261,452,000 | debian | 4 | 0 | int gs_flushpage ( gs_gstate * pgs ) {
gx_device * dev = gs_currentdevice ( pgs ) ;
return ( * dev_proc ( dev , sync_output ) ) ( dev ) ;
} |
1,760,449,185,745,615,400 | debian | 5 | 0 | TSMimeParser TSMimeParserCreate ( void ) {
TSMimeParser parser = reinterpret_cast < TSMimeParser > ( ats_malloc ( sizeof ( MIMEParser ) ) ) ;
mime_parser_init ( ( MIMEParser * ) parser ) ;
return parser ;
} |
-6,231,193,035,097,910,000 | debian | 25 | 0 | int ASN1_BIT_STRING_set_bit ( ASN1_BIT_STRING * a , int n , int value ) {
int w , v , iv ;
unsigned char * c ;
w = n / 8 ;
v = 1 << ( 7 - ( n & 0x07 ) ) ;
iv = ~ v ;
if ( ! value ) v = 0 ;
if ( a == NULL ) return 0 ;
a -> flags &= ~ ( ASN1_STRING_FLAG_BITS_LEFT | 0x07 ) ;
if ( ( a -> length < ( w + 1 ) ) || ( a -> data == NULL ) ) {
if ( ! value ) return ( 1 ) ;
if ( a -> data == NULL ) c = ( unsigned char * ) OPENSSL_malloc ( w + 1 ) ;
else c = ( unsigned char * ) OPENSSL_realloc_clean ( a -> data , a -> length , w + 1 ) ;
if ( c == NULL ) {
ASN1err ( ASN1_F_ASN1_BIT_STRING_SET_BIT , ERR_R_MALLOC_FAILURE ) ;
return 0 ;
}
if ( w + 1 - a -> length > 0 ) memset ( c + a -> length , 0 , w + 1 - a -> length ) ;
a -> data = c ;
a -> length = w + 1 ;
}
a -> data [ w ] = ( ( a -> data [ w ] ) & iv ) | v ;
while ( ( a -> length > 0 ) && ( a -> data [ a -> length - 1 ] == 0 ) ) a -> length -- ;
return ( 1 ) ;
} |
-3,889,154,245,145,552,000 | debian | 8 | 0 | static uintmax_t parse_mark_ref_space ( const char * * p ) {
uintmax_t mark ;
char * end ;
mark = parse_mark_ref ( * p , & end ) ;
if ( * end ++ != ' ' ) die ( "Missing space after mark: %s" , command_buf . buf ) ;
* p = end ;
return mark ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | int dissect_h245_TransportAddress ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_choice ( tvb , offset , actx , tree , hf_index , ett_h245_TransportAddress , TransportAddress_choice , NULL ) ;
return offset ;
} |
-910,422,676,404,244,100 | debian | 8 | 0 | static inline void loco_update_rice_param ( RICEContext * r , int val ) {
r -> sum += val ;
r -> count ++ ;
if ( r -> count == 16 ) {
r -> sum >>= 1 ;
r -> count >>= 1 ;
}
} |
-2,504,372,172,279,755,000 | debian | 18 | 0 | static int mimic_decode_update_thread_context ( AVCodecContext * avctx , const AVCodecContext * avctx_from ) {
MimicContext * dst = avctx -> priv_data , * src = avctx_from -> priv_data ;
int i , ret ;
if ( avctx == avctx_from ) return 0 ;
dst -> cur_index = src -> next_cur_index ;
dst -> prev_index = src -> next_prev_index ;
memcpy ( dst -> flipped_ptrs , src -> flipped_ptrs , sizeof ( src -> flipped_ptrs ) ) ;
for ( i = 0 ;
i < FF_ARRAY_ELEMS ( dst -> frames ) ;
i ++ ) {
ff_thread_release_buffer ( avctx , & dst -> frames [ i ] ) ;
if ( src -> frames [ i ] . f -> data [ 0 ] ) {
ret = ff_thread_ref_frame ( & dst -> frames [ i ] , & src -> frames [ i ] ) ;
if ( ret < 0 ) return ret ;
}
}
return 0 ;
} |
-7,855,974,557,509,681,000 | debian | 12 | 0 | Oid get_range_subtype ( Oid rangeOid ) {
HeapTuple tp ;
tp = SearchSysCache1 ( RANGETYPE , ObjectIdGetDatum ( rangeOid ) ) ;
if ( HeapTupleIsValid ( tp ) ) {
Form_pg_range rngtup = ( Form_pg_range ) GETSTRUCT ( tp ) ;
Oid result ;
result = rngtup -> rngsubtype ;
ReleaseSysCache ( tp ) ;
return result ;
}
else return InvalidOid ;
} |
-6,024,601,983,167,899,000 | debian | 10 | 0 | static void cancel_activate_callback ( gpointer callback_data ) {
ActivateParameters * parameters = callback_data ;
parameters -> timed_wait_active = FALSE ;
g_cancellable_cancel ( parameters -> cancellable ) ;
if ( parameters -> files_handle ) {
nautilus_file_list_cancel_call_when_ready ( parameters -> files_handle ) ;
parameters -> files_handle = NULL ;
activation_parameters_free ( parameters ) ;
}
} |
6,667,142,528,452,942,000 | debian | 14 | 0 | static char * getTableName ( int reset ) {
static MYSQL_RES * res = NULL ;
MYSQL_ROW row ;
if ( ! res ) {
if ( ! ( res = mysql_list_tables ( mysql , NullS ) ) ) return ( NULL ) ;
}
if ( ( row = mysql_fetch_row ( res ) ) ) return ( ( char * ) row [ 0 ] ) ;
if ( reset ) mysql_data_seek ( res , 0 ) ;
else {
mysql_free_result ( res ) ;
res = NULL ;
}
return ( NULL ) ;
} |
-398,565,394,354,770,750 | debian | 6 | 0 | static void ohci_async_cancel_device ( OHCIState * ohci , USBDevice * dev ) {
if ( ohci -> async_td && usb_packet_is_inflight ( & ohci -> usb_packet ) && ohci -> usb_packet . ep -> dev == dev ) {
usb_cancel_packet ( & ohci -> usb_packet ) ;
ohci -> async_td = 0 ;
}
} |
1,223,258,652,239,369,200 | debian | 10 | 1 | SPL_METHOD ( SplFileObject , fgets ) {
spl_filesystem_object * intern = ( spl_filesystem_object * ) zend_object_store_get_object ( getThis ( ) TSRMLS_CC ) ;
if ( zend_parse_parameters_none ( ) == FAILURE ) {
return ;
}
if ( spl_filesystem_file_read ( intern , 0 TSRMLS_CC ) == FAILURE ) {
RETURN_FALSE ;
}
RETURN_STRINGL ( intern -> u . file . current_line , intern -> u . file . current_line_len , 1 ) ;
} |
-6,704,066,512,670,389,000 | debian | 13 | 0 | static int lookup_uname_helper ( struct cpio * cpio , const char * * name , id_t id ) {
struct passwd * pwent ;
( void ) cpio ;
errno = 0 ;
pwent = getpwuid ( ( uid_t ) id ) ;
if ( pwent == NULL ) {
* name = NULL ;
if ( errno != 0 && errno != ENOENT ) lafe_warnc ( errno , "getpwuid(%s) failed" , cpio_i64toa ( ( int64_t ) id ) ) ;
return ( errno ) ;
}
* name = pwent -> pw_name ;
return ( 0 ) ;
} |
9,118,387,177,353,442,000 | debian | 42 | 0 | void web_server_callback ( http_parser_t * parser , INOUT http_message_t * req , SOCKINFO * info ) {
int ret ;
int timeout = - 1 ;
enum resp_type rtype = 0 ;
membuffer headers ;
membuffer filename ;
struct xml_alias_t xmldoc ;
struct SendInstruction RespInstr ;
RespInstr . IsVirtualFile = 0 ;
RespInstr . IsChunkActive = 0 ;
RespInstr . IsRangeActive = 0 ;
RespInstr . IsTrailers = 0 ;
memset ( RespInstr . AcceptLanguageHeader , 0 , sizeof ( RespInstr . AcceptLanguageHeader ) ) ;
membuffer_init ( & headers ) ;
membuffer_init ( & filename ) ;
ret = process_request ( req , & rtype , & headers , & filename , & xmldoc , & RespInstr ) ;
if ( ret != HTTP_OK ) {
http_SendStatusResponse ( info , ret , req -> major_version , req -> minor_version ) ;
}
else {
switch ( rtype ) {
case RESP_FILEDOC : http_SendMessage ( info , & timeout , "Ibf" , & RespInstr , headers . buf , headers . length , filename . buf ) ;
break ;
case RESP_XMLDOC : http_SendMessage ( info , & timeout , "Ibb" , & RespInstr , headers . buf , headers . length , xmldoc . doc . buf , xmldoc . doc . length ) ;
alias_release ( & xmldoc ) ;
break ;
case RESP_WEBDOC : http_SendMessage ( info , & timeout , "Ibf" , & RespInstr , headers . buf , headers . length , filename . buf ) ;
break ;
case RESP_HEADERS : http_SendMessage ( info , & timeout , "b" , headers . buf , headers . length ) ;
break ;
case RESP_POST : ret = http_RecvPostMessage ( parser , info , filename . buf , & RespInstr ) ;
http_MakeMessage ( & headers , 1 , 1 , "RTLSXcCc" , ret , "text/html" , & RespInstr , X_USER_AGENT ) ;
http_SendMessage ( info , & timeout , "b" , headers . buf , headers . length ) ;
break ;
default : UpnpPrintf ( UPNP_INFO , HTTP , __FILE__ , __LINE__ , "webserver: Invalid response type received.\n" ) ;
assert ( 0 ) ;
}
}
UpnpPrintf ( UPNP_INFO , HTTP , __FILE__ , __LINE__ , "webserver: request processed...\n" ) ;
membuffer_destroy ( & headers ) ;
membuffer_destroy ( & filename ) ;
} |
-341,028,540,041,678,100 | debian | 17 | 0 | static u_long getkeyid ( const char * keyprompt ) {
int c ;
FILE * fi ;
char pbuf [ 20 ] ;
size_t i ;
size_t ilim ;
# ifndef SYS_WINNT if ( ( fi = fdopen ( open ( "/dev/tty" , 2 ) , "r" ) ) == NULL ) # else if ( ( fi = _fdopen ( open ( "CONIN$" , _O_TEXT ) , "r" ) ) == NULL ) # endif fi = stdin ;
else setbuf ( fi , ( char * ) NULL ) ;
fprintf ( stderr , "%s" , keyprompt ) ;
fflush ( stderr ) ;
for ( i = 0 , ilim = COUNTOF ( pbuf ) - 1 ;
i < ilim && ( c = getc ( fi ) ) != '\n' && c != EOF ;
) pbuf [ i ++ ] = ( char ) c ;
pbuf [ i ] = '\0' ;
if ( fi != stdin ) fclose ( fi ) ;
return ( u_long ) atoi ( pbuf ) ;
} |
5,045,872,831,385,413,000 | debian | 27 | 0 | static bluetooth_uuid_t get_service_uuid_from_handle ( packet_info * pinfo , guint32 handle , bluetooth_data_t * bluetooth_data ) {
wmem_tree_key_t key [ 4 ] ;
guint32 frame_number ;
handle_data_t * handle_data ;
wmem_tree_t * sub_wmemtree ;
bluetooth_uuid_t uuid ;
memset ( & uuid , 0 , sizeof uuid ) ;
frame_number = pinfo -> num ;
key [ 0 ] . length = 1 ;
key [ 0 ] . key = & bluetooth_data -> interface_id ;
key [ 1 ] . length = 1 ;
key [ 1 ] . key = & bluetooth_data -> adapter_id ;
key [ 2 ] . length = 1 ;
key [ 2 ] . key = & handle ;
key [ 3 ] . length = 0 ;
key [ 3 ] . key = NULL ;
while ( handle > 0 ) {
sub_wmemtree = ( wmem_tree_t * ) wmem_tree_lookup32_array ( handle_to_uuid , key ) ;
handle_data = ( sub_wmemtree ) ? ( handle_data_t * ) wmem_tree_lookup32_le ( sub_wmemtree , frame_number ) : NULL ;
if ( handle_data && handle_data -> type == ATTRIBUTE_TYPE_SERVICE ) {
uuid = handle_data -> uuid ;
return uuid ;
}
handle -= 1 ;
}
return uuid ;
} |
-2,928,324,134,072,492,500 | debian | 54 | 0 | static int iax2_calls_packet ( void * ptr _U_ , packet_info * pinfo , epan_dissect_t * edt _U_ , const void * iax2_info ) {
voip_calls_tapinfo_t * tapinfo = & the_tapinfo_struct ;
GList * list ;
voip_calls_info_t * callsinfo = NULL ;
address * phone ;
const iax2_info_t * ii = ( const iax2_info_t * ) iax2_info ;
iax2_info_t * tmp_iax2info ;
if ( ii == NULL || ii -> ptype != IAX2_FULL_PACKET || ( ii -> scallno == 0 && ii -> dcallno == 0 ) ) return 0 ;
list = g_list_first ( tapinfo -> callsinfo_list ) ;
while ( list ) {
voip_calls_info_t * tmp_listinfo = ( voip_calls_info_t * ) list -> data ;
if ( tmp_listinfo -> protocol == VOIP_IAX2 ) {
tmp_iax2info = ( iax2_info_t * ) tmp_listinfo -> prot_info ;
if ( tmp_iax2info -> scallno == ii -> scallno || tmp_iax2info -> scallno == ii -> dcallno ) {
callsinfo = ( voip_calls_info_t * ) ( list -> data ) ;
break ;
}
}
list = g_list_next ( list ) ;
}
phone = & ( pinfo -> src ) ;
if ( callsinfo == NULL ) {
if ( ii -> ftype != AST_FRAME_IAX || ii -> csub != IAX_COMMAND_NEW ) return 0 ;
callsinfo = ( voip_calls_info_t * ) g_malloc0 ( sizeof ( voip_calls_info_t ) ) ;
callsinfo -> call_state = VOIP_NO_STATE ;
callsinfo -> call_active_state = VOIP_ACTIVE ;
callsinfo -> prot_info = g_malloc ( sizeof ( iax2_info_t ) ) ;
callsinfo -> free_prot_info = free_iax2_info ;
tmp_iax2info = ( iax2_info_t * ) callsinfo -> prot_info ;
tmp_iax2info -> scallno = ii -> scallno ;
if ( tmp_iax2info -> scallno == 0 ) tmp_iax2info -> scallno = ii -> dcallno ;
tmp_iax2info -> callState = ii -> callState ;
callsinfo -> npackets = 1 ;
COPY_ADDRESS ( & ( callsinfo -> initial_speaker ) , phone ) ;
callsinfo -> from_identity = g_strdup ( ii -> callingParty ) ;
callsinfo -> to_identity = g_strdup ( ii -> calledParty ) ;
callsinfo -> protocol = VOIP_IAX2 ;
callsinfo -> call_num = tapinfo -> ncalls ++ ;
callsinfo -> start_fd = pinfo -> fd ;
callsinfo -> start_rel_ts = pinfo -> rel_ts ;
callsinfo -> stop_fd = pinfo -> fd ;
callsinfo -> stop_rel_ts = pinfo -> rel_ts ;
callsinfo -> selected = FALSE ;
tapinfo -> callsinfo_list = g_list_prepend ( tapinfo -> callsinfo_list , callsinfo ) ;
}
else {
callsinfo -> call_state = ii -> callState ;
callsinfo -> stop_fd = pinfo -> fd ;
callsinfo -> stop_rel_ts = pinfo -> rel_ts ;
++ ( callsinfo -> npackets ) ;
}
add_to_graph ( tapinfo , pinfo , ii -> messageName , "" , callsinfo -> call_num , & ( pinfo -> src ) , & ( pinfo -> dst ) , 1 ) ;
return 1 ;
} |
-7,670,127,399,145,951,000 | debian | 4 | 0 | op_array_table * get_op_array ( const gs_memory_t * mem , int size ) {
gs_main_instance * minst = get_minst_from_memory ( mem ) ;
return op_index_op_array_table ( minst -> i_ctx_p , size ) ;
} |
8,445,816,931,248,660,000 | debian | 18 | 0 | static void spl_ptr_llist_unshift ( spl_ptr_llist * llist , void * data TSRMLS_DC ) {
spl_ptr_llist_element * elem = emalloc ( sizeof ( spl_ptr_llist_element ) ) ;
elem -> data = data ;
elem -> rc = 1 ;
elem -> prev = NULL ;
elem -> next = llist -> head ;
if ( llist -> head ) {
llist -> head -> prev = elem ;
}
else {
llist -> tail = elem ;
}
llist -> head = elem ;
llist -> count ++ ;
if ( llist -> ctor ) {
llist -> ctor ( elem TSRMLS_CC ) ;
}
} |
-4,960,438,251,319,819,000 | chrome | 10 | 0 | static void set_first_pass_params ( VP9_COMP * cpi ) {
VP9_COMMON * const cm = & cpi -> common ;
if ( ! cpi -> refresh_alt_ref_frame && ( cm -> current_video_frame == 0 || ( cpi -> frame_flags & FRAMEFLAGS_KEY ) ) ) {
cm -> frame_type = KEY_FRAME ;
}
else {
cm -> frame_type = INTER_FRAME ;
}
cpi -> rc . frames_to_key = INT_MAX ;
} |
7,549,435,794,356,072,000 | debian | 4 | 0 | static VALUE ossl_asn1_ ## klass ( int argc , VALUE * argv , VALUE self ) \ {
return rb_funcall3 ( cASN1 ## klass , rb_intern ( "new" ) , argc , argv ) ;
}
OSSL_ASN1_IMPL_FACTORY_METHOD ( Boolean ) OSSL_ASN1_IMPL_FACTORY_METHOD ( Integer ) OSSL_ASN1_IMPL_FACTORY_METHOD ( Enumerated ) OSSL_ASN1_IMPL_FACTORY_METHOD ( BitString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( OctetString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( UTF8String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( NumericString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( PrintableString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( T61String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( VideotexString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( IA5String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( GraphicString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( ISO64String ) |
-938,099,838,013,462,900 | debian | 4 | 0 | static void parse_context_init ( SchroParseUnitContext * parse_ctx , const uint8_t * buf , int buf_size ) {
parse_ctx -> buf = buf ;
parse_ctx -> buf_size = buf_size ;
} |
8,849,962,823,026,424,000 | debian | 11 | 1 | static gboolean qio_channel_websock_source_check ( GSource * source ) {
QIOChannelWebsockSource * wsource = ( QIOChannelWebsockSource * ) source ;
GIOCondition cond = 0 ;
if ( wsource -> wioc -> rawinput . offset || wsource -> wioc -> io_eof ) {
cond |= G_IO_IN ;
}
if ( wsource -> wioc -> rawoutput . offset < QIO_CHANNEL_WEBSOCK_MAX_BUFFER ) {
cond |= G_IO_OUT ;
}
return cond & wsource -> condition ;
} |
-6,107,005,761,225,945,000 | debian | 5 | 0 | static int php_is_file_ok ( const cwd_state * state ) {
struct stat buf ;
if ( php_sys_stat ( state -> cwd , & buf ) == 0 && S_ISREG ( buf . st_mode ) ) return ( 0 ) ;
return ( 1 ) ;
} |
-1,711,362,334,384,181,200 | chrome | 40 | 0 | const hb_shaper_pair_t * _hb_shapers_get ( void ) {
retry : hb_shaper_pair_t * shapers = ( hb_shaper_pair_t * ) hb_atomic_ptr_get ( & static_shapers ) ;
if ( unlikely ( ! shapers ) ) {
char * env = getenv ( "HB_SHAPER_LIST" ) ;
if ( ! env || ! * env ) {
( void ) hb_atomic_ptr_cmpexch ( & static_shapers , NULL , & all_shapers [ 0 ] ) ;
return ( const hb_shaper_pair_t * ) all_shapers ;
}
shapers = ( hb_shaper_pair_t * ) malloc ( sizeof ( all_shapers ) ) ;
if ( unlikely ( ! shapers ) ) {
( void ) hb_atomic_ptr_cmpexch ( & static_shapers , NULL , & all_shapers [ 0 ] ) ;
return ( const hb_shaper_pair_t * ) all_shapers ;
}
memcpy ( shapers , all_shapers , sizeof ( all_shapers ) ) ;
unsigned int i = 0 ;
char * end , * p = env ;
for ( ;
;
) {
end = strchr ( p , ',' ) ;
if ( ! end ) end = p + strlen ( p ) ;
for ( unsigned int j = i ;
j < ARRAY_LENGTH ( all_shapers ) ;
j ++ ) if ( end - p == ( int ) strlen ( shapers [ j ] . name ) && == strncmp ( shapers [ j ] . name , p , end - p ) ) {
struct hb_shaper_pair_t t = shapers [ j ] ;
memmove ( & shapers [ i + 1 ] , & shapers [ i ] , sizeof ( shapers [ i ] ) * ( j - i ) ) ;
shapers [ i ] = t ;
i ++ ;
}
if ( ! * end ) break ;
else p = end + 1 ;
}
if ( ! hb_atomic_ptr_cmpexch ( & static_shapers , NULL , shapers ) ) {
free ( shapers ) ;
goto retry ;
}
# ifdef HB_USE_ATEXIT atexit ( free_static_shapers ) ;
# endif }
return shapers ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_OCTET_STRING_SIZE_16 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_octet_string ( tvb , offset , actx , tree , hf_index , 16 , 16 , FALSE , NULL ) ;
return offset ;
} |
8,461,782,184,979,846,000 | chrome | 21 | 0 | TEST_F ( ProtocolHandlerRegistryTest , TestSilentlyRegisterHandler ) {
ProtocolHandler ph1 = CreateProtocolHandler ( "test" , GURL ( "http://test/1/%s" ) ) ;
ProtocolHandler ph2 = CreateProtocolHandler ( "test" , GURL ( "http://test/2/%s" ) ) ;
ProtocolHandler ph3 = CreateProtocolHandler ( "ignore" , GURL ( "http://test/%s" ) ) ;
ProtocolHandler ph4 = CreateProtocolHandler ( "ignore" , GURL ( "http://test/%s" ) ) ;
ASSERT_FALSE ( registry ( ) -> SilentlyHandleRegisterHandlerRequest ( ph1 ) ) ;
ASSERT_FALSE ( registry ( ) -> IsRegistered ( ph1 ) ) ;
registry ( ) -> OnAcceptRegisterProtocolHandler ( ph1 ) ;
ASSERT_TRUE ( registry ( ) -> IsRegistered ( ph1 ) ) ;
ASSERT_TRUE ( registry ( ) -> SilentlyHandleRegisterHandlerRequest ( ph2 ) ) ;
ASSERT_FALSE ( registry ( ) -> IsRegistered ( ph1 ) ) ;
ASSERT_TRUE ( registry ( ) -> IsRegistered ( ph2 ) ) ;
ASSERT_FALSE ( registry ( ) -> SilentlyHandleRegisterHandlerRequest ( ph3 ) ) ;
ASSERT_FALSE ( registry ( ) -> IsRegistered ( ph3 ) ) ;
registry ( ) -> OnIgnoreRegisterProtocolHandler ( ph3 ) ;
ASSERT_FALSE ( registry ( ) -> IsRegistered ( ph3 ) ) ;
ASSERT_TRUE ( registry ( ) -> IsIgnored ( ph3 ) ) ;
ASSERT_TRUE ( registry ( ) -> SilentlyHandleRegisterHandlerRequest ( ph4 ) ) ;
ASSERT_FALSE ( registry ( ) -> IsRegistered ( ph4 ) ) ;
ASSERT_TRUE ( registry ( ) -> HasIgnoredEquivalent ( ph4 ) ) ;
} |
8,693,230,691,624,197,000 | chrome | 13 | 0 | IN_PROC_BROWSER_TEST_F ( ExtensionPreferenceApiTest , OnChangeSplitWithNoOTRProfile ) {
PrefService * prefs = profile_ -> GetPrefs ( ) ;
prefs -> SetBoolean ( prefs : : kBlockThirdPartyCookies , true ) ;
extensions : : ResultCatcher catcher ;
ExtensionTestMessageListener loaded_incognito_test_listener ( "incognito loaded" , false ) ;
ExtensionTestMessageListener change_pref_listener ( "change pref value" , false ) ;
ASSERT_TRUE ( LoadExtensionIncognito ( test_data_dir_ . AppendASCII ( "preference" ) . AppendASCII ( "onchange_split_regular_only" ) ) ) ;
ASSERT_TRUE ( change_pref_listener . WaitUntilSatisfied ( ) ) ;
prefs -> SetBoolean ( prefs : : kBlockThirdPartyCookies , false ) ;
EXPECT_TRUE ( catcher . GetNextResult ( ) ) << catcher . message ( ) ;
EXPECT_FALSE ( loaded_incognito_test_listener . was_satisfied ( ) ) ;
EXPECT_FALSE ( profile_ -> HasOffTheRecordProfile ( ) ) ;
} |
5,357,882,892,791,796,000 | debian | 11 | 0 | static inline uint32_t e1000e_ring_free_descr_num ( E1000ECore * core , const E1000E_RingInfo * r ) {
trace_e1000e_ring_free_space ( r -> idx , core -> mac [ r -> dlen ] , core -> mac [ r -> dh ] , core -> mac [ r -> dt ] ) ;
if ( core -> mac [ r -> dh ] <= core -> mac [ r -> dt ] ) {
return core -> mac [ r -> dt ] - core -> mac [ r -> dh ] ;
}
if ( core -> mac [ r -> dh ] > core -> mac [ r -> dt ] ) {
return core -> mac [ r -> dlen ] / E1000_RING_DESC_LEN + core -> mac [ r -> dt ] - core -> mac [ r -> dh ] ;
}
g_assert_not_reached ( ) ;
return 0 ;
} |
-3,740,862,514,502,467,000 | debian | 18 | 0 | static FILE * checkdupstoredtable ( SplineFont * sf , uint32 tag , int * len , struct alltabs * all , int me ) {
int i ;
struct ttf_table * tab = SFFindTable ( sf , tag ) , * test ;
if ( tab == NULL ) {
* len = 0 ;
return ( NULL ) ;
}
for ( i = 0 ;
i < me ;
++ i ) {
test = SFFindTable ( all [ i ] . sf , tag ) ;
if ( test != NULL && test -> len == tab -> len && memcmp ( test -> data , tab -> data , tab -> len ) == 0 ) {
* len = i ;
return ( ( FILE * ) ( intpt ) - 1 ) ;
}
}
return ( dumpstoredtable ( sf , tag , len ) ) ;
} |
7,037,573,792,123,851,000 | debian | 3 | 0 | static PHP_NAMED_FUNCTION ( zif_zip_entry_compressionmethod ) {
php_zip_entry_get_info ( INTERNAL_FUNCTION_PARAM_PASSTHRU , 3 ) ;
} |
-2,723,830,976,796,502,500 | chrome | 5 | 0 | static vpx_codec_err_t ctrl_set_noise_sensitivity ( vpx_codec_alg_priv_t * ctx , va_list args ) {
struct vp9_extracfg extra_cfg = ctx -> extra_cfg ;
extra_cfg . noise_sensitivity = CAST ( VP9E_SET_NOISE_SENSITIVITY , args ) ;
return update_extra_cfg ( ctx , & extra_cfg ) ;
} |
-2,943,582,541,244,388,000 | chrome | 36 | 0 | unsigned int vp9_sub_pixel_avg_variance ## W ## x ## H ## _c ( const uint8_t * src , int src_stride , int xoffset , int yoffset , const uint8_t * dst , int dst_stride , unsigned int * sse , const uint8_t * second_pred ) {
uint16_t fdata3 [ ( H + 1 ) * W ] ;
uint8_t temp2 [ H * W ] ;
DECLARE_ALIGNED_ARRAY ( 16 , uint8_t , temp3 , H * W ) ;
var_filter_block2d_bil_first_pass ( src , fdata3 , src_stride , 1 , H + 1 , W , BILINEAR_FILTERS_2TAP ( xoffset ) ) ;
var_filter_block2d_bil_second_pass ( fdata3 , temp2 , W , W , H , W , BILINEAR_FILTERS_2TAP ( yoffset ) ) ;
vp9_comp_avg_pred ( temp3 , second_pred , W , H , temp2 , W ) ;
return vp9_variance ## W ## x ## H ## _c ( temp3 , W , dst , dst_stride , sse ) ;
\ }
void vp9_get16x16var_c ( const uint8_t * src_ptr , int source_stride , const uint8_t * ref_ptr , int ref_stride , unsigned int * sse , int * sum ) {
variance ( src_ptr , source_stride , ref_ptr , ref_stride , 16 , 16 , sse , sum ) ;
}
void vp9_get8x8var_c ( const uint8_t * src_ptr , int source_stride , const uint8_t * ref_ptr , int ref_stride , unsigned int * sse , int * sum ) {
variance ( src_ptr , source_stride , ref_ptr , ref_stride , 8 , 8 , sse , sum ) ;
}
unsigned int vp9_mse16x16_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 16 , 16 , sse , & sum ) ;
return * sse ;
}
unsigned int vp9_mse16x8_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 16 , 8 , sse , & sum ) ;
return * sse ;
}
unsigned int vp9_mse8x16_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 8 , 16 , sse , & sum ) ;
return * sse ;
}
unsigned int vp9_mse8x8_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 8 , 8 , sse , & sum ) ;
return * sse ;
}
VAR ( 4 , 4 ) SUBPIX_VAR ( 4 , 4 ) SUBPIX_AVG_VAR ( 4 , 4 ) VAR ( 4 , 8 ) SUBPIX_VAR ( 4 , 8 ) SUBPIX_AVG_VAR ( 4 , 8 ) VAR ( 8 , 4 ) SUBPIX_VAR ( 8 , 4 ) SUBPIX_AVG_VAR ( 8 , 4 ) VAR ( 8 , 8 ) SUBPIX_VAR ( 8 , 8 ) SUBPIX_AVG_VAR ( 8 , 8 ) |
6,030,508,190,585,699,000 | debian | 236 | 1 | static int flic_decode_frame_8BPP ( AVCodecContext * avctx , void * data , int * got_frame , const uint8_t * buf , int buf_size ) {
FlicDecodeContext * s = avctx -> priv_data ;
GetByteContext g2 ;
int stream_ptr_after_color_chunk ;
int pixel_ptr ;
int palette_ptr ;
unsigned char palette_idx1 ;
unsigned char palette_idx2 ;
unsigned int frame_size ;
int num_chunks ;
unsigned int chunk_size ;
int chunk_type ;
int i , j , ret ;
int color_packets ;
int color_changes ;
int color_shift ;
unsigned char r , g , b ;
int lines ;
int compressed_lines ;
int starting_line ;
signed short line_packets ;
int y_ptr ;
int byte_run ;
int pixel_skip ;
int pixel_countdown ;
unsigned char * pixels ;
unsigned int pixel_limit ;
bytestream2_init ( & g2 , buf , buf_size ) ;
s -> frame . reference = 1 ;
s -> frame . buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE ;
if ( ( ret = avctx -> reget_buffer ( avctx , & s -> frame ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "reget_buffer() failed\n" ) ;
return ret ;
}
pixels = s -> frame . data [ 0 ] ;
pixel_limit = s -> avctx -> height * s -> frame . linesize [ 0 ] ;
frame_size = bytestream2_get_le32 ( & g2 ) ;
bytestream2_skip ( & g2 , 2 ) ;
num_chunks = bytestream2_get_le16 ( & g2 ) ;
bytestream2_skip ( & g2 , 8 ) ;
frame_size -= 16 ;
while ( ( frame_size > 0 ) && ( num_chunks > 0 ) ) {
chunk_size = bytestream2_get_le32 ( & g2 ) ;
chunk_type = bytestream2_get_le16 ( & g2 ) ;
switch ( chunk_type ) {
case FLI_256_COLOR : case FLI_COLOR : stream_ptr_after_color_chunk = bytestream2_tell ( & g2 ) + chunk_size - 6 ;
if ( ( chunk_type == FLI_256_COLOR ) && ( s -> fli_type != FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE ) ) color_shift = 0 ;
else color_shift = 2 ;
color_packets = bytestream2_get_le16 ( & g2 ) ;
palette_ptr = 0 ;
for ( i = 0 ;
i < color_packets ;
i ++ ) {
palette_ptr += bytestream2_get_byte ( & g2 ) ;
color_changes = bytestream2_get_byte ( & g2 ) ;
if ( color_changes == 0 ) color_changes = 256 ;
for ( j = 0 ;
j < color_changes ;
j ++ ) {
unsigned int entry ;
if ( ( unsigned ) palette_ptr >= 256 ) palette_ptr = 0 ;
r = bytestream2_get_byte ( & g2 ) << color_shift ;
g = bytestream2_get_byte ( & g2 ) << color_shift ;
b = bytestream2_get_byte ( & g2 ) << color_shift ;
entry = ( r << 16 ) | ( g << 8 ) | b ;
if ( s -> palette [ palette_ptr ] != entry ) s -> new_palette = 1 ;
s -> palette [ palette_ptr ++ ] = entry ;
}
}
if ( stream_ptr_after_color_chunk - bytestream2_tell ( & g2 ) > 0 ) bytestream2_skip ( & g2 , stream_ptr_after_color_chunk - bytestream2_tell ( & g2 ) ) ;
break ;
case FLI_DELTA : y_ptr = 0 ;
compressed_lines = bytestream2_get_le16 ( & g2 ) ;
while ( compressed_lines > 0 ) {
line_packets = bytestream2_get_le16 ( & g2 ) ;
if ( ( line_packets & 0xC000 ) == 0xC000 ) {
line_packets = - line_packets ;
y_ptr += line_packets * s -> frame . linesize [ 0 ] ;
}
else if ( ( line_packets & 0xC000 ) == 0x4000 ) {
av_log ( avctx , AV_LOG_ERROR , "Undefined opcode (%x) in DELTA_FLI\n" , line_packets ) ;
}
else if ( ( line_packets & 0xC000 ) == 0x8000 ) {
pixel_ptr = y_ptr + s -> frame . linesize [ 0 ] - 1 ;
CHECK_PIXEL_PTR ( 0 ) ;
pixels [ pixel_ptr ] = line_packets & 0xff ;
}
else {
compressed_lines -- ;
pixel_ptr = y_ptr ;
CHECK_PIXEL_PTR ( 0 ) ;
pixel_countdown = s -> avctx -> width ;
for ( i = 0 ;
i < line_packets ;
i ++ ) {
pixel_skip = bytestream2_get_byte ( & g2 ) ;
pixel_ptr += pixel_skip ;
pixel_countdown -= pixel_skip ;
byte_run = sign_extend ( bytestream2_get_byte ( & g2 ) , 8 ) ;
if ( byte_run < 0 ) {
byte_run = - byte_run ;
palette_idx1 = bytestream2_get_byte ( & g2 ) ;
palette_idx2 = bytestream2_get_byte ( & g2 ) ;
CHECK_PIXEL_PTR ( byte_run * 2 ) ;
for ( j = 0 ;
j < byte_run ;
j ++ , pixel_countdown -= 2 ) {
pixels [ pixel_ptr ++ ] = palette_idx1 ;
pixels [ pixel_ptr ++ ] = palette_idx2 ;
}
}
else {
CHECK_PIXEL_PTR ( byte_run * 2 ) ;
for ( j = 0 ;
j < byte_run * 2 ;
j ++ , pixel_countdown -- ) {
pixels [ pixel_ptr ++ ] = bytestream2_get_byte ( & g2 ) ;
}
}
}
y_ptr += s -> frame . linesize [ 0 ] ;
}
}
break ;
case FLI_LC : starting_line = bytestream2_get_le16 ( & g2 ) ;
y_ptr = 0 ;
y_ptr += starting_line * s -> frame . linesize [ 0 ] ;
compressed_lines = bytestream2_get_le16 ( & g2 ) ;
while ( compressed_lines > 0 ) {
pixel_ptr = y_ptr ;
CHECK_PIXEL_PTR ( 0 ) ;
pixel_countdown = s -> avctx -> width ;
line_packets = bytestream2_get_byte ( & g2 ) ;
if ( line_packets > 0 ) {
for ( i = 0 ;
i < line_packets ;
i ++ ) {
pixel_skip = bytestream2_get_byte ( & g2 ) ;
pixel_ptr += pixel_skip ;
pixel_countdown -= pixel_skip ;
byte_run = sign_extend ( bytestream2_get_byte ( & g2 ) , 8 ) ;
if ( byte_run > 0 ) {
CHECK_PIXEL_PTR ( byte_run ) ;
for ( j = 0 ;
j < byte_run ;
j ++ , pixel_countdown -- ) {
pixels [ pixel_ptr ++ ] = bytestream2_get_byte ( & g2 ) ;
}
}
else if ( byte_run < 0 ) {
byte_run = - byte_run ;
palette_idx1 = bytestream2_get_byte ( & g2 ) ;
CHECK_PIXEL_PTR ( byte_run ) ;
for ( j = 0 ;
j < byte_run ;
j ++ , pixel_countdown -- ) {
pixels [ pixel_ptr ++ ] = palette_idx1 ;
}
}
}
}
y_ptr += s -> frame . linesize [ 0 ] ;
compressed_lines -- ;
}
break ;
case FLI_BLACK : memset ( pixels , 0 , s -> frame . linesize [ 0 ] * s -> avctx -> height ) ;
break ;
case FLI_BRUN : y_ptr = 0 ;
for ( lines = 0 ;
lines < s -> avctx -> height ;
lines ++ ) {
pixel_ptr = y_ptr ;
bytestream2_skip ( & g2 , 1 ) ;
pixel_countdown = s -> avctx -> width ;
while ( pixel_countdown > 0 ) {
byte_run = sign_extend ( bytestream2_get_byte ( & g2 ) , 8 ) ;
if ( ! byte_run ) {
av_log ( avctx , AV_LOG_ERROR , "Invalid byte run value.\n" ) ;
return AVERROR_INVALIDDATA ;
}
if ( byte_run > 0 ) {
palette_idx1 = bytestream2_get_byte ( & g2 ) ;
CHECK_PIXEL_PTR ( byte_run ) ;
for ( j = 0 ;
j < byte_run ;
j ++ ) {
pixels [ pixel_ptr ++ ] = palette_idx1 ;
pixel_countdown -- ;
if ( pixel_countdown < 0 ) av_log ( avctx , AV_LOG_ERROR , "pixel_countdown < 0 (%d) at line %d\n" , pixel_countdown , lines ) ;
}
}
else {
byte_run = - byte_run ;
CHECK_PIXEL_PTR ( byte_run ) ;
for ( j = 0 ;
j < byte_run ;
j ++ ) {
pixels [ pixel_ptr ++ ] = bytestream2_get_byte ( & g2 ) ;
pixel_countdown -- ;
if ( pixel_countdown < 0 ) av_log ( avctx , AV_LOG_ERROR , "pixel_countdown < 0 (%d) at line %d\n" , pixel_countdown , lines ) ;
}
}
}
y_ptr += s -> frame . linesize [ 0 ] ;
}
break ;
case FLI_COPY : if ( chunk_size - 6 > s -> avctx -> width * s -> avctx -> height ) {
av_log ( avctx , AV_LOG_ERROR , "In chunk FLI_COPY : source data (%d bytes) " \ "bigger than image, skipping chunk\n" , chunk_size - 6 ) ;
bytestream2_skip ( & g2 , chunk_size - 6 ) ;
}
else {
for ( y_ptr = 0 ;
y_ptr < s -> frame . linesize [ 0 ] * s -> avctx -> height ;
y_ptr += s -> frame . linesize [ 0 ] ) {
bytestream2_get_buffer ( & g2 , & pixels [ y_ptr ] , s -> avctx -> width ) ;
}
}
break ;
case FLI_MINI : bytestream2_skip ( & g2 , chunk_size - 6 ) ;
break ;
default : av_log ( avctx , AV_LOG_ERROR , "Unrecognized chunk type: %d\n" , chunk_type ) ;
break ;
}
frame_size -= chunk_size ;
num_chunks -- ;
}
if ( ( bytestream2_get_bytes_left ( & g2 ) != 0 ) && ( bytestream2_get_bytes_left ( & g2 ) != 1 ) ) av_log ( avctx , AV_LOG_ERROR , "Processed FLI chunk where chunk size = %d " \ "and final chunk ptr = %d\n" , buf_size , buf_size - bytestream2_get_bytes_left ( & g2 ) ) ;
memcpy ( s -> frame . data [ 1 ] , s -> palette , AVPALETTE_SIZE ) ;
if ( s -> new_palette ) {
s -> frame . palette_has_changed = 1 ;
s -> new_palette = 0 ;
}
* got_frame = 1 ;
* ( AVFrame * ) data = s -> frame ;
return buf_size ;
} |
1,760,449,185,745,615,400 | debian | 3 | 0 | const char * TSRedirectUrlGet ( TSHttpTxn txnp , int * url_len_ptr ) {
return TSHttpTxnRedirectUrlGet ( txnp , url_len_ptr ) ;
} |
3,599,206,110,384,554,500 | debian | 27 | 0 | int PEM_write_bio_ ## name ( BIO * bp , type * x ) ;
# define DECLARE_PEM_write_bio_const ( name , type ) int PEM_write_bio_ ## name ( BIO * bp , const type * x ) ;
# define DECLARE_PEM_write_cb_bio ( name , type ) int PEM_write_bio_ ## name ( BIO * bp , type * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cb , void * u ) ;
# define DECLARE_PEM_write ( name , type ) DECLARE_PEM_write_bio ( name , type ) DECLARE_PEM_write_fp ( name , type ) # define DECLARE_PEM_write_const ( name , type ) DECLARE_PEM_write_bio_const ( name , type ) DECLARE_PEM_write_fp_const ( name , type ) # define DECLARE_PEM_write_cb ( name , type ) DECLARE_PEM_write_cb_bio ( name , type ) DECLARE_PEM_write_cb_fp ( name , type ) # define DECLARE_PEM_read ( name , type ) DECLARE_PEM_read_bio ( name , type ) DECLARE_PEM_read_fp ( name , type ) # define DECLARE_PEM_rw ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write ( name , type ) # define DECLARE_PEM_rw_const ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write_const ( name , type ) # define DECLARE_PEM_rw_cb ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write_cb ( name , type ) typedef int pem_password_cb ( char * buf , int size , int rwflag , void * userdata ) ;
int PEM_get_EVP_CIPHER_INFO ( char * header , EVP_CIPHER_INFO * cipher ) ;
int PEM_do_header ( EVP_CIPHER_INFO * cipher , unsigned char * data , long * len , pem_password_cb * callback , void * u ) ;
int PEM_read_bio ( BIO * bp , char * * name , char * * header , unsigned char * * data , long * len ) ;
# define PEM_FLAG_SECURE 0x1 # define PEM_FLAG_EAY_COMPATIBLE 0x2 # define PEM_FLAG_ONLY_B64 0x4 int PEM_read_bio_ex ( BIO * bp , char * * name , char * * header , unsigned char * * data , long * len , unsigned int flags ) ;
int PEM_bytes_read_bio_secmem ( unsigned char * * pdata , long * plen , char * * pnm , const char * name , BIO * bp , pem_password_cb * cb , void * u ) ;
int PEM_write_bio ( BIO * bp , const char * name , const char * hdr , const unsigned char * data , long len ) ;
int PEM_bytes_read_bio ( unsigned char * * pdata , long * plen , char * * pnm , const char * name , BIO * bp , pem_password_cb * cb , void * u ) ;
void * PEM_ASN1_read_bio ( d2i_of_void * d2i , const char * name , BIO * bp , void * * x , pem_password_cb * cb , void * u ) ;
int PEM_ASN1_write_bio ( i2d_of_void * i2d , const char * name , BIO * bp , void * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cb , void * u ) ;
STACK_OF ( X509_INFO ) * PEM_X509_INFO_read_bio ( BIO * bp , STACK_OF ( X509_INFO ) * sk , pem_password_cb * cb , void * u ) ;
int PEM_X509_INFO_write_bio ( BIO * bp , X509_INFO * xi , EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cd , void * u ) ;
# ifndef OPENSSL_NO_STDIO int PEM_read ( FILE * fp , char * * name , char * * header , unsigned char * * data , long * len ) ;
int PEM_write ( FILE * fp , const char * name , const char * hdr , const unsigned char * data , long len ) ;
void * PEM_ASN1_read ( d2i_of_void * d2i , const char * name , FILE * fp , void * * x , pem_password_cb * cb , void * u ) ;
int PEM_ASN1_write ( i2d_of_void * i2d , const char * name , FILE * fp , void * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * callback , void * u ) ;
STACK_OF ( X509_INFO ) * PEM_X509_INFO_read ( FILE * fp , STACK_OF ( X509_INFO ) * sk , pem_password_cb * cb , void * u ) ;
# endif int PEM_SignInit ( EVP_MD_CTX * ctx , EVP_MD * type ) ;
int PEM_SignUpdate ( EVP_MD_CTX * ctx , unsigned char * d , unsigned int cnt ) ;
int PEM_SignFinal ( EVP_MD_CTX * ctx , unsigned char * sigret , unsigned int * siglen , EVP_PKEY * pkey ) ;
int PEM_def_callback ( char * buf , int num , int rwflag , void * userdata ) ;
void PEM_proc_type ( char * buf , int type ) ;
void PEM_dek_info ( char * buf , const char * type , int len , char * str ) ;
# include < openssl / symhacks . h > DECLARE_PEM_rw ( X509 , X509 ) DECLARE_PEM_rw ( X509_AUX , X509 ) DECLARE_PEM_rw ( X509_REQ , X509_REQ ) DECLARE_PEM_write ( X509_REQ_NEW , X509_REQ ) DECLARE_PEM_rw ( X509_CRL , X509_CRL ) DECLARE_PEM_rw ( PKCS7 , PKCS7 ) DECLARE_PEM_rw ( NETSCAPE_CERT_SEQUENCE , NETSCAPE_CERT_SEQUENCE ) DECLARE_PEM_rw ( PKCS8 , X509_SIG ) DECLARE_PEM_rw ( PKCS8_PRIV_KEY_INFO , PKCS8_PRIV_KEY_INFO ) # ifndef OPENSSL_NO_RSA DECLARE_PEM_rw_cb ( RSAPrivateKey , RSA ) DECLARE_PEM_rw_const ( RSAPublicKey , RSA ) DECLARE_PEM_rw ( RSA_PUBKEY , RSA ) |
-6,228,844,445,714,760,000 | debian | 8 | 0 | static int fts_parser_script_deinit ( struct fts_parser * _parser ) {
struct script_fts_parser * parser = ( struct script_fts_parser * ) _parser ;
int ret = parser -> failed ? - 1 : 0 ;
if ( close ( parser -> fd ) < 0 ) i_error ( "close(%s) failed: %m" , parser -> path ) ;
i_free ( parser -> path ) ;
i_free ( parser ) ;
return ret ;
} |
-8,178,805,850,432,685,000 | debian | 49 | 0 | static gboolean dissect_iwarp_mpa ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data ) {
tvbuff_t * next_tvb = NULL ;
conversation_t * conversation = NULL ;
mpa_state_t * state = NULL ;
struct tcpinfo * tcpinfo ;
guint8 endpoint = 3 ;
guint16 ulpdu_length = 0 ;
if ( data == NULL ) return FALSE ;
tcpinfo = ( struct tcpinfo * ) data ;
if ( tvb_captured_length ( tvb ) >= MPA_SMALLEST_FPDU_LEN && is_mpa_fpdu ( pinfo ) ) {
conversation = find_conversation ( pinfo -> num , & pinfo -> src , & pinfo -> dst , pinfo -> ptype , pinfo -> srcport , pinfo -> destport , 0 ) ;
state = get_mpa_state ( conversation ) ;
if ( pinfo -> srcport == state -> minfo [ MPA_INITIATOR ] . port ) {
endpoint = MPA_INITIATOR ;
}
else if ( pinfo -> srcport == state -> minfo [ MPA_RESPONDER ] . port ) {
endpoint = MPA_RESPONDER ;
}
else {
REPORT_DISSECTOR_BUG ( "endpoint cannot be determined" ) ;
}
if ( ( state -> ini_exp_m_res || state -> res_exp_m_ini ) && endpoint <= MPA_RESPONDER ) {
if ( ! state -> minfo [ endpoint ] . valid ) {
state -> minfo [ endpoint ] . seq = tcpinfo -> seq ;
state -> minfo [ endpoint ] . valid = TRUE ;
}
}
ulpdu_length = dissect_mpa_fpdu ( tvb , pinfo , tree , state , tcpinfo , endpoint ) ;
if ( ! ulpdu_length ) return FALSE ;
if ( endpoint <= MPA_RESPONDER && state -> minfo [ endpoint ] . valid && number_of_markers ( state , tcpinfo , endpoint ) > 0 ) {
next_tvb = tvb_new_subset_length ( remove_markers ( tvb , pinfo , get_first_marker_offset ( state , tcpinfo , endpoint ) , number_of_markers ( state , tcpinfo , endpoint ) , fpdu_total_length ( tcpinfo ) ) , MPA_ULPDU_LENGTH_LEN , ulpdu_length ) ;
}
else {
next_tvb = tvb_new_subset_length ( tvb , MPA_ULPDU_LENGTH_LEN , ulpdu_length ) ;
}
if ( ddp_rdmap_handle ) {
call_dissector ( ddp_rdmap_handle , next_tvb , pinfo , tree ) ;
}
else {
REPORT_DISSECTOR_BUG ( "ddp_handle was null" ) ;
}
return TRUE ;
}
if ( tvb_captured_length ( tvb ) >= MPA_REQ_REP_FRAME_HEADER_LEN ) {
if ( is_mpa_req ( tvb , pinfo ) ) return dissect_mpa_req_rep ( tvb , pinfo , tree , MPA_REQUEST_FRAME ) ;
else if ( is_mpa_rep ( tvb , pinfo ) ) return dissect_mpa_req_rep ( tvb , pinfo , tree , MPA_REPLY_FRAME ) ;
}
return FALSE ;
} |
-5,300,415,683,778,647,000 | chrome | 3 | 0 | IN_PROC_BROWSER_TEST_F ( ExtensionMessageBubbleViewBrowserTest , ExtensionBubbleAnchoredToAppMenuWithOtherAction ) {
TestBubbleAnchoredToAppMenuWithOtherAction ( ) ;
} |
-6,552,851,419,396,579,000 | debian | 22 | 0 | static int SpoolssReplyOpenPrinter_r ( tvbuff_t * tvb , int offset , packet_info * pinfo , proto_tree * tree , dcerpc_info * di , guint8 * drep _U_ ) {
dcerpc_call_value * dcv = ( dcerpc_call_value * ) di -> call_data ;
e_ctx_hnd policy_hnd ;
proto_item * hnd_item ;
guint32 status ;
offset = dissect_nt_policy_hnd ( tvb , offset , pinfo , tree , di , drep , hf_hnd , & policy_hnd , & hnd_item , TRUE , FALSE ) ;
offset = dissect_doserror ( tvb , offset , pinfo , tree , di , drep , hf_rc , & status ) ;
if ( status == 0 ) {
const char * pol_name ;
if ( dcv -> se_data ) {
pol_name = wmem_strdup_printf ( wmem_packet_scope ( ) , "ReplyOpenPrinter(%s)" , ( char * ) dcv -> se_data ) ;
}
else {
pol_name = "Unknown ReplyOpenPrinter() handle" ;
}
if ( ! pinfo -> fd -> flags . visited ) {
dcerpc_store_polhnd_name ( & policy_hnd , pinfo , pol_name ) ;
}
if ( hnd_item ) proto_item_append_text ( hnd_item , ": %s" , pol_name ) ;
}
return offset ;
} |
-769,658,847,024,738,700 | debian | 8 | 0 | static gpgme_error_t add_io_cb ( engine_uiserver_t uiserver , iocb_data_t * iocbd , gpgme_io_cb_t handler ) {
gpgme_error_t err ;
TRACE_BEG2 ( DEBUG_ENGINE , "engine-uiserver:add_io_cb" , uiserver , "fd %d, dir %d" , iocbd -> fd , iocbd -> dir ) ;
err = ( * uiserver -> io_cbs . add ) ( uiserver -> io_cbs . add_priv , iocbd -> fd , iocbd -> dir , handler , iocbd -> data , & iocbd -> tag ) ;
if ( err ) return TRACE_ERR ( err ) ;
if ( ! iocbd -> dir ) err = _gpgme_io_set_nonblocking ( iocbd -> fd ) ;
return TRACE_ERR ( err ) ;
} |
8,849,962,823,026,424,000 | debian | 12 | 0 | static void qio_channel_websock_write_close ( QIOChannelWebsock * ioc , uint16_t code , const char * reason ) {
buffer_reserve ( & ioc -> rawoutput , 2 + ( reason ? strlen ( reason ) : 0 ) ) ;
* ( uint16_t * ) ( ioc -> rawoutput . buffer + ioc -> rawoutput . offset ) = cpu_to_be16 ( code ) ;
ioc -> rawoutput . offset += 2 ;
if ( reason ) {
buffer_append ( & ioc -> rawoutput , reason , strlen ( reason ) ) ;
}
qio_channel_websock_encode_buffer ( ioc , & ioc -> encoutput , QIO_CHANNEL_WEBSOCK_OPCODE_CLOSE , & ioc -> rawoutput ) ;
buffer_reset ( & ioc -> rawoutput ) ;
qio_channel_websock_write_wire ( ioc , NULL ) ;
qio_channel_shutdown ( ioc -> master , QIO_CHANNEL_SHUTDOWN_BOTH , NULL ) ;
} |
5,045,872,831,385,413,000 | debian | 17 | 0 | static void col_append_info_by_handle ( packet_info * pinfo , guint16 handle , bluetooth_data_t * bluetooth_data ) {
bluetooth_uuid_t service_uuid ;
bluetooth_uuid_t characteristic_uuid ;
bluetooth_uuid_t uuid ;
service_uuid = get_service_uuid_from_handle ( pinfo , handle , bluetooth_data ) ;
characteristic_uuid = get_characteristic_uuid_from_handle ( pinfo , handle , bluetooth_data ) ;
uuid = get_uuid_from_handle ( pinfo , handle , bluetooth_data ) ;
if ( ! memcmp ( & service_uuid , & uuid , sizeof ( uuid ) ) ) {
col_append_fstr ( pinfo -> cinfo , COL_INFO , ", Handle: 0x%04x (%s)" , handle , print_uuid ( & uuid ) ) ;
}
else if ( ! memcmp ( & characteristic_uuid , & uuid , sizeof ( uuid ) ) ) {
col_append_fstr ( pinfo -> cinfo , COL_INFO , ", Handle: 0x%04x (%s: %s)" , handle , print_uuid ( & service_uuid ) , print_uuid ( & uuid ) ) ;
}
else {
col_append_fstr ( pinfo -> cinfo , COL_INFO , ", Handle: 0x%04x (%s: %s: %s)" , handle , print_uuid ( & service_uuid ) , print_uuid ( & characteristic_uuid ) , print_uuid ( & uuid ) ) ;
}
} |
-5,511,323,081,862,746,000 | debian | 55 | 1 | static void process_packet_data ( struct wtap_pkthdr * phdr , Buffer * target , guint8 * buffer , gint len , k12_t * k12 ) {
guint32 type ;
guint buffer_offset ;
guint64 ts ;
guint32 length ;
guint32 extra_len ;
guint32 src_id ;
k12_src_desc_t * src_desc ;
phdr -> rec_type = REC_TYPE_PACKET ;
phdr -> presence_flags = WTAP_HAS_TS ;
ts = pntoh64 ( buffer + K12_PACKET_TIMESTAMP ) ;
phdr -> ts . secs = ( guint32 ) ( ( ts / 2000000 ) + 631152000 ) ;
phdr -> ts . nsecs = ( guint32 ) ( ( ts % 2000000 ) * 500 ) ;
length = pntoh32 ( buffer + K12_RECORD_FRAME_LEN ) & 0x00001FFF ;
phdr -> len = phdr -> caplen = length ;
type = pntoh32 ( buffer + K12_RECORD_TYPE ) ;
buffer_offset = ( type == K12_REC_D0020 ) ? K12_PACKET_FRAME_D0020 : K12_PACKET_FRAME ;
ws_buffer_assure_space ( target , length ) ;
memcpy ( ws_buffer_start_ptr ( target ) , buffer + buffer_offset , length ) ;
extra_len = len - buffer_offset - length ;
ws_buffer_assure_space ( & ( k12 -> extra_info ) , extra_len ) ;
memcpy ( ws_buffer_start_ptr ( & ( k12 -> extra_info ) ) , buffer + buffer_offset + length , extra_len ) ;
phdr -> pseudo_header . k12 . extra_info = ( guint8 * ) ws_buffer_start_ptr ( & ( k12 -> extra_info ) ) ;
phdr -> pseudo_header . k12 . extra_length = extra_len ;
src_id = pntoh32 ( buffer + K12_RECORD_SRC_ID ) ;
K12_DBG ( 5 , ( "process_packet_data: src_id=%.8x" , src_id ) ) ;
phdr -> pseudo_header . k12 . input = src_id ;
if ( ! ( src_desc = ( k12_src_desc_t * ) g_hash_table_lookup ( k12 -> src_by_id , GUINT_TO_POINTER ( src_id ) ) ) ) {
src_desc = ( k12_src_desc_t * ) g_hash_table_lookup ( k12 -> src_by_id , GUINT_TO_POINTER ( src_id & K12_RECORD_SRC_ID_MASK ) ) ;
}
if ( src_desc ) {
K12_DBG ( 5 , ( "process_packet_data: input_name='%s' stack_file='%s' type=%x" , src_desc -> input_name , src_desc -> stack_file , src_desc -> input_type ) ) ;
phdr -> pseudo_header . k12 . input_name = src_desc -> input_name ;
phdr -> pseudo_header . k12 . stack_file = src_desc -> stack_file ;
phdr -> pseudo_header . k12 . input_type = src_desc -> input_type ;
switch ( src_desc -> input_type ) {
case K12_PORT_ATMPVC : if ( ( long ) ( buffer_offset + length + K12_PACKET_OFFSET_CID ) < len ) {
phdr -> pseudo_header . k12 . input_info . atm . vp = pntoh16 ( buffer + buffer_offset + length + K12_PACKET_OFFSET_VP ) ;
phdr -> pseudo_header . k12 . input_info . atm . vc = pntoh16 ( buffer + buffer_offset + length + K12_PACKET_OFFSET_VC ) ;
phdr -> pseudo_header . k12 . input_info . atm . cid = * ( ( unsigned char * ) ( buffer + buffer_offset + length + K12_PACKET_OFFSET_CID ) ) ;
break ;
}
default : memcpy ( & ( phdr -> pseudo_header . k12 . input_info ) , & ( src_desc -> input_info ) , sizeof ( src_desc -> input_info ) ) ;
break ;
}
}
else {
K12_DBG ( 5 , ( "process_packet_data: NO SRC_RECORD FOUND" ) ) ;
memset ( & ( phdr -> pseudo_header . k12 ) , 0 , sizeof ( phdr -> pseudo_header . k12 ) ) ;
phdr -> pseudo_header . k12 . input_name = "unknown port" ;
phdr -> pseudo_header . k12 . stack_file = "unknown stack file" ;
}
phdr -> pseudo_header . k12 . input = src_id ;
phdr -> pseudo_header . k12 . stuff = k12 ;
} |
-5,361,762,812,461,355,000 | chrome | 123 | 0 | static void U_CALLCONV UConverter_fromUnicode_CompoundText_OFFSETS ( UConverterFromUnicodeArgs * args , UErrorCode * err ) {
UConverter * cnv = args -> converter ;
uint8_t * target = ( uint8_t * ) args -> target ;
const uint8_t * targetLimit = ( const uint8_t * ) args -> targetLimit ;
const UChar * source = args -> source ;
const UChar * sourceLimit = args -> sourceLimit ;
UChar32 sourceChar ;
UBool useFallback = cnv -> useFallback ;
uint8_t tmpTargetBuffer [ 7 ] ;
int32_t tmpTargetBufferLength = 0 ;
COMPOUND_TEXT_CONVERTERS currentState , tmpState ;
uint32_t pValue ;
int32_t pValueLength = 0 ;
int32_t i , n , j ;
UConverterDataCompoundText * myConverterData = ( UConverterDataCompoundText * ) cnv -> extraInfo ;
currentState = myConverterData -> state ;
if ( ( sourceChar = cnv -> fromUChar32 ) != 0 && target < targetLimit ) {
goto getTrail ;
}
while ( source < sourceLimit ) {
if ( target < targetLimit ) {
sourceChar = * ( source ++ ) ;
if ( U16_IS_SURROGATE ( sourceChar ) ) {
if ( U16_IS_SURROGATE_LEAD ( sourceChar ) ) {
getTrail : if ( source < sourceLimit ) {
UChar trail = ( UChar ) * source ;
if ( U16_IS_TRAIL ( trail ) ) {
source ++ ;
sourceChar = U16_GET_SUPPLEMENTARY ( sourceChar , trail ) ;
cnv -> fromUChar32 = 0x00 ;
}
else {
* err = U_ILLEGAL_CHAR_FOUND ;
cnv -> fromUChar32 = sourceChar ;
break ;
}
}
else {
cnv -> fromUChar32 = sourceChar ;
break ;
}
}
else {
* err = U_ILLEGAL_CHAR_FOUND ;
cnv -> fromUChar32 = sourceChar ;
break ;
}
}
tmpTargetBufferLength = 0 ;
tmpState = getState ( sourceChar ) ;
if ( tmpState != DO_SEARCH && currentState != tmpState ) {
currentState = tmpState ;
for ( i = 0 ;
escSeqCompoundText [ currentState ] [ i ] != 0 ;
i ++ ) {
tmpTargetBuffer [ tmpTargetBufferLength ++ ] = escSeqCompoundText [ currentState ] [ i ] ;
}
}
if ( tmpState == DO_SEARCH ) {
for ( i = 1 ;
i < SEARCH_LENGTH ;
i ++ ) {
pValueLength = ucnv_MBCSFromUChar32 ( myConverterData -> myConverterArray [ i ] , sourceChar , & pValue , useFallback ) ;
if ( pValueLength > 0 ) {
tmpState = ( COMPOUND_TEXT_CONVERTERS ) i ;
if ( currentState != tmpState ) {
currentState = tmpState ;
for ( j = 0 ;
escSeqCompoundText [ currentState ] [ j ] != 0 ;
j ++ ) {
tmpTargetBuffer [ tmpTargetBufferLength ++ ] = escSeqCompoundText [ currentState ] [ j ] ;
}
}
for ( n = ( pValueLength - 1 ) ;
n >= 0 ;
n -- ) {
tmpTargetBuffer [ tmpTargetBufferLength ++ ] = ( uint8_t ) ( pValue >> ( n * 8 ) ) ;
}
break ;
}
}
}
else if ( tmpState == COMPOUND_TEXT_SINGLE_0 ) {
tmpTargetBuffer [ tmpTargetBufferLength ++ ] = ( uint8_t ) sourceChar ;
}
else {
pValueLength = ucnv_MBCSFromUChar32 ( myConverterData -> myConverterArray [ currentState ] , sourceChar , & pValue , useFallback ) ;
if ( pValueLength > 0 ) {
for ( n = ( pValueLength - 1 ) ;
n >= 0 ;
n -- ) {
tmpTargetBuffer [ tmpTargetBufferLength ++ ] = ( uint8_t ) ( pValue >> ( n * 8 ) ) ;
}
}
}
for ( i = 0 ;
i < tmpTargetBufferLength ;
i ++ ) {
if ( target < targetLimit ) {
* target ++ = tmpTargetBuffer [ i ] ;
}
else {
* err = U_BUFFER_OVERFLOW_ERROR ;
break ;
}
}
if ( * err == U_BUFFER_OVERFLOW_ERROR ) {
for ( ;
i < tmpTargetBufferLength ;
i ++ ) {
args -> converter -> charErrorBuffer [ args -> converter -> charErrorBufferLength ++ ] = tmpTargetBuffer [ i ] ;
}
}
}
else {
* err = U_BUFFER_OVERFLOW_ERROR ;
break ;
}
}
myConverterData -> state = currentState ;
args -> source = source ;
args -> target = ( char * ) target ;
} |
3,919,646,340,804,521,500 | debian | 7 | 0 | static int name_cmp_len ( const char * name ) {
int i ;
for ( i = 0 ;
name [ i ] && name [ i ] != '\n' && name [ i ] != '/' ;
i ++ ) ;
return i ;
} |
-2,064,332,158,282,087,200 | debian | 10 | 0 | static int astream_open_output ( struct attachment_istream * astream ) {
int fd ;
i_assert ( astream -> part . temp_fd == - 1 ) ;
fd = astream -> set . open_temp_fd ( astream -> context ) ;
if ( fd == - 1 ) return - 1 ;
astream -> part . temp_fd = fd ;
astream -> part . temp_output = o_stream_create_fd ( fd , 0 , FALSE ) ;
o_stream_cork ( astream -> part . temp_output ) ;
return 0 ;
} |
4,600,167,735,237,264,400 | chrome | 76 | 1 | static uint8_t checkBaseExtUnicode ( UCMStates * baseStates , UCMTable * base , UCMTable * ext , UBool moveToExt , UBool intersectBase ) {
UCMapping * mb , * me , * mbLimit , * meLimit ;
int32_t cmp ;
uint8_t result ;
mb = base -> mappings ;
mbLimit = mb + base -> mappingsLength ;
me = ext -> mappings ;
meLimit = me + ext -> mappingsLength ;
result = 0 ;
for ( ;
;
) {
for ( ;
;
) {
if ( mb == mbLimit ) {
return result ;
}
if ( ( 0 <= mb -> f && mb -> f <= 2 ) || mb -> f == 4 ) {
break ;
}
++ mb ;
}
for ( ;
;
) {
if ( me == meLimit ) {
return result ;
}
if ( ( 0 <= me -> f && me -> f <= 2 ) || me -> f == 4 ) {
break ;
}
++ me ;
}
cmp = compareUnicode ( base , mb , ext , me ) ;
if ( cmp < 0 ) {
if ( intersectBase && ( intersectBase != 2 || mb -> bLen > 1 ) ) {
mb -> moveFlag |= UCM_MOVE_TO_EXT ;
result |= NEEDS_MOVE ;
}
else if ( mb -> uLen < me -> uLen && 0 == uprv_memcmp ( UCM_GET_CODE_POINTS ( base , mb ) , UCM_GET_CODE_POINTS ( ext , me ) , 4 * mb -> uLen ) ) {
if ( moveToExt ) {
mb -> moveFlag |= UCM_MOVE_TO_EXT ;
result |= NEEDS_MOVE ;
}
else {
fprintf ( stderr , "ucm error: the base table contains a mapping whose input sequence\n" " is a prefix of the input sequence of an extension mapping\n" ) ;
ucm_printMapping ( base , mb , stderr ) ;
ucm_printMapping ( ext , me , stderr ) ;
result |= HAS_ERRORS ;
}
}
++ mb ;
}
else if ( cmp == 0 ) {
if ( mb -> f == me -> f && mb -> bLen == me -> bLen && 0 == uprv_memcmp ( UCM_GET_BYTES ( base , mb ) , UCM_GET_BYTES ( ext , me ) , mb -> bLen ) ) {
me -> moveFlag |= UCM_REMOVE_MAPPING ;
result |= NEEDS_MOVE ;
}
else if ( intersectBase ) {
mb -> moveFlag |= UCM_MOVE_TO_EXT ;
result |= NEEDS_MOVE ;
}
else {
fprintf ( stderr , "ucm error: the base table contains a mapping whose input sequence\n" " is the same as the input sequence of an extension mapping\n" " but it maps differently\n" ) ;
ucm_printMapping ( base , mb , stderr ) ;
ucm_printMapping ( ext , me , stderr ) ;
result |= HAS_ERRORS ;
}
++ mb ;
}
else {
++ me ;
}
}
} |
-8,178,805,850,432,685,000 | debian | 12 | 0 | static guint32 number_of_markers ( mpa_state_t * state , struct tcpinfo * tcpinfo , guint8 endpoint ) {
guint32 size ;
guint32 offset ;
size = fpdu_total_length ( tcpinfo ) ;
offset = get_first_marker_offset ( state , tcpinfo , endpoint ) ;
if ( offset < size ) {
return ( ( size - offset ) / MPA_MARKER_INTERVAL ) + 1 ;
}
else {
return 0 ;
}
} |
8,461,782,184,979,846,000 | chrome | 6 | 0 | TEST_F ( ProtocolHandlerRegistryTest , IgnoreProtocolHandler ) {
registry ( ) -> OnIgnoreRegisterProtocolHandler ( test_protocol_handler ( ) ) ;
ASSERT_TRUE ( registry ( ) -> IsIgnored ( test_protocol_handler ( ) ) ) ;
registry ( ) -> RemoveIgnoredHandler ( test_protocol_handler ( ) ) ;
ASSERT_FALSE ( registry ( ) -> IsIgnored ( test_protocol_handler ( ) ) ) ;
} |
252,275,190,935,145,020 | debian | 6 | 0 | void vp9_read_frame_size ( struct vp9_read_bit_buffer * rb , int * width , int * height ) {
const int w = vp9_rb_read_literal ( rb , 16 ) + 1 ;
const int h = vp9_rb_read_literal ( rb , 16 ) + 1 ;
* width = w ;
* height = h ;
} |
-7,334,302,271,653,595,000 | debian | 9 | 0 | static uint ms_to_precision ( uint ms ) {
uint cut , precision ;
for ( cut = 10 , precision = 6 ;
precision > 0 ;
cut *= 10 , precision -- ) {
if ( ms % cut ) return precision ;
}
return 0 ;
} |
-1,381,237,731,082,039,300 | debian | 14 | 0 | static gboolean ngsniffer_seek_read ( wtap * wth , gint64 seek_off , struct wtap_pkthdr * phdr , Buffer * buf , int * err , gchar * * err_info ) {
int ret ;
if ( ! ng_file_seek_rand ( wth , seek_off , err , err_info ) ) return FALSE ;
ret = ngsniffer_process_record ( wth , TRUE , NULL , phdr , buf , err , err_info ) ;
if ( ret < 0 ) {
return FALSE ;
}
switch ( ret ) {
case REC_FRAME2 : case REC_FRAME4 : case REC_FRAME6 : break ;
default : g_assert_not_reached ( ) ;
return FALSE ;
}
return TRUE ;
} |
-5,493,081,488,206,620,000 | debian | 8 | 0 | static const char * cmd_audit_log_parts ( cmd_parms * cmd , void * _dcfg , const char * p1 ) {
directory_config * dcfg = _dcfg ;
if ( is_valid_parts_specification ( ( char * ) p1 ) != 1 ) {
return apr_psprintf ( cmd -> pool , "Invalid parts specification for SecAuditLogParts: %s" , p1 ) ;
}
dcfg -> auditlog_parts = ( char * ) p1 ;
return NULL ;
} |
7,191,899,184,788,440,000 | debian | 34 | 0 | static COMMANDS * find_command ( char * name ) {
uint len ;
char * end ;
DBUG_ENTER ( "find_command" ) ;
DBUG_ASSERT ( name != NULL ) ;
DBUG_PRINT ( "enter" , ( "name: '%s'" , name ) ) ;
while ( my_isspace ( charset_info , * name ) ) name ++ ;
if ( ( ! real_binary_mode && strstr ( name , "\\g" ) ) || ( strstr ( name , delimiter ) && ! is_delimiter_command ( name , DELIMITER_NAME_LEN ) ) ) DBUG_RETURN ( ( COMMANDS * ) 0 ) ;
if ( ( end = strcont ( name , " \t" ) ) ) {
len = ( uint ) ( end - name ) ;
while ( my_isspace ( charset_info , * end ) ) end ++ ;
if ( ! * end ) end = 0 ;
}
else len = ( uint ) strlen ( name ) ;
int index = - 1 ;
if ( real_binary_mode ) {
if ( is_delimiter_command ( name , len ) ) index = delimiter_index ;
}
else {
for ( uint i = 0 ;
commands [ i ] . func ;
i ++ ) {
if ( ! my_strnncoll ( & my_charset_latin1 , ( uchar * ) name , len , ( uchar * ) commands [ i ] . name , len ) && ( commands [ i ] . name [ len ] == '\0' ) && ( ! end || ( commands [ i ] . takes_params && get_arg ( name , CHECK ) ) ) ) {
index = i ;
break ;
}
}
}
if ( index >= 0 ) {
DBUG_PRINT ( "exit" , ( "found command: %s" , commands [ index ] . name ) ) ;
DBUG_RETURN ( & commands [ index ] ) ;
}
DBUG_RETURN ( ( COMMANDS * ) 0 ) ;
} |
5,045,872,831,385,413,000 | debian | 6 | 0 | static gpointer btatt_handle_value ( packet_info * pinfo ) {
guint16 * value_data ;
value_data = ( guint16 * ) p_get_proto_data ( pinfo -> pool , pinfo , proto_btatt , PROTO_DATA_BTATT_HANDLE ) ;
if ( value_data ) return GUINT_TO_POINTER ( ( gulong ) * value_data ) ;
return NULL ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_IS11172VideoMode ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_IS11172VideoMode , IS11172VideoMode_sequence ) ;
return offset ;
} |
1,535,921,111,212,871,000 | debian | 37 | 0 | int remoteSendStreamData ( struct qemud_client * client , struct qemud_client_stream * stream , const char * data , unsigned int len ) {
struct qemud_client_message * msg ;
XDR xdr ;
VIR_DEBUG ( "client=%p stream=%p data=%p len=%d" , client , stream , data , len ) ;
if ( VIR_ALLOC ( msg ) < 0 ) {
return - 1 ;
}
msg -> hdr . prog = REMOTE_PROGRAM ;
msg -> hdr . vers = REMOTE_PROTOCOL_VERSION ;
msg -> hdr . proc = stream -> procedure ;
msg -> hdr . type = REMOTE_STREAM ;
msg -> hdr . serial = stream -> serial ;
msg -> hdr . status = data ? REMOTE_CONTINUE : REMOTE_OK ;
if ( remoteEncodeClientMessageHeader ( msg ) < 0 ) goto fatal_error ;
if ( data && len ) {
if ( ( msg -> bufferLength - msg -> bufferOffset ) < len ) goto fatal_error ;
xdrmem_create ( & xdr , msg -> buffer , msg -> bufferLength , XDR_ENCODE ) ;
if ( xdr_setpos ( & xdr , msg -> bufferOffset ) == 0 ) goto xdr_error ;
memcpy ( msg -> buffer + msg -> bufferOffset , data , len ) ;
msg -> bufferOffset += len ;
len = msg -> bufferOffset ;
if ( xdr_setpos ( & xdr , 0 ) == 0 ) goto xdr_error ;
if ( ! xdr_u_int ( & xdr , & len ) ) goto xdr_error ;
xdr_destroy ( & xdr ) ;
VIR_DEBUG ( "Total %d" , msg -> bufferOffset ) ;
}
if ( data ) msg -> streamTX = 1 ;
msg -> bufferLength = msg -> bufferOffset ;
msg -> bufferOffset = 0 ;
qemudClientMessageQueuePush ( & client -> tx , msg ) ;
qemudUpdateClientEvent ( client ) ;
return 0 ;
xdr_error : xdr_destroy ( & xdr ) ;
fatal_error : VIR_FREE ( msg ) ;
VIR_WARN ( "Failed to serialize stream data for proc %d as XDR" , stream -> procedure ) ;
return - 1 ;
} |
6,600,620,671,673,715,000 | debian | 10 | 0 | static byte * i_alloc_byte_array ( gs_memory_t * mem , uint num_elements , uint elt_size , client_name_t cname ) {
gs_ref_memory_t * const imem = ( gs_ref_memory_t * ) mem ;
obj_header_t * obj ;
ulong lsize ;
# ifdef MEMENTO if ( Memento_failThisEvent ( ) ) return NULL ;
# endif if ( alloc_array_check_size ( num_elements , elt_size , & lsize ) == false ) return NULL ;
obj = alloc_obj ( imem , lsize , & st_bytes , ALLOC_DIRECT , cname ) ;
if_debug6m ( 'A' , mem , "[a%d:+b.]%s -bytes-*(%lu=%u*%u) = 0x%lx\n" , alloc_trace_space ( imem ) , client_name_string ( cname ) , ( ulong ) num_elements * elt_size , num_elements , elt_size , ( ulong ) obj ) ;
return ( byte * ) obj ;
} |
7,651,945,086,108,393,000 | debian | 10 | 0 | int qemuMonitorJSONSetLink ( qemuMonitorPtr mon , const char * name , enum virDomainNetInterfaceLinkState state ) {
int ret ;
virJSONValuePtr reply = NULL ;
virJSONValuePtr cmd = qemuMonitorJSONMakeCommand ( "set_link" , "s:name" , name , "b:up" , state != VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN , NULL ) ;
if ( ! cmd ) return - 1 ;
if ( ( ret = qemuMonitorJSONCommand ( mon , cmd , & reply ) ) == 0 ) ret = qemuMonitorJSONCheckError ( cmd , reply ) ;
virJSONValueFree ( cmd ) ;
virJSONValueFree ( reply ) ;
return ret ;
} |
5,366,785,327,268,799,000 | chrome | 3 | 0 | IN_PROC_BROWSER_TEST_F ( MimeHandlerViewTest , EmbeddedDataUrlLong ) {
RunTest ( "test_embedded_data_url_long.html" ) ;
} |
-6,220,838,201,187,559,000 | debian | 24 | 1 | static char * unescape_word ( struct Curl_easy * data , const char * inputbuff ) {
char * newp ;
char * dictp ;
char * ptr ;
int len ;
char ch ;
int olen = 0 ;
newp = curl_easy_unescape ( data , inputbuff , 0 , & len ) ;
if ( ! newp ) return NULL ;
dictp = malloc ( ( ( size_t ) len ) * 2 + 1 ) ;
if ( dictp ) {
for ( ptr = newp ;
( ch = * ptr ) != 0 ;
ptr ++ ) {
if ( ( ch <= 32 ) || ( ch == 127 ) || ( ch == '\'' ) || ( ch == '\"' ) || ( ch == '\\' ) ) {
dictp [ olen ++ ] = '\\' ;
}
dictp [ olen ++ ] = ch ;
}
dictp [ olen ] = 0 ;
}
free ( newp ) ;
return dictp ;
} |
2,776,415,072,272,421,400 | debian | 8 | 0 | static void erase_screen ( AVCodecContext * avctx ) {
AnsiContext * s = avctx -> priv_data ;
int i ;
for ( i = 0 ;
i < avctx -> height ;
i ++ ) memset ( s -> frame -> data [ 0 ] + i * s -> frame -> linesize [ 0 ] , DEFAULT_BG_COLOR , avctx -> width ) ;
s -> x = s -> y = 0 ;
} |
1,743,019,814,289,113,000 | debian | 19 | 0 | void ff_h264_direct_dist_scale_factor ( H264Context * const h ) {
const int poc = h -> cur_pic_ptr -> field_poc [ h -> picture_structure == PICT_BOTTOM_FIELD ] ;
const int poc1 = h -> ref_list [ 1 ] [ 0 ] . poc ;
int i , field ;
if ( FRAME_MBAFF ) for ( field = 0 ;
field < 2 ;
field ++ ) {
const int poc = h -> cur_pic_ptr -> field_poc [ field ] ;
const int poc1 = h -> ref_list [ 1 ] [ 0 ] . field_poc [ field ] ;
for ( i = 0 ;
i < 2 * h -> ref_count [ 0 ] ;
i ++ ) h -> dist_scale_factor_field [ field ] [ i ^ field ] = get_scale_factor ( h , poc , poc1 , i + 16 ) ;
}
for ( i = 0 ;
i < h -> ref_count [ 0 ] ;
i ++ ) {
h -> dist_scale_factor [ i ] = get_scale_factor ( h , poc , poc1 , i ) ;
}
} |
8,415,334,249,344,417,000 | debian | 62 | 0 | static gint dissect_u3v_descriptors ( tvbuff_t * tvb , packet_info * pinfo _U_ , proto_tree * tree , void * data _U_ ) {
guint8 type ;
gint offset = 0 ;
proto_item * ti ;
proto_tree * sub_tree ;
guint32 version ;
if ( tvb_reported_length ( tvb ) < 2 ) {
return 0 ;
}
type = tvb_get_guint8 ( tvb , 1 ) ;
if ( type != DESCRIPTOR_TYPE_U3V_INTERFACE ) {
return 0 ;
}
ti = proto_tree_add_item ( tree , hf_u3v_device_info_descriptor , tvb , offset , - 1 , ENC_NA ) ;
tree = proto_item_add_subtree ( ti , ett_u3v_device_info_descriptor ) ;
proto_tree_add_item ( tree , hf_u3v_device_info_descriptor_bLength , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset ++ ;
ti = proto_tree_add_item ( tree , hf_u3v_device_info_descriptor_bDescriptorType , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
proto_item_append_text ( ti , " (U3V INTERFACE)" ) ;
offset ++ ;
proto_tree_add_item ( tree , hf_u3v_device_info_descriptor_bDescriptorSubtype , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset ++ ;
if ( ! tvb_bytes_exist ( tvb , offset , 4 ) ) {
return offset ;
}
version = tvb_get_letohl ( tvb , offset ) ;
ti = proto_tree_add_item ( tree , hf_u3v_device_info_descriptor_bGenCPVersion , tvb , offset , 4 , ENC_NA ) ;
proto_item_append_text ( ti , ": %u.%u" , version >> 16 , version & 0xFFFF ) ;
sub_tree = proto_item_add_subtree ( ti , ett_u3v_device_info_descriptor_gencp_version ) ;
proto_tree_add_item ( sub_tree , hf_u3v_device_info_descriptor_bGenCPVersion_minor , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
proto_tree_add_item ( sub_tree , hf_u3v_device_info_descriptor_bGenCPVersion_major , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
if ( ! tvb_bytes_exist ( tvb , offset , 4 ) ) {
return offset ;
}
version = tvb_get_letohl ( tvb , offset ) ;
ti = proto_tree_add_item ( tree , hf_u3v_device_info_descriptor_bU3VVersion , tvb , offset , 4 , ENC_NA ) ;
proto_item_append_text ( ti , ": %u.%u" , version >> 16 , version & 0xFFFF ) ;
sub_tree = proto_item_add_subtree ( ti , ett_u3v_device_info_descriptor_u3v_version ) ;
proto_tree_add_item ( sub_tree , hf_u3v_device_info_descriptor_bU3VVersion_minor , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
proto_tree_add_item ( sub_tree , hf_u3v_device_info_descriptor_bU3VVersion_major , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
proto_tree_add_item ( tree , hf_u3v_device_info_descriptor_iDeviceGUID , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( tree , hf_u3v_device_info_descriptor_iVendorName , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( tree , hf_u3v_device_info_descriptor_iModelName , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( tree , hf_u3v_device_info_descriptor_iFamilyName , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( tree , hf_u3v_device_info_descriptor_iDeviceVersion , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( tree , hf_u3v_device_info_descriptor_iManufacturerInfo , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( tree , hf_u3v_device_info_descriptor_iSerialNumber , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( tree , hf_u3v_device_info_descriptor_iUserDefinedName , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ;
offset ++ ;
proto_tree_add_bitmask ( tree , tvb , offset , hf_u3v_device_info_descriptor_bmSpeedSupport , ett_u3v_device_info_descriptor_speed_support , speed_support_fields , ENC_LITTLE_ENDIAN ) ;
offset ++ ;
return offset ;
} |
-2,928,324,134,072,492,500 | debian | 293 | 0 | static int unistim_calls_packet ( void * ptr _U_ , packet_info * pinfo , epan_dissect_t * edt _U_ , const void * unistim_info ) {
voip_calls_tapinfo_t * tapinfo = & the_tapinfo_struct ;
voip_calls_info_t * tmp_listinfo ;
voip_calls_info_t * callsinfo = NULL ;
unistim_info_t * tmp_unistim_info = NULL ;
GList * list = NULL ;
GString * g_tmp = NULL ;
const gchar * frame_label = NULL ;
gchar * comment = NULL ;
const unistim_info_t * pi = ( const unistim_info_t * ) unistim_info ;
g_tmp = g_string_new ( NULL ) ;
list = g_list_first ( tapinfo -> callsinfo_list ) ;
while ( list ) {
tmp_listinfo = ( voip_calls_info_t * ) list -> data ;
if ( tmp_listinfo -> protocol == VOIP_UNISTIM ) {
tmp_unistim_info = ( unistim_info_t * ) tmp_listinfo -> prot_info ;
if ( pi -> termid != 0 ) {
if ( tmp_unistim_info -> termid == pi -> termid ) {
if ( tmp_listinfo -> call_state == VOIP_COMPLETED || tmp_listinfo -> call_state == VOIP_UNKNOWN ) {
}
else {
callsinfo = ( voip_calls_info_t * ) ( list -> data ) ;
break ;
}
}
}
else {
if ( ADDRESSES_EQUAL ( & tmp_unistim_info -> it_ip , & pinfo -> dst ) && ADDRESSES_EQUAL ( & tmp_unistim_info -> ni_ip , & pinfo -> src ) && ( tmp_unistim_info -> it_port == pinfo -> destport ) ) {
if ( tmp_listinfo -> call_state == VOIP_COMPLETED || tmp_listinfo -> call_state == VOIP_UNKNOWN ) {
}
else {
callsinfo = ( voip_calls_info_t * ) ( list -> data ) ;
break ;
}
}
else if ( ADDRESSES_EQUAL ( & tmp_unistim_info -> it_ip , & pinfo -> src ) && ADDRESSES_EQUAL ( & tmp_unistim_info -> ni_ip , & pinfo -> dst ) && ( tmp_unistim_info -> it_port == pinfo -> srcport ) ) {
if ( tmp_listinfo -> call_state == VOIP_COMPLETED || tmp_listinfo -> call_state == VOIP_UNKNOWN ) {
}
else {
callsinfo = ( voip_calls_info_t * ) ( list -> data ) ;
break ;
}
}
}
}
list = g_list_next ( list ) ;
}
if ( pi -> payload_type == 2 || pi -> payload_type == 1 ) {
if ( pi -> key_state == 1 || pi -> hook_state == 1 ) {
if ( callsinfo == NULL ) {
callsinfo = ( voip_calls_info_t * ) g_malloc0 ( sizeof ( voip_calls_info_t ) ) ;
callsinfo -> call_active_state = VOIP_ACTIVE ;
callsinfo -> call_state = VOIP_CALL_SETUP ;
callsinfo -> from_identity = g_strdup_printf ( "%x" , pi -> termid ) ;
callsinfo -> to_identity = g_strdup ( "UNKNOWN" ) ;
COPY_ADDRESS ( & ( callsinfo -> initial_speaker ) , & ( pinfo -> src ) ) ;
callsinfo -> selected = FALSE ;
callsinfo -> start_fd = pinfo -> fd ;
callsinfo -> start_rel_ts = pinfo -> rel_ts ;
callsinfo -> protocol = VOIP_UNISTIM ;
callsinfo -> prot_info = g_malloc ( sizeof ( unistim_info_t ) ) ;
tmp_unistim_info = ( unistim_info_t * ) callsinfo -> prot_info ;
tmp_unistim_info -> rudp_type = 0 ;
tmp_unistim_info -> payload_type = 0 ;
tmp_unistim_info -> sequence = pi -> sequence ;
tmp_unistim_info -> termid = pi -> termid ;
tmp_unistim_info -> key_val = - 1 ;
tmp_unistim_info -> key_state = - 1 ;
tmp_unistim_info -> hook_state = - 1 ;
tmp_unistim_info -> stream_connect = - 1 ;
tmp_unistim_info -> trans_connect = - 1 ;
tmp_unistim_info -> set_termid = - 1 ;
tmp_unistim_info -> string_data = NULL ;
tmp_unistim_info -> key_buffer = NULL ;
COPY_ADDRESS ( & ( tmp_unistim_info -> it_ip ) , & ( pi -> it_ip ) ) ;
COPY_ADDRESS ( & ( tmp_unistim_info -> ni_ip ) , & ( pi -> ni_ip ) ) ;
tmp_unistim_info -> it_port = pi -> it_port ;
callsinfo -> free_prot_info = g_free ;
callsinfo -> npackets = 0 ;
callsinfo -> call_num = tapinfo -> ncalls ++ ;
tapinfo -> callsinfo_list = g_list_prepend ( tapinfo -> callsinfo_list , callsinfo ) ;
}
else {
tmp_unistim_info = ( unistim_info_t * ) callsinfo -> prot_info ;
tmp_unistim_info -> sequence = pi -> sequence ;
}
callsinfo -> stop_fd = pinfo -> fd ;
callsinfo -> stop_rel_ts = pinfo -> rel_ts ;
++ ( callsinfo -> npackets ) ;
++ ( tapinfo -> npackets ) ;
if ( pi -> key_val >= 0 && pi -> key_val <= 11 ) {
if ( tmp_unistim_info -> key_buffer != NULL ) {
g_string_assign ( g_tmp , tmp_unistim_info -> key_buffer ) ;
if ( pi -> key_val == 10 ) {
tmp_unistim_info -> key_buffer = g_strdup_printf ( "%s*" , g_tmp -> str ) ;
}
else if ( pi -> key_val == 11 ) {
tmp_unistim_info -> key_buffer = g_strdup_printf ( "%s#" , g_tmp -> str ) ;
}
else {
tmp_unistim_info -> key_buffer = g_strdup_printf ( "%s%d" , g_tmp -> str , pi -> key_val ) ;
}
}
else {
if ( pi -> key_val == 10 ) {
tmp_unistim_info -> key_buffer = g_strdup ( "*" ) ;
}
else if ( pi -> key_val == 11 ) {
tmp_unistim_info -> key_buffer = g_strdup ( "#" ) ;
}
else {
tmp_unistim_info -> key_buffer = g_strdup_printf ( "%d" , pi -> key_val ) ;
}
}
if ( pi -> key_val == 10 ) {
comment = g_strdup_printf ( "Key Input Sent: * (%d)" , pi -> sequence ) ;
}
else if ( pi -> key_val == 11 ) {
comment = g_strdup_printf ( "Key Input Sent: # (%d)" , pi -> sequence ) ;
}
else {
comment = g_strdup_printf ( "Key Input Sent: %d (%d)" , pi -> key_val , pi -> sequence ) ;
}
}
else if ( pi -> key_val == 12 ) {
comment = g_strdup_printf ( "Key Input Sent: UP (%d)" , pi -> sequence ) ;
}
else if ( pi -> key_val == 13 ) {
comment = g_strdup_printf ( "Key Input Sent: DOWN (%d)" , pi -> sequence ) ;
}
else if ( pi -> key_val == 14 ) {
comment = g_strdup_printf ( "Key Input Sent: RIGHT (%d)" , pi -> sequence ) ;
}
else if ( pi -> key_val == 15 ) {
if ( pi -> key_buffer != NULL ) {
g_string_assign ( g_tmp , pi -> key_buffer ) ;
g_string_truncate ( g_tmp , g_tmp -> len - 1 ) ;
tmp_unistim_info -> key_buffer = g_strdup ( g_tmp -> str ) ;
}
comment = g_strdup_printf ( "Key Input Sent: LEFT (%d)" , pi -> sequence ) ;
}
else if ( pi -> key_val == 20 ) {
comment = g_strdup_printf ( "Key Input Sent: S0 (%d)" , pi -> sequence ) ;
}
else if ( pi -> key_val == 21 ) {
comment = g_strdup_printf ( "Key Input Sent: S1 (%d)" , pi -> sequence ) ;
}
else if ( pi -> key_val == 22 ) {
if ( pi -> key_buffer != NULL ) {
g_string_assign ( g_tmp , pi -> key_buffer ) ;
g_string_truncate ( g_tmp , g_tmp -> len - 1 ) ;
tmp_unistim_info -> key_buffer = g_strdup ( g_tmp -> str ) ;
}
comment = g_strdup_printf ( "Key Input Sent: S2 (%d)" , pi -> sequence ) ;
}
else if ( pi -> key_val == 28 ) {
comment = g_strdup_printf ( "Key Input Sent: Release (%d)" , pi -> sequence ) ;
}
else if ( pi -> key_val == 23 ) {
tmp_unistim_info -> key_buffer = g_strdup ( "\n" ) ;
comment = g_strdup_printf ( "Key Input Sent: S3 (%d)" , pi -> sequence ) ;
}
else if ( pi -> key_val == 27 ) {
comment = g_strdup_printf ( "Key Input Sent: Hold (%d)" , pi -> sequence ) ;
}
else if ( pi -> key_val == 29 ) {
comment = g_strdup_printf ( "Key Input Sent: Mute (%d)" , pi -> sequence ) ;
}
else if ( pi -> key_val == 30 ) {
comment = g_strdup_printf ( "Key Input Sent: Headset (%d)" , pi -> sequence ) ;
}
else if ( pi -> key_val == 31 ) {
comment = g_strdup_printf ( "Key Input Sent: Handsfree (%d)" , pi -> sequence ) ;
}
else if ( pi -> key_val >= 32 && pi -> key_val <= 56 ) {
comment = g_strdup_printf ( "Key Input Sent: Prog%d (%d)" , ( pi -> key_val & 31 ) , pi -> sequence ) ;
}
if ( pi -> key_val != - 1 ) {
frame_label = "KEY INPUT" ;
if ( comment == NULL ) comment = g_strdup_printf ( "Key Input Sent: UNKNOWN - %d (%d)" , pi -> key_val , pi -> sequence ) ;
add_to_graph ( tapinfo , pinfo , frame_label , comment , callsinfo -> call_num , & ( pinfo -> src ) , & ( pinfo -> dst ) , 1 ) ;
g_free ( comment ) ;
}
if ( pi -> hook_state == 1 ) {
frame_label = "OFF HOOK" ;
comment = g_strdup_printf ( "Off Hook (%d)" , pi -> sequence ) ;
add_to_graph ( tapinfo , pinfo , frame_label , comment , callsinfo -> call_num , & ( pinfo -> src ) , & ( pinfo -> dst ) , 1 ) ;
g_free ( comment ) ;
}
else if ( pi -> hook_state == 0 ) {
frame_label = "ON HOOK" ;
comment = g_strdup_printf ( "On Hook (%d)" , pi -> sequence ) ;
add_to_graph ( tapinfo , pinfo , frame_label , comment , callsinfo -> call_num , & ( pinfo -> src ) , & ( pinfo -> dst ) , 1 ) ;
g_free ( comment ) ;
}
}
if ( pi -> stream_connect == 1 && callsinfo != NULL ) {
callsinfo -> start_fd = pinfo -> fd ;
callsinfo -> start_rel_ts = pinfo -> rel_ts ;
callsinfo -> stop_fd = pinfo -> fd ;
callsinfo -> stop_rel_ts = pinfo -> rel_ts ;
++ ( callsinfo -> npackets ) ;
++ ( tapinfo -> npackets ) ;
if ( tmp_unistim_info -> key_buffer != NULL ) {
callsinfo -> to_identity = g_strdup_printf ( "?? %s" , tmp_unistim_info -> key_buffer ) ;
}
tmp_unistim_info -> sequence = pi -> sequence ;
callsinfo -> call_active_state = VOIP_ACTIVE ;
callsinfo -> call_state = VOIP_IN_CALL ;
frame_label = "STREAM OPENED" ;
comment = g_strdup_printf ( "Stream Opened (%d)" , pi -> sequence ) ;
add_to_graph ( tapinfo , pinfo , frame_label , comment , callsinfo -> call_num , & ( pinfo -> src ) , & ( pinfo -> dst ) , 1 ) ;
}
else if ( pi -> stream_connect == 1 && callsinfo == NULL ) {
callsinfo = ( voip_calls_info_t * ) g_malloc0 ( sizeof ( voip_calls_info_t ) ) ;
callsinfo -> call_active_state = VOIP_ACTIVE ;
callsinfo -> call_state = VOIP_CALL_SETUP ;
callsinfo -> from_identity = g_strdup ( "UNKNOWN" ) ;
callsinfo -> to_identity = g_strdup ( "UNKNOWN" ) ;
COPY_ADDRESS ( & ( callsinfo -> initial_speaker ) , & ( pinfo -> src ) ) ;
callsinfo -> selected = FALSE ;
callsinfo -> start_fd = pinfo -> fd ;
callsinfo -> start_rel_ts = pinfo -> rel_ts ;
callsinfo -> protocol = VOIP_UNISTIM ;
callsinfo -> prot_info = g_malloc ( sizeof ( unistim_info_t ) ) ;
tmp_unistim_info = ( unistim_info_t * ) callsinfo -> prot_info ;
tmp_unistim_info -> rudp_type = 0 ;
tmp_unistim_info -> payload_type = 0 ;
tmp_unistim_info -> sequence = pi -> sequence ;
tmp_unistim_info -> termid = 0 ;
tmp_unistim_info -> key_val = - 1 ;
tmp_unistim_info -> key_state = - 1 ;
tmp_unistim_info -> hook_state = - 1 ;
tmp_unistim_info -> stream_connect = - 1 ;
tmp_unistim_info -> trans_connect = - 1 ;
tmp_unistim_info -> set_termid = - 1 ;
tmp_unistim_info -> string_data = NULL ;
tmp_unistim_info -> key_buffer = NULL ;
COPY_ADDRESS ( & ( tmp_unistim_info -> it_ip ) , & ( pi -> it_ip ) ) ;
COPY_ADDRESS ( & ( tmp_unistim_info -> ni_ip ) , & ( pi -> ni_ip ) ) ;
tmp_unistim_info -> it_port = pi -> it_port ;
callsinfo -> free_prot_info = g_free ;
callsinfo -> npackets = 0 ;
callsinfo -> call_num = tapinfo -> ncalls ++ ;
tapinfo -> callsinfo_list = g_list_prepend ( tapinfo -> callsinfo_list , callsinfo ) ;
callsinfo -> stop_fd = pinfo -> fd ;
callsinfo -> stop_rel_ts = pinfo -> rel_ts ;
++ ( callsinfo -> npackets ) ;
++ ( tapinfo -> npackets ) ;
if ( tmp_unistim_info -> key_buffer != NULL ) {
callsinfo -> to_identity = g_strdup_printf ( "?? %s" , tmp_unistim_info -> key_buffer ) ;
}
tmp_unistim_info -> sequence = pi -> sequence ;
callsinfo -> call_active_state = VOIP_ACTIVE ;
callsinfo -> call_state = VOIP_IN_CALL ;
frame_label = "STREAM OPENED" ;
comment = g_strdup_printf ( "Stream Opened (%d)" , pi -> sequence ) ;
add_to_graph ( tapinfo , pinfo , frame_label , comment , callsinfo -> call_num , & ( pinfo -> src ) , & ( pinfo -> dst ) , 1 ) ;
}
else if ( pi -> stream_connect == 0 && callsinfo != NULL ) {
callsinfo -> stop_fd = pinfo -> fd ;
callsinfo -> stop_rel_ts = pinfo -> rel_ts ;
tmp_unistim_info -> sequence = pi -> sequence ;
if ( callsinfo -> call_state == VOIP_IN_CALL ) {
callsinfo -> call_active_state = VOIP_INACTIVE ;
callsinfo -> call_state = VOIP_COMPLETED ;
}
else {
callsinfo -> call_state = VOIP_UNKNOWN ;
callsinfo -> call_active_state = VOIP_INACTIVE ;
}
frame_label = "STREAM CLOSED" ;
comment = g_strdup_printf ( "Stream Closed (%d)" , pi -> sequence ) ;
add_to_graph ( tapinfo , pinfo , frame_label , comment , callsinfo -> call_num , & ( pinfo -> src ) , & ( pinfo -> dst ) , 1 ) ;
}
else comment = NULL ;
}
else if ( pi -> rudp_type == 1 && callsinfo != NULL ) {
if ( tmp_unistim_info -> sequence == pi -> sequence ) {
frame_label = "ACK" ;
comment = g_strdup_printf ( "ACK for sequence %d" , pi -> sequence ) ;
add_to_graph ( tapinfo , pinfo , frame_label , comment , callsinfo -> call_num , & ( pinfo -> src ) , & ( pinfo -> dst ) , 1 ) ;
}
}
else if ( pi -> rudp_type == 0 && callsinfo != NULL ) {
frame_label = "NAK" ;
comment = g_strdup_printf ( "NAK for sequence %d" , pi -> sequence ) ;
add_to_graph ( tapinfo , pinfo , frame_label , comment , callsinfo -> call_num , & ( pinfo -> src ) , & ( pinfo -> dst ) , 1 ) ;
}
g_free ( comment ) ;
tapinfo -> redraw = TRUE ;
return 1 ;
} |
6,336,384,260,629,386,000 | debian | 14 | 0 | static void dissect_zcl_groups_add_group_or_if_identifying ( tvbuff_t * tvb , proto_tree * tree , guint * offset ) {
guint attr_uint ;
guint8 * attr_string ;
proto_tree_add_item ( tree , hf_zbee_zcl_groups_group_id , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
attr_uint = tvb_get_guint8 ( tvb , * offset ) ;
if ( attr_uint == 0xff ) attr_uint = 0 ;
proto_tree_add_uint ( tree , hf_zbee_zcl_groups_attr_str_len , tvb , * offset , 1 , attr_uint ) ;
* offset += 1 ;
attr_string = tvb_get_string_enc ( wmem_packet_scope ( ) , tvb , * offset , attr_uint , ENC_ASCII ) ;
proto_item_append_text ( tree , ", String: %s" , attr_string ) ;
proto_tree_add_string ( tree , hf_zbee_zcl_groups_attr_str , tvb , * offset , attr_uint , attr_string ) ;
* offset += attr_uint ;
} |
2,125,998,987,781,803,300 | debian | 14 | 0 | static int ReadDiracPictureNumber ( uint32_t * p_picnum , block_t * p_block ) {
uint32_t u_pos = 4 ;
while ( u_pos + 13 < p_block -> i_buffer ) {
if ( p_block -> p_buffer [ u_pos ] & 0x08 ) {
* p_picnum = GetDWBE ( p_block -> p_buffer + u_pos + 9 ) ;
return 1 ;
}
uint32_t u_npo = GetDWBE ( p_block -> p_buffer + u_pos + 1 ) ;
assert ( u_npo <= UINT32_MAX - u_pos ) ;
if ( u_npo == 0 ) u_npo = 13 ;
u_pos += u_npo ;
}
return 0 ;
} |
-9,197,960,073,880,366,000 | debian | 8 | 0 | static int file_eofer ( Gif_Reader * grr ) {
int c = getc ( grr -> f ) ;
if ( c == EOF ) return 1 ;
else {
ungetc ( c , grr -> f ) ;
return 0 ;
}
} |
7,749,168,290,238,235,000 | debian | 21 | 0 | static int test_random_numbers ( xd3_stream * stream , int ignore ) {
usize_t i ;
usize_t sum = 0 ;
usize_t mean = 50 ;
usize_t n_rounds = 1000000 ;
double average , error ;
double allowed_error = 0.1 ;
mt_init ( & static_mtrand , 0x9f73f7fe ) ;
for ( i = 0 ;
i < n_rounds ;
i += 1 ) {
sum += mt_exp_rand ( mean , USIZE_T_MAX ) ;
}
average = ( double ) sum / ( double ) n_rounds ;
error = average - ( double ) mean ;
if ( error < allowed_error && error > - allowed_error ) {
return 0 ;
}
stream -> msg = "random distribution looks broken" ;
return XD3_INTERNAL ;
} |
-7,042,392,412,001,533,000 | debian | 3 | 0 | void pdf_map_range_to_range ( fz_context * ctx , pdf_cmap * cmap , unsigned int low , unsigned int high , int out ) {
add_range ( ctx , cmap , low , high , out , 1 , 0 ) ;
} |
6,302,861,533,225,985,000 | debian | 2 | 0 | static void pxa2xx_fir_event ( void * opaque , int event ) {
} |
-8,589,152,252,830,018,000 | debian | 56 | 0 | static int kwajd_extract ( struct mskwaj_decompressor * base , struct mskwajd_header * hdr , const char * filename ) {
struct mskwaj_decompressor_p * self = ( struct mskwaj_decompressor_p * ) base ;
struct mspack_system * sys ;
struct mspack_file * fh , * outfh ;
if ( ! self ) return MSPACK_ERR_ARGS ;
if ( ! hdr ) return self -> error = MSPACK_ERR_ARGS ;
sys = self -> system ;
fh = ( ( struct mskwajd_header_p * ) hdr ) -> fh ;
if ( sys -> seek ( fh , hdr -> data_offset , MSPACK_SYS_SEEK_START ) ) {
return self -> error = MSPACK_ERR_SEEK ;
}
if ( ! ( outfh = sys -> open ( sys , filename , MSPACK_SYS_OPEN_WRITE ) ) ) {
return self -> error = MSPACK_ERR_OPEN ;
}
self -> error = MSPACK_ERR_OK ;
if ( hdr -> comp_type == MSKWAJ_COMP_NONE || hdr -> comp_type == MSKWAJ_COMP_XOR ) {
unsigned char * buf = ( unsigned char * ) sys -> alloc ( sys , ( size_t ) KWAJ_INPUT_SIZE ) ;
if ( buf ) {
int read , i ;
while ( ( read = sys -> read ( fh , buf , KWAJ_INPUT_SIZE ) ) > 0 ) {
if ( hdr -> comp_type == MSKWAJ_COMP_XOR ) {
for ( i = 0 ;
i < read ;
i ++ ) buf [ i ] ^= 0xFF ;
}
if ( sys -> write ( outfh , buf , read ) != read ) {
self -> error = MSPACK_ERR_WRITE ;
break ;
}
}
if ( read < 0 ) self -> error = MSPACK_ERR_READ ;
sys -> free ( buf ) ;
}
else {
self -> error = MSPACK_ERR_NOMEMORY ;
}
}
else if ( hdr -> comp_type == MSKWAJ_COMP_SZDD ) {
self -> error = lzss_decompress ( sys , fh , outfh , KWAJ_INPUT_SIZE , LZSS_MODE_EXPAND ) ;
}
else if ( hdr -> comp_type == MSKWAJ_COMP_LZH ) {
struct kwajd_stream * lzh = lzh_init ( sys , fh , outfh ) ;
self -> error = ( lzh ) ? lzh_decompress ( lzh ) : MSPACK_ERR_NOMEMORY ;
lzh_free ( lzh ) ;
}
else if ( hdr -> comp_type == MSKWAJ_COMP_MSZIP ) {
struct mszipd_stream * zip = mszipd_init ( sys , fh , outfh , KWAJ_INPUT_SIZE , 0 ) ;
self -> error = ( zip ) ? mszipd_decompress_kwaj ( zip ) : MSPACK_ERR_NOMEMORY ;
mszipd_free ( zip ) ;
}
else {
self -> error = MSPACK_ERR_DATAFORMAT ;
}
sys -> close ( outfh ) ;
return self -> error ;
} |
3,649,198,920,984,613,400 | debian | 12 | 0 | static inline void vmsvga_update_rect_flush ( struct vmsvga_state_s * s ) {
struct vmsvga_rect_s * rect ;
if ( s -> invalidated ) {
s -> redraw_fifo_first = s -> redraw_fifo_last ;
return ;
}
while ( s -> redraw_fifo_first != s -> redraw_fifo_last ) {
rect = & s -> redraw_fifo [ s -> redraw_fifo_first ++ ] ;
s -> redraw_fifo_first &= REDRAW_FIFO_LEN - 1 ;
vmsvga_update_rect ( s , rect -> x , rect -> y , rect -> w , rect -> h ) ;
}
} |
6,080,147,530,626,246,000 | debian | 202 | 0 | static int vc1_decode_p_mb ( VC1Context * v ) {
MpegEncContext * s = & v -> s ;
GetBitContext * gb = & s -> gb ;
int i , j ;
int mb_pos = s -> mb_x + s -> mb_y * s -> mb_stride ;
int cbp ;
int mqdiff , mquant ;
int ttmb = v -> ttfrm ;
int mb_has_coeffs = 1 ;
int dmv_x , dmv_y ;
int index , index1 ;
int val , sign ;
int first_block = 1 ;
int dst_idx , off ;
int skipped , fourmv ;
int block_cbp = 0 , pat , block_tt = 0 , block_intra = 0 ;
mquant = v -> pq ;
if ( v -> mv_type_is_raw ) fourmv = get_bits1 ( gb ) ;
else fourmv = v -> mv_type_mb_plane [ mb_pos ] ;
if ( v -> skip_is_raw ) skipped = get_bits1 ( gb ) ;
else skipped = v -> s . mbskip_table [ mb_pos ] ;
if ( ! fourmv ) {
if ( ! skipped ) {
GET_MVDATA ( dmv_x , dmv_y ) ;
if ( s -> mb_intra ) {
s -> current_picture . motion_val [ 1 ] [ s -> block_index [ 0 ] ] [ 0 ] = 0 ;
s -> current_picture . motion_val [ 1 ] [ s -> block_index [ 0 ] ] [ 1 ] = 0 ;
}
s -> current_picture . mb_type [ mb_pos ] = s -> mb_intra ? MB_TYPE_INTRA : MB_TYPE_16x16 ;
vc1_pred_mv ( v , 0 , dmv_x , dmv_y , 1 , v -> range_x , v -> range_y , v -> mb_type [ 0 ] , 0 , 0 ) ;
if ( s -> mb_intra && ! mb_has_coeffs ) {
GET_MQUANT ( ) ;
s -> ac_pred = get_bits1 ( gb ) ;
cbp = 0 ;
}
else if ( mb_has_coeffs ) {
if ( s -> mb_intra ) s -> ac_pred = get_bits1 ( gb ) ;
cbp = get_vlc2 ( & v -> s . gb , v -> cbpcy_vlc -> table , VC1_CBPCY_P_VLC_BITS , 2 ) ;
GET_MQUANT ( ) ;
}
else {
mquant = v -> pq ;
cbp = 0 ;
}
s -> current_picture . qscale_table [ mb_pos ] = mquant ;
if ( ! v -> ttmbf && ! s -> mb_intra && mb_has_coeffs ) ttmb = get_vlc2 ( gb , ff_vc1_ttmb_vlc [ v -> tt_index ] . table , VC1_TTMB_VLC_BITS , 2 ) ;
if ( ! s -> mb_intra ) vc1_mc_1mv ( v , 0 ) ;
dst_idx = 0 ;
for ( i = 0 ;
i < 6 ;
i ++ ) {
s -> dc_val [ 0 ] [ s -> block_index [ i ] ] = 0 ;
dst_idx += i >> 2 ;
val = ( ( cbp >> ( 5 - i ) ) & 1 ) ;
off = ( i & 4 ) ? 0 : ( ( i & 1 ) * 8 + ( i & 2 ) * 4 * s -> linesize ) ;
v -> mb_type [ 0 ] [ s -> block_index [ i ] ] = s -> mb_intra ;
if ( s -> mb_intra ) {
v -> a_avail = v -> c_avail = 0 ;
if ( i == 2 || i == 3 || ! s -> first_slice_line ) v -> a_avail = v -> mb_type [ 0 ] [ s -> block_index [ i ] - s -> block_wrap [ i ] ] ;
if ( i == 1 || i == 3 || s -> mb_x ) v -> c_avail = v -> mb_type [ 0 ] [ s -> block_index [ i ] - 1 ] ;
vc1_decode_intra_block ( v , s -> block [ i ] , i , val , mquant , ( i & 4 ) ? v -> codingset2 : v -> codingset ) ;
if ( ( i > 3 ) && ( s -> flags & CODEC_FLAG_GRAY ) ) continue ;
v -> vc1dsp . vc1_inv_trans_8x8 ( s -> block [ i ] ) ;
if ( v -> rangeredfrm ) for ( j = 0 ;
j < 64 ;
j ++ ) s -> block [ i ] [ j ] <<= 1 ;
s -> dsp . put_signed_pixels_clamped ( s -> block [ i ] , s -> dest [ dst_idx ] + off , i & 4 ? s -> uvlinesize : s -> linesize ) ;
if ( v -> pq >= 9 && v -> overlap ) {
if ( v -> c_avail ) v -> vc1dsp . vc1_h_overlap ( s -> dest [ dst_idx ] + off , i & 4 ? s -> uvlinesize : s -> linesize ) ;
if ( v -> a_avail ) v -> vc1dsp . vc1_v_overlap ( s -> dest [ dst_idx ] + off , i & 4 ? s -> uvlinesize : s -> linesize ) ;
}
block_cbp |= 0xF << ( i << 2 ) ;
block_intra |= 1 << i ;
}
else if ( val ) {
pat = vc1_decode_p_block ( v , s -> block [ i ] , i , mquant , ttmb , first_block , s -> dest [ dst_idx ] + off , ( i & 4 ) ? s -> uvlinesize : s -> linesize , ( i & 4 ) && ( s -> flags & CODEC_FLAG_GRAY ) , & block_tt ) ;
block_cbp |= pat << ( i << 2 ) ;
if ( ! v -> ttmbf && ttmb < 8 ) ttmb = - 1 ;
first_block = 0 ;
}
}
}
else {
s -> mb_intra = 0 ;
for ( i = 0 ;
i < 6 ;
i ++ ) {
v -> mb_type [ 0 ] [ s -> block_index [ i ] ] = 0 ;
s -> dc_val [ 0 ] [ s -> block_index [ i ] ] = 0 ;
}
s -> current_picture . mb_type [ mb_pos ] = MB_TYPE_SKIP ;
s -> current_picture . qscale_table [ mb_pos ] = 0 ;
vc1_pred_mv ( v , 0 , 0 , 0 , 1 , v -> range_x , v -> range_y , v -> mb_type [ 0 ] , 0 , 0 ) ;
vc1_mc_1mv ( v , 0 ) ;
}
}
else {
if ( ! skipped ) {
int intra_count = 0 , coded_inter = 0 ;
int is_intra [ 6 ] , is_coded [ 6 ] ;
cbp = get_vlc2 ( & v -> s . gb , v -> cbpcy_vlc -> table , VC1_CBPCY_P_VLC_BITS , 2 ) ;
for ( i = 0 ;
i < 6 ;
i ++ ) {
val = ( ( cbp >> ( 5 - i ) ) & 1 ) ;
s -> dc_val [ 0 ] [ s -> block_index [ i ] ] = 0 ;
s -> mb_intra = 0 ;
if ( i < 4 ) {
dmv_x = dmv_y = 0 ;
s -> mb_intra = 0 ;
mb_has_coeffs = 0 ;
if ( val ) {
GET_MVDATA ( dmv_x , dmv_y ) ;
}
vc1_pred_mv ( v , i , dmv_x , dmv_y , 0 , v -> range_x , v -> range_y , v -> mb_type [ 0 ] , 0 , 0 ) ;
if ( ! s -> mb_intra ) vc1_mc_4mv_luma ( v , i , 0 ) ;
intra_count += s -> mb_intra ;
is_intra [ i ] = s -> mb_intra ;
is_coded [ i ] = mb_has_coeffs ;
}
if ( i & 4 ) {
is_intra [ i ] = ( intra_count >= 3 ) ;
is_coded [ i ] = val ;
}
if ( i == 4 ) vc1_mc_4mv_chroma ( v , 0 ) ;
v -> mb_type [ 0 ] [ s -> block_index [ i ] ] = is_intra [ i ] ;
if ( ! coded_inter ) coded_inter = ! is_intra [ i ] & is_coded [ i ] ;
}
dst_idx = 0 ;
if ( ! intra_count && ! coded_inter ) goto end ;
GET_MQUANT ( ) ;
s -> current_picture . qscale_table [ mb_pos ] = mquant ;
{
int intrapred = 0 ;
for ( i = 0 ;
i < 6 ;
i ++ ) if ( is_intra [ i ] ) {
if ( ( ( ! s -> first_slice_line || ( i == 2 || i == 3 ) ) && v -> mb_type [ 0 ] [ s -> block_index [ i ] - s -> block_wrap [ i ] ] ) || ( ( s -> mb_x || ( i == 1 || i == 3 ) ) && v -> mb_type [ 0 ] [ s -> block_index [ i ] - 1 ] ) ) {
intrapred = 1 ;
break ;
}
}
if ( intrapred ) s -> ac_pred = get_bits1 ( gb ) ;
else s -> ac_pred = 0 ;
}
if ( ! v -> ttmbf && coded_inter ) ttmb = get_vlc2 ( gb , ff_vc1_ttmb_vlc [ v -> tt_index ] . table , VC1_TTMB_VLC_BITS , 2 ) ;
for ( i = 0 ;
i < 6 ;
i ++ ) {
dst_idx += i >> 2 ;
off = ( i & 4 ) ? 0 : ( ( i & 1 ) * 8 + ( i & 2 ) * 4 * s -> linesize ) ;
s -> mb_intra = is_intra [ i ] ;
if ( is_intra [ i ] ) {
v -> a_avail = v -> c_avail = 0 ;
if ( i == 2 || i == 3 || ! s -> first_slice_line ) v -> a_avail = v -> mb_type [ 0 ] [ s -> block_index [ i ] - s -> block_wrap [ i ] ] ;
if ( i == 1 || i == 3 || s -> mb_x ) v -> c_avail = v -> mb_type [ 0 ] [ s -> block_index [ i ] - 1 ] ;
vc1_decode_intra_block ( v , s -> block [ i ] , i , is_coded [ i ] , mquant , ( i & 4 ) ? v -> codingset2 : v -> codingset ) ;
if ( ( i > 3 ) && ( s -> flags & CODEC_FLAG_GRAY ) ) continue ;
v -> vc1dsp . vc1_inv_trans_8x8 ( s -> block [ i ] ) ;
if ( v -> rangeredfrm ) for ( j = 0 ;
j < 64 ;
j ++ ) s -> block [ i ] [ j ] <<= 1 ;
s -> dsp . put_signed_pixels_clamped ( s -> block [ i ] , s -> dest [ dst_idx ] + off , ( i & 4 ) ? s -> uvlinesize : s -> linesize ) ;
if ( v -> pq >= 9 && v -> overlap ) {
if ( v -> c_avail ) v -> vc1dsp . vc1_h_overlap ( s -> dest [ dst_idx ] + off , i & 4 ? s -> uvlinesize : s -> linesize ) ;
if ( v -> a_avail ) v -> vc1dsp . vc1_v_overlap ( s -> dest [ dst_idx ] + off , i & 4 ? s -> uvlinesize : s -> linesize ) ;
}
block_cbp |= 0xF << ( i << 2 ) ;
block_intra |= 1 << i ;
}
else if ( is_coded [ i ] ) {
pat = vc1_decode_p_block ( v , s -> block [ i ] , i , mquant , ttmb , first_block , s -> dest [ dst_idx ] + off , ( i & 4 ) ? s -> uvlinesize : s -> linesize , ( i & 4 ) && ( s -> flags & CODEC_FLAG_GRAY ) , & block_tt ) ;
block_cbp |= pat << ( i << 2 ) ;
if ( ! v -> ttmbf && ttmb < 8 ) ttmb = - 1 ;
first_block = 0 ;
}
}
}
else {
s -> mb_intra = 0 ;
s -> current_picture . qscale_table [ mb_pos ] = 0 ;
for ( i = 0 ;
i < 6 ;
i ++ ) {
v -> mb_type [ 0 ] [ s -> block_index [ i ] ] = 0 ;
s -> dc_val [ 0 ] [ s -> block_index [ i ] ] = 0 ;
}
for ( i = 0 ;
i < 4 ;
i ++ ) {
vc1_pred_mv ( v , i , 0 , 0 , 0 , v -> range_x , v -> range_y , v -> mb_type [ 0 ] , 0 , 0 ) ;
vc1_mc_4mv_luma ( v , i , 0 ) ;
}
vc1_mc_4mv_chroma ( v , 0 ) ;
s -> current_picture . qscale_table [ mb_pos ] = 0 ;
}
}
end : v -> cbp [ s -> mb_x ] = block_cbp ;
v -> ttblk [ s -> mb_x ] = block_tt ;
v -> is_intra [ s -> mb_x ] = block_intra ;
return 0 ;
} |