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,461,782,184,979,846,000 | chrome | 8 | 0 | TEST_F ( ProtocolHandlerRegistryTest , TestReplaceHandler ) {
ProtocolHandler ph1 = CreateProtocolHandler ( "mailto" , GURL ( "http://test.com/%s" ) ) ;
ProtocolHandler ph2 = CreateProtocolHandler ( "mailto" , GURL ( "http://test.com/updated-url/%s" ) ) ;
registry ( ) -> OnAcceptRegisterProtocolHandler ( ph1 ) ;
ASSERT_TRUE ( registry ( ) -> AttemptReplace ( ph2 ) ) ;
const ProtocolHandler & handler ( registry ( ) -> GetHandlerFor ( "mailto" ) ) ;
ASSERT_EQ ( handler . url ( ) , ph2 . url ( ) ) ;
} |
-2,386,031,673,786,599,400 | debian | 37 | 0 | static gpgme_error_t gpgsm_sign ( void * engine , gpgme_data_t in , gpgme_data_t out , gpgme_sig_mode_t mode , int use_armor , int use_textmode , int include_certs , gpgme_ctx_t ctx ) {
engine_gpgsm_t gpgsm = engine ;
gpgme_error_t err ;
char * assuan_cmd ;
int i ;
gpgme_key_t key ;
if ( ! gpgsm ) return gpg_error ( GPG_ERR_INV_VALUE ) ;
if ( include_certs != GPGME_INCLUDE_CERTS_DEFAULT ) {
if ( asprintf ( & assuan_cmd , "OPTION include-certs %i" , include_certs ) < 0 ) return gpg_error_from_syserror ( ) ;
err = gpgsm_assuan_simple_command ( gpgsm -> assuan_ctx , assuan_cmd , NULL , NULL ) ;
free ( assuan_cmd ) ;
if ( err ) return err ;
}
for ( i = 0 ;
( key = gpgme_signers_enum ( ctx , i ) ) ;
i ++ ) {
const char * s = key -> subkeys ? key -> subkeys -> fpr : NULL ;
if ( s && strlen ( s ) < 80 ) {
char buf [ 100 ] ;
strcpy ( stpcpy ( buf , "SIGNER " ) , s ) ;
err = gpgsm_assuan_simple_command ( gpgsm -> assuan_ctx , buf , gpgsm -> status . fnc , gpgsm -> status . fnc_value ) ;
}
else err = gpg_error ( GPG_ERR_INV_VALUE ) ;
gpgme_key_unref ( key ) ;
if ( err ) return err ;
}
gpgsm -> input_cb . data = in ;
err = gpgsm_set_fd ( gpgsm , INPUT_FD , map_data_enc ( gpgsm -> input_cb . data ) ) ;
if ( err ) return err ;
gpgsm -> output_cb . data = out ;
err = gpgsm_set_fd ( gpgsm , OUTPUT_FD , use_armor ? "--armor" : map_data_enc ( gpgsm -> output_cb . data ) ) ;
if ( err ) return err ;
gpgsm_clear_fd ( gpgsm , MESSAGE_FD ) ;
gpgsm -> inline_data = NULL ;
err = start ( gpgsm , mode == GPGME_SIG_MODE_DETACH ? "SIGN --detached" : "SIGN" ) ;
return err ;
} |
6,511,303,611,138,191,000 | debian | 66 | 1 | static void parse_mb_skip ( Wmv2Context * w ) {
int mb_x , mb_y ;
MpegEncContext * const s = & w -> s ;
uint32_t * const mb_type = s -> current_picture_ptr -> f . mb_type ;
w -> skip_type = get_bits ( & s -> gb , 2 ) ;
switch ( w -> skip_type ) {
case SKIP_TYPE_NONE : for ( mb_y = 0 ;
mb_y < s -> mb_height ;
mb_y ++ ) {
for ( mb_x = 0 ;
mb_x < s -> mb_width ;
mb_x ++ ) {
mb_type [ mb_y * s -> mb_stride + mb_x ] = MB_TYPE_16x16 | MB_TYPE_L0 ;
}
}
break ;
case SKIP_TYPE_MPEG : for ( mb_y = 0 ;
mb_y < s -> mb_height ;
mb_y ++ ) {
for ( mb_x = 0 ;
mb_x < s -> mb_width ;
mb_x ++ ) {
mb_type [ mb_y * s -> mb_stride + mb_x ] = ( get_bits1 ( & s -> gb ) ? MB_TYPE_SKIP : 0 ) | MB_TYPE_16x16 | MB_TYPE_L0 ;
}
}
break ;
case SKIP_TYPE_ROW : for ( mb_y = 0 ;
mb_y < s -> mb_height ;
mb_y ++ ) {
if ( get_bits1 ( & s -> gb ) ) {
for ( mb_x = 0 ;
mb_x < s -> mb_width ;
mb_x ++ ) {
mb_type [ mb_y * s -> mb_stride + mb_x ] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0 ;
}
}
else {
for ( mb_x = 0 ;
mb_x < s -> mb_width ;
mb_x ++ ) {
mb_type [ mb_y * s -> mb_stride + mb_x ] = ( get_bits1 ( & s -> gb ) ? MB_TYPE_SKIP : 0 ) | MB_TYPE_16x16 | MB_TYPE_L0 ;
}
}
}
break ;
case SKIP_TYPE_COL : for ( mb_x = 0 ;
mb_x < s -> mb_width ;
mb_x ++ ) {
if ( get_bits1 ( & s -> gb ) ) {
for ( mb_y = 0 ;
mb_y < s -> mb_height ;
mb_y ++ ) {
mb_type [ mb_y * s -> mb_stride + mb_x ] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0 ;
}
}
else {
for ( mb_y = 0 ;
mb_y < s -> mb_height ;
mb_y ++ ) {
mb_type [ mb_y * s -> mb_stride + mb_x ] = ( get_bits1 ( & s -> gb ) ? MB_TYPE_SKIP : 0 ) | MB_TYPE_16x16 | MB_TYPE_L0 ;
}
}
}
break ;
}
} |
8,206,514,580,434,226,000 | chrome | 13 | 0 | IN_PROC_BROWSER_TEST_F ( HttpsEngagementPageLoadMetricsBrowserTest , Simple_Http ) {
StartHttpServer ( ) ;
base : : TimeDelta upper_bound = NavigateInForegroundAndCloseWithTiming ( http_test_server_ -> GetURL ( "/simple.html" ) ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHttpEngagementHistogram , 1 ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHttpsEngagementHistogram , 0 ) ;
int32_t bucket_min = histogram_tester_ . GetAllSamples ( internal : : kHttpEngagementHistogram ) [ 0 ] . min ;
EXPECT_GE ( upper_bound . InMilliseconds ( ) , bucket_min ) ;
EXPECT_LT ( 0 , bucket_min ) ;
FakeUserMetricsUpload ( ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHttpsEngagementSessionPercentage , 1 ) ;
int32_t ratio_bucket = histogram_tester_ . GetAllSamples ( internal : : kHttpsEngagementSessionPercentage ) [ 0 ] . min ;
EXPECT_EQ ( 0 , ratio_bucket ) ;
} |
-3,337,205,971,666,909,000 | debian | 155 | 0 | int qtmd_decompress ( struct qtmd_stream * qtm , off_t out_bytes ) {
unsigned int frame_todo , frame_end , window_posn , match_offset , range ;
unsigned char * window , * i_ptr , * i_end , * runsrc , * rundest ;
int i , j , selector , extra , sym , match_length ;
unsigned short H , L , C , symf ;
register unsigned int bit_buffer ;
register unsigned char bits_left ;
if ( ! qtm || ( out_bytes < 0 ) ) return MSPACK_ERR_ARGS ;
if ( qtm -> error ) return qtm -> error ;
i = qtm -> o_end - qtm -> o_ptr ;
if ( ( off_t ) i > out_bytes ) i = ( int ) out_bytes ;
if ( i ) {
if ( qtm -> sys -> write ( qtm -> output , qtm -> o_ptr , i ) != i ) {
return qtm -> error = MSPACK_ERR_WRITE ;
}
qtm -> o_ptr += i ;
out_bytes -= i ;
}
if ( out_bytes == 0 ) return MSPACK_ERR_OK ;
RESTORE_BITS ;
window = qtm -> window ;
window_posn = qtm -> window_posn ;
frame_todo = qtm -> frame_todo ;
H = qtm -> H ;
L = qtm -> L ;
C = qtm -> C ;
while ( ( qtm -> o_end - qtm -> o_ptr ) < out_bytes ) {
if ( ! qtm -> header_read ) {
H = 0xFFFF ;
L = 0 ;
READ_BITS ( C , 16 ) ;
qtm -> header_read = 1 ;
}
frame_end = window_posn + ( out_bytes - ( qtm -> o_end - qtm -> o_ptr ) ) ;
if ( ( window_posn + frame_todo ) < frame_end ) {
frame_end = window_posn + frame_todo ;
}
if ( frame_end > qtm -> window_size ) {
frame_end = qtm -> window_size ;
}
while ( window_posn < frame_end ) {
GET_SYMBOL ( qtm -> model7 , selector ) ;
if ( selector < 4 ) {
struct qtmd_model * mdl = ( selector == 0 ) ? & qtm -> model0 : ( ( selector == 1 ) ? & qtm -> model1 : ( ( selector == 2 ) ? & qtm -> model2 : & qtm -> model3 ) ) ;
GET_SYMBOL ( ( * mdl ) , sym ) ;
window [ window_posn ++ ] = sym ;
frame_todo -- ;
}
else {
switch ( selector ) {
case 4 : GET_SYMBOL ( qtm -> model4 , sym ) ;
READ_MANY_BITS ( extra , extra_bits [ sym ] ) ;
match_offset = position_base [ sym ] + extra + 1 ;
match_length = 3 ;
break ;
case 5 : GET_SYMBOL ( qtm -> model5 , sym ) ;
READ_MANY_BITS ( extra , extra_bits [ sym ] ) ;
match_offset = position_base [ sym ] + extra + 1 ;
match_length = 4 ;
break ;
case 6 : GET_SYMBOL ( qtm -> model6len , sym ) ;
READ_MANY_BITS ( extra , length_extra [ sym ] ) ;
match_length = length_base [ sym ] + extra + 5 ;
GET_SYMBOL ( qtm -> model6 , sym ) ;
READ_MANY_BITS ( extra , extra_bits [ sym ] ) ;
match_offset = position_base [ sym ] + extra + 1 ;
break ;
default : D ( ( "got %d from selector" , selector ) ) return qtm -> error = MSPACK_ERR_DECRUNCH ;
}
rundest = & window [ window_posn ] ;
frame_todo -= match_length ;
if ( ( window_posn + match_length ) > qtm -> window_size ) {
i = qtm -> window_size - window_posn ;
j = window_posn - match_offset ;
while ( i -- ) * rundest ++ = window [ j ++ & ( qtm -> window_size - 1 ) ] ;
i = ( & window [ qtm -> window_size ] - qtm -> o_ptr ) ;
if ( i > out_bytes ) {
D ( ( "during window-wrap match;
%d bytes to flush but only need %d" , i , ( int ) out_bytes ) ) return qtm -> error = MSPACK_ERR_DECRUNCH ;
}
if ( qtm -> sys -> write ( qtm -> output , qtm -> o_ptr , i ) != i ) {
return qtm -> error = MSPACK_ERR_WRITE ;
}
out_bytes -= i ;
qtm -> o_ptr = & window [ 0 ] ;
qtm -> o_end = & window [ 0 ] ;
rundest = & window [ 0 ] ;
i = match_length - ( qtm -> window_size - window_posn ) ;
while ( i -- ) * rundest ++ = window [ j ++ & ( qtm -> window_size - 1 ) ] ;
window_posn = window_posn + match_length - qtm -> window_size ;
break ;
}
else {
i = match_length ;
if ( match_offset > window_posn ) {
j = match_offset - window_posn ;
if ( j > ( int ) qtm -> window_size ) {
D ( ( "match offset beyond window boundaries" ) ) return qtm -> error = MSPACK_ERR_DECRUNCH ;
}
runsrc = & window [ qtm -> window_size - j ] ;
if ( j < i ) {
i -= j ;
while ( j -- > 0 ) * rundest ++ = * runsrc ++ ;
runsrc = window ;
}
while ( i -- > 0 ) * rundest ++ = * runsrc ++ ;
}
else {
runsrc = rundest - match_offset ;
while ( i -- > 0 ) * rundest ++ = * runsrc ++ ;
}
window_posn += match_length ;
}
}
}
qtm -> o_end = & window [ window_posn ] ;
if ( frame_todo > QTM_FRAME_SIZE ) {
D ( ( "overshot frame alignment" ) ) return qtm -> error = MSPACK_ERR_DECRUNCH ;
}
if ( frame_todo == 0 ) {
if ( bits_left & 7 ) REMOVE_BITS ( bits_left & 7 ) ;
do {
READ_BITS ( i , 8 ) ;
}
while ( i != 0xFF ) ;
qtm -> header_read = 0 ;
frame_todo = QTM_FRAME_SIZE ;
}
if ( window_posn == qtm -> window_size ) {
i = ( qtm -> o_end - qtm -> o_ptr ) ;
if ( i >= out_bytes ) break ;
if ( qtm -> sys -> write ( qtm -> output , qtm -> o_ptr , i ) != i ) {
return qtm -> error = MSPACK_ERR_WRITE ;
}
out_bytes -= i ;
qtm -> o_ptr = & window [ 0 ] ;
qtm -> o_end = & window [ 0 ] ;
window_posn = 0 ;
}
}
if ( out_bytes ) {
i = ( int ) out_bytes ;
if ( qtm -> sys -> write ( qtm -> output , qtm -> o_ptr , i ) != i ) {
return qtm -> error = MSPACK_ERR_WRITE ;
}
qtm -> o_ptr += i ;
}
STORE_BITS ;
qtm -> window_posn = window_posn ;
qtm -> frame_todo = frame_todo ;
qtm -> H = H ;
qtm -> L = L ;
qtm -> C = C ;
return MSPACK_ERR_OK ;
} |
7,092,216,800,726,730,000 | debian | 5 | 0 | static int dissect_h245_MasterSlaveDeterminationReject ( 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_MasterSlaveDeterminationReject , MasterSlaveDeterminationReject_sequence ) ;
# line 536 "../../asn1/h245/h245.cnf" if ( h245_pi != NULL ) h245_pi -> msg_type = H245_MastSlvDetRjc ;
return offset ;
} |
1,414,661,670,117,003,800 | debian | 15 | 0 | static int should_include ( struct commit * commit , void * _data ) {
struct include_data * data = _data ;
int bitmap_pos ;
bitmap_pos = bitmap_position ( commit -> object . oid . hash ) ;
if ( bitmap_pos < 0 ) bitmap_pos = ext_index_add_object ( ( struct object * ) commit , NULL ) ;
if ( ! add_to_include_set ( data , commit -> object . oid . hash , bitmap_pos ) ) {
struct commit_list * parent = commit -> parents ;
while ( parent ) {
parent -> item -> object . flags |= SEEN ;
parent = parent -> next ;
}
return 0 ;
}
return 1 ;
} |
-4,136,373,206,107,992,600 | chrome | 8 | 0 | static void U_CALLCONV _ISCIIClose ( UConverter * cnv ) {
if ( cnv -> extraInfo != NULL ) {
if ( ! cnv -> isExtraLocal ) {
uprv_free ( cnv -> extraInfo ) ;
}
cnv -> extraInfo = NULL ;
}
} |
-1,111,775,978,048,960,300 | chrome | 10 | 0 | TEST_F ( BrowsingDataRemoverImplTest , RemoveQuotaManagedDataForLastHour ) {
BlockUntilBrowsingDataRemoved ( AnHourAgo ( ) , base : : Time : : Max ( ) , BrowsingDataRemover : : REMOVE_FILE_SYSTEMS | BrowsingDataRemover : : REMOVE_WEBSQL | BrowsingDataRemover : : REMOVE_APPCACHE | BrowsingDataRemover : : REMOVE_SERVICE_WORKERS | BrowsingDataRemover : : REMOVE_CACHE_STORAGE | BrowsingDataRemover : : REMOVE_INDEXEDDB , false ) ;
EXPECT_EQ ( BrowsingDataRemover : : REMOVE_FILE_SYSTEMS | BrowsingDataRemover : : REMOVE_WEBSQL | BrowsingDataRemover : : REMOVE_APPCACHE | BrowsingDataRemover : : REMOVE_SERVICE_WORKERS | BrowsingDataRemover : : REMOVE_CACHE_STORAGE | BrowsingDataRemover : : REMOVE_INDEXEDDB , GetRemovalMask ( ) ) ;
EXPECT_EQ ( BrowsingDataHelper : : UNPROTECTED_WEB , GetOriginTypeMask ( ) ) ;
StoragePartitionRemovalData removal_data = GetStoragePartitionRemovalData ( ) ;
EXPECT_EQ ( removal_data . remove_mask , StoragePartition : : REMOVE_DATA_MASK_FILE_SYSTEMS | StoragePartition : : REMOVE_DATA_MASK_WEBSQL | StoragePartition : : REMOVE_DATA_MASK_APPCACHE | StoragePartition : : REMOVE_DATA_MASK_SERVICE_WORKERS | StoragePartition : : REMOVE_DATA_MASK_CACHE_STORAGE | StoragePartition : : REMOVE_DATA_MASK_INDEXEDDB ) ;
uint32_t expected_quota_mask = ~ StoragePartition : : QUOTA_MANAGED_STORAGE_MASK_PERSISTENT ;
EXPECT_EQ ( removal_data . quota_storage_remove_mask , expected_quota_mask ) ;
EXPECT_EQ ( removal_data . remove_begin , GetBeginTime ( ) ) ;
} |
-2,908,211,205,972,632,000 | debian | 41 | 0 | static int try_shrink_upper ( MAIN_WINDOW_REC * window , int count ) {
MAIN_WINDOW_REC * shrink_win ;
shrink_win = mainwindows_find_upper ( window ) ;
if ( shrink_win != NULL ) {
int ok ;
GSList * shrink_list , * tmp ;
MAIN_WINDOW_REC * win ;
ok = TRUE ;
shrink_list = mainwindows_get_line ( shrink_win ) ;
for ( tmp = shrink_list ;
tmp != NULL ;
tmp = tmp -> next ) {
win = tmp -> data ;
if ( MAIN_WINDOW_TEXT_HEIGHT ( win ) - count < WINDOW_MIN_SIZE ) {
ok = FALSE ;
break ;
}
}
if ( ok ) {
GSList * grow_list ;
grow_list = mainwindows_get_line ( window ) ;
for ( tmp = grow_list ;
tmp != NULL ;
tmp = tmp -> next ) {
win = tmp -> data ;
win -> first_line -= count ;
}
for ( tmp = shrink_list ;
tmp != NULL ;
tmp = tmp -> next ) {
win = tmp -> data ;
win -> last_line -= count ;
}
mainwindows_resize_two ( grow_list , shrink_list , count ) ;
g_slist_free ( grow_list ) ;
}
g_slist_free ( shrink_list ) ;
return ok ;
}
return FALSE ;
} |
1,414,661,670,117,003,800 | debian | 41 | 0 | int rebuild_existing_bitmaps ( struct packing_data * mapping , khash_sha1 * reused_bitmaps , int show_progress ) {
uint32_t i , num_objects ;
uint32_t * reposition ;
struct bitmap * rebuild ;
struct stored_bitmap * stored ;
struct progress * progress = NULL ;
khiter_t hash_pos ;
int hash_ret ;
if ( prepare_bitmap_git ( ) < 0 ) return - 1 ;
num_objects = bitmap_git . pack -> num_objects ;
reposition = xcalloc ( num_objects , sizeof ( uint32_t ) ) ;
for ( i = 0 ;
i < num_objects ;
++ i ) {
const unsigned char * sha1 ;
struct revindex_entry * entry ;
struct object_entry * oe ;
entry = & bitmap_git . pack -> revindex [ i ] ;
sha1 = nth_packed_object_sha1 ( bitmap_git . pack , entry -> nr ) ;
oe = packlist_find ( mapping , sha1 , NULL ) ;
if ( oe ) reposition [ i ] = oe -> in_pack_pos + 1 ;
}
rebuild = bitmap_new ( ) ;
i = 0 ;
if ( show_progress ) progress = start_progress ( "Reusing bitmaps" , 0 ) ;
kh_foreach_value ( bitmap_git . bitmaps , stored , {
if ( stored -> flags & BITMAP_FLAG_REUSE ) {
if ( ! rebuild_bitmap ( reposition , lookup_stored_bitmap ( stored ) , rebuild ) ) {
hash_pos = kh_put_sha1 ( reused_bitmaps , stored -> sha1 , & hash_ret ) ;
kh_value ( reused_bitmaps , hash_pos ) = bitmap_to_ewah ( rebuild ) ;
}
bitmap_reset ( rebuild ) ;
display_progress ( progress , ++ i ) ;
}
}
) ;
stop_progress ( & progress ) ;
free ( reposition ) ;
bitmap_free ( rebuild ) ;
return 0 ;
} |
-3,591,633,859,713,840,600 | debian | 3 | 0 | static inline int get_bitsz ( GetBitContext * s , int n ) {
return n ? get_bits ( s , n ) : 0 ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_MultiplexEntrySendAck ( 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_MultiplexEntrySendAck , MultiplexEntrySendAck_sequence ) ;
return offset ;
} |
6,249,489,553,242,543,000 | debian | 16 | 0 | static void config_logconfig ( config_tree * ptree ) {
attr_val * my_lc ;
my_lc = HEAD_PFIFO ( ptree -> logconfig ) ;
for ( ;
my_lc != NULL ;
my_lc = my_lc -> link ) {
switch ( my_lc -> attr ) {
case '+' : ntp_syslogmask |= get_logmask ( my_lc -> value . s ) ;
break ;
case '-' : ntp_syslogmask &= ~ get_logmask ( my_lc -> value . s ) ;
break ;
case '=' : ntp_syslogmask = get_logmask ( my_lc -> value . s ) ;
break ;
}
}
} |
-6,527,276,140,940,489,000 | chrome | 22 | 1 | TEST_F ( TransportSecurityPersisterTest , SerializeData2 ) {
TransportSecurityState : : DomainState domain_state ;
const base : : Time current_time ( base : : Time : : Now ( ) ) ;
const base : : Time expiry = current_time + base : : TimeDelta : : FromSeconds ( 1000 ) ;
static const char kYahooDomain [ ] = "yahoo.com" ;
EXPECT_FALSE ( state_ . GetDomainState ( kYahooDomain , true , & domain_state ) ) ;
bool include_subdomains = true ;
state_ . AddHSTS ( kYahooDomain , expiry , include_subdomains ) ;
std : : string output ;
bool dirty ;
EXPECT_TRUE ( persister_ -> SerializeData ( & output ) ) ;
EXPECT_TRUE ( persister_ -> LoadEntries ( output , & dirty ) ) ;
EXPECT_TRUE ( state_ . GetDomainState ( kYahooDomain , true , & domain_state ) ) ;
EXPECT_EQ ( domain_state . upgrade_mode , TransportSecurityState : : DomainState : : MODE_FORCE_HTTPS ) ;
EXPECT_TRUE ( state_ . GetDomainState ( "foo.yahoo.com" , true , & domain_state ) ) ;
EXPECT_EQ ( domain_state . upgrade_mode , TransportSecurityState : : DomainState : : MODE_FORCE_HTTPS ) ;
EXPECT_TRUE ( state_ . GetDomainState ( "foo.bar.yahoo.com" , true , & domain_state ) ) ;
EXPECT_EQ ( domain_state . upgrade_mode , TransportSecurityState : : DomainState : : MODE_FORCE_HTTPS ) ;
EXPECT_TRUE ( state_ . GetDomainState ( "foo.bar.baz.yahoo.com" , true , & domain_state ) ) ;
EXPECT_EQ ( domain_state . upgrade_mode , TransportSecurityState : : DomainState : : MODE_FORCE_HTTPS ) ;
EXPECT_FALSE ( state_ . GetDomainState ( "com" , true , & domain_state ) ) ;
} |
1,896,723,564,367,514,400 | debian | 8 | 0 | static VALUE ossl_cipher_iv_length ( VALUE self ) {
EVP_CIPHER_CTX * ctx ;
int len = 0 ;
GetCipher ( self , ctx ) ;
# if defined ( HAVE_AUTHENTICATED_ENCRYPTION ) if ( EVP_CIPHER_CTX_flags ( ctx ) & EVP_CIPH_FLAG_AEAD_CIPHER ) len = ( int ) ( VALUE ) EVP_CIPHER_CTX_get_app_data ( ctx ) ;
# endif if ( ! len ) len = EVP_CIPHER_CTX_iv_length ( ctx ) ;
return INT2NUM ( len ) ;
} |
8,484,475,213,808,847,000 | debian | 13 | 0 | void qbus_free ( BusState * bus ) {
DeviceState * dev ;
while ( ( dev = QLIST_FIRST ( & bus -> children ) ) != NULL ) {
qdev_free ( dev ) ;
}
if ( bus -> parent ) {
QLIST_REMOVE ( bus , sibling ) ;
bus -> parent -> num_child_bus -- ;
}
if ( bus -> qdev_allocated ) {
qemu_free ( bus ) ;
}
} |
-5,706,788,925,640,467,000 | chrome | 10 | 0 | static void encode_b ( VP9_COMP * cpi , const TileInfo * const tile , TOKENEXTRA * * tp , int mi_row , int mi_col , int output_enabled , BLOCK_SIZE bsize , PICK_MODE_CONTEXT * ctx ) {
set_offsets ( cpi , tile , mi_row , mi_col , bsize ) ;
update_state ( cpi , ctx , mi_row , mi_col , bsize , output_enabled ) ;
encode_superblock ( cpi , tp , output_enabled , mi_row , mi_col , bsize , ctx ) ;
if ( output_enabled ) {
update_stats ( & cpi -> common , & cpi -> mb ) ;
( * tp ) -> token = EOSB_TOKEN ;
( * tp ) ++ ;
}
} |
8,588,713,512,322,174,000 | debian | 39 | 0 | static int tgq_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
TgqContext * s = avctx -> priv_data ;
AVFrame * frame = data ;
int x , y , ret ;
int big_endian = AV_RL32 ( & buf [ 4 ] ) > 0x000FFFFF ;
if ( buf_size < 16 ) {
av_log ( avctx , AV_LOG_WARNING , "truncated header\n" ) ;
return AVERROR_INVALIDDATA ;
}
bytestream2_init ( & s -> gb , buf + 8 , buf_size - 8 ) ;
if ( big_endian ) {
s -> width = bytestream2_get_be16u ( & s -> gb ) ;
s -> height = bytestream2_get_be16u ( & s -> gb ) ;
}
else {
s -> width = bytestream2_get_le16u ( & s -> gb ) ;
s -> height = bytestream2_get_le16u ( & s -> gb ) ;
}
if ( s -> avctx -> width != s -> width || s -> avctx -> height != s -> height ) {
avcodec_set_dimensions ( s -> avctx , s -> width , s -> height ) ;
}
tgq_calculate_qtable ( s , bytestream2_get_byteu ( & s -> gb ) ) ;
bytestream2_skip ( & s -> gb , 3 ) ;
if ( ( ret = ff_get_buffer ( avctx , frame , 0 ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
frame -> key_frame = 1 ;
frame -> pict_type = AV_PICTURE_TYPE_I ;
for ( y = 0 ;
y < FFALIGN ( avctx -> height , 16 ) >> 4 ;
y ++ ) for ( x = 0 ;
x < FFALIGN ( avctx -> width , 16 ) >> 4 ;
x ++ ) tgq_decode_mb ( s , frame , y , x ) ;
* got_frame = 1 ;
return avpkt -> size ;
} |
3,192,165,150,896,245,000 | debian | 91 | 0 | unsigned long # endif # undef mul # undef mul_add # define mul_add ( r , a , word , carry ) do {
\ register BN_ULONG high , low ;
\ asm ( "mulq %3" \ : "=a" ( low ) , "=d" ( high ) \ : "a" ( word ) , "m" ( a ) \ : "cc" ) ;
\ asm ( "addq %2,%0;
adcq %3,%1" \ : "+r" ( carry ) , "+d" ( high ) \ : "a" ( low ) , "g" ( 0 ) \ : "cc" ) ;
\ asm ( "addq %2,%0;
adcq %3,%1" \ : "+m" ( r ) , "+d" ( high ) \ : "r" ( carry ) , "g" ( 0 ) \ : "cc" ) ;
\ carry = high ;
\ }
while ( 0 ) # define mul ( r , a , word , carry ) do {
\ register BN_ULONG high , low ;
\ asm ( "mulq %3" \ : "=a" ( low ) , "=d" ( high ) \ : "a" ( word ) , "g" ( a ) \ : "cc" ) ;
\ asm ( "addq %2,%0;
adcq %3,%1" \ : "+r" ( carry ) , "+d" ( high ) \ : "a" ( low ) , "g" ( 0 ) \ : "cc" ) ;
\ ( r ) = carry , carry = high ;
\ }
while ( 0 ) # undef sqr # define sqr ( r0 , r1 , a ) \ asm ( "mulq %2" \ : "=a" ( r0 ) , "=d" ( r1 ) \ : "a" ( a ) \ : "cc" ) ;
BN_ULONG bn_mul_add_words ( BN_ULONG * rp , const BN_ULONG * ap , int num , BN_ULONG w ) {
BN_ULONG c1 = 0 ;
if ( num <= 0 ) return ( c1 ) ;
while ( num & ~ 3 ) {
mul_add ( rp [ 0 ] , ap [ 0 ] , w , c1 ) ;
mul_add ( rp [ 1 ] , ap [ 1 ] , w , c1 ) ;
mul_add ( rp [ 2 ] , ap [ 2 ] , w , c1 ) ;
mul_add ( rp [ 3 ] , ap [ 3 ] , w , c1 ) ;
ap += 4 ;
rp += 4 ;
num -= 4 ;
}
if ( num ) {
mul_add ( rp [ 0 ] , ap [ 0 ] , w , c1 ) ;
if ( -- num == 0 ) return c1 ;
mul_add ( rp [ 1 ] , ap [ 1 ] , w , c1 ) ;
if ( -- num == 0 ) return c1 ;
mul_add ( rp [ 2 ] , ap [ 2 ] , w , c1 ) ;
return c1 ;
}
return ( c1 ) ;
}
BN_ULONG bn_mul_words ( BN_ULONG * rp , const BN_ULONG * ap , int num , BN_ULONG w ) {
BN_ULONG c1 = 0 ;
if ( num <= 0 ) return ( c1 ) ;
while ( num & ~ 3 ) {
mul ( rp [ 0 ] , ap [ 0 ] , w , c1 ) ;
mul ( rp [ 1 ] , ap [ 1 ] , w , c1 ) ;
mul ( rp [ 2 ] , ap [ 2 ] , w , c1 ) ;
mul ( rp [ 3 ] , ap [ 3 ] , w , c1 ) ;
ap += 4 ;
rp += 4 ;
num -= 4 ;
}
if ( num ) {
mul ( rp [ 0 ] , ap [ 0 ] , w , c1 ) ;
if ( -- num == 0 ) return c1 ;
mul ( rp [ 1 ] , ap [ 1 ] , w , c1 ) ;
if ( -- num == 0 ) return c1 ;
mul ( rp [ 2 ] , ap [ 2 ] , w , c1 ) ;
}
return ( c1 ) ;
}
void bn_sqr_words ( BN_ULONG * r , const BN_ULONG * a , int n ) {
if ( n <= 0 ) return ;
while ( n & ~ 3 ) {
sqr ( r [ 0 ] , r [ 1 ] , a [ 0 ] ) ;
sqr ( r [ 2 ] , r [ 3 ] , a [ 1 ] ) ;
sqr ( r [ 4 ] , r [ 5 ] , a [ 2 ] ) ;
sqr ( r [ 6 ] , r [ 7 ] , a [ 3 ] ) ;
a += 4 ;
r += 8 ;
n -= 4 ;
}
if ( n ) {
sqr ( r [ 0 ] , r [ 1 ] , a [ 0 ] ) ;
if ( -- n == 0 ) return ;
sqr ( r [ 2 ] , r [ 3 ] , a [ 1 ] ) ;
if ( -- n == 0 ) return ;
sqr ( r [ 4 ] , r [ 5 ] , a [ 2 ] ) ;
}
}
BN_ULONG bn_div_words ( BN_ULONG h , BN_ULONG l , BN_ULONG d ) {
BN_ULONG ret , waste ;
asm ( "divq %4" : "=a" ( ret ) , "=d" ( waste ) : "a" ( l ) , "d" ( h ) , "g" ( d ) : "cc" ) ;
return ret ;
}
BN_ULONG bn_add_words ( BN_ULONG * rp , const BN_ULONG * ap , const BN_ULONG * bp , int n ) {
BN_ULONG ret ;
size_t i = 0 ;
if ( n <= 0 ) return 0 ;
asm volatile ( " subq %0,%0 \n" " jmp 1f \n" ".p2align 4 \n" "1: movq (%4,%2,8),%0 \n" " adcq (%5,%2,8),%0 \n" " movq %0,(%3,%2,8) \n" " lea 1(%2),%2 \n" " loop 1b \n" " sbbq %0,%0 \n" : "=&r" ( ret ) , "+c" ( n ) , "+r" ( i ) : "r" ( rp ) , "r" ( ap ) , "r" ( bp ) : "cc" , "memory" ) ;
return ret & 1 ;
} |
6,336,384,260,629,386,000 | debian | 24 | 0 | static void dissect_zcl_scenes_view_scene_response ( tvbuff_t * tvb , proto_tree * tree , guint * offset ) {
guint8 status , * attr_string ;
guint attr_uint ;
status = tvb_get_guint8 ( tvb , * offset ) ;
proto_tree_add_item ( tree , hf_zbee_zcl_scenes_status , tvb , * offset , 1 , ENC_LITTLE_ENDIAN ) ;
* offset += 1 ;
proto_tree_add_item ( tree , hf_zbee_zcl_scenes_group_id , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
proto_tree_add_item ( tree , hf_zbee_zcl_scenes_scene_id , tvb , * offset , 1 , ENC_LITTLE_ENDIAN ) ;
* offset += 1 ;
if ( status == ZBEE_ZCL_STAT_SUCCESS ) {
proto_tree_add_item ( tree , hf_zbee_zcl_scenes_transit_time , 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_scenes_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_scenes_attr_str , tvb , * offset , attr_uint , attr_string ) ;
* offset += attr_uint ;
proto_tree_add_item ( tree , hf_zbee_zcl_scenes_extension_set_field , tvb , * offset , - 1 , ENC_NA ) ;
}
} |
9,176,142,195,250,516,000 | debian | 11 | 0 | static void prplcb_blist_new ( PurpleBlistNode * node ) {
if ( node -> type == PURPLE_BLIST_BUDDY_NODE ) {
PurpleBuddy * bud = ( PurpleBuddy * ) node ;
struct im_connection * ic = purple_ic_by_pa ( bud -> account ) ;
if ( ic == NULL ) {
return ;
}
imcb_add_buddy ( ic , bud -> name , NULL ) ;
prplcb_blist_update ( NULL , node ) ;
}
} |
1,182,028,467,273,265,000 | debian | 29 | 0 | REP_SET * make_new_set ( REP_SETS * sets ) {
uint i , count , * bit_buffer ;
REP_SET * set ;
if ( sets -> extra ) {
sets -> extra -- ;
set = sets -> set + sets -> count ++ ;
bzero ( ( char * ) set -> bits , sizeof ( uint ) * sets -> size_of_bits ) ;
bzero ( ( char * ) & set -> next [ 0 ] , sizeof ( set -> next [ 0 ] ) * LAST_CHAR_CODE ) ;
set -> found_offset = 0 ;
set -> found_len = 0 ;
set -> table_offset = ( uint ) ~ 0 ;
set -> size_of_bits = sets -> size_of_bits ;
return set ;
}
count = sets -> count + sets -> invisible + SET_MALLOC_HUNC ;
if ( ! ( set = ( REP_SET * ) my_realloc ( ( uchar * ) sets -> set_buffer , sizeof ( REP_SET ) * count , MYF ( MY_WME ) ) ) ) return 0 ;
sets -> set_buffer = set ;
sets -> set = set + sets -> invisible ;
if ( ! ( bit_buffer = ( uint * ) my_realloc ( ( uchar * ) sets -> bit_buffer , ( sizeof ( uint ) * sets -> size_of_bits ) * count , MYF ( MY_WME ) ) ) ) return 0 ;
sets -> bit_buffer = bit_buffer ;
for ( i = 0 ;
i < count ;
i ++ ) {
sets -> set_buffer [ i ] . bits = bit_buffer ;
bit_buffer += sets -> size_of_bits ;
}
sets -> extra = SET_MALLOC_HUNC ;
return make_new_set ( sets ) ;
} |
-6,154,134,138,260,772,000 | debian | 40 | 1 | static int tmv_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
TMVContext * tmv = avctx -> priv_data ;
const uint8_t * src = avpkt -> data ;
uint8_t * dst ;
unsigned char_cols = avctx -> width >> 3 ;
unsigned char_rows = avctx -> height >> 3 ;
unsigned x , y , fg , bg , c ;
int ret ;
if ( tmv -> pic . data [ 0 ] ) avctx -> release_buffer ( avctx , & tmv -> pic ) ;
if ( ( ret = ff_get_buffer ( avctx , & tmv -> pic ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
if ( avpkt -> size < 2 * char_rows * char_cols ) {
av_log ( avctx , AV_LOG_ERROR , "Input buffer too small, truncated sample?\n" ) ;
* got_frame = 0 ;
return AVERROR_INVALIDDATA ;
}
tmv -> pic . pict_type = AV_PICTURE_TYPE_I ;
tmv -> pic . key_frame = 1 ;
dst = tmv -> pic . data [ 0 ] ;
tmv -> pic . palette_has_changed = 1 ;
memcpy ( tmv -> pic . data [ 1 ] , ff_cga_palette , 16 * 4 ) ;
for ( y = 0 ;
y < char_rows ;
y ++ ) {
for ( x = 0 ;
x < char_cols ;
x ++ ) {
c = * src ++ ;
bg = * src >> 4 ;
fg = * src ++ & 0xF ;
ff_draw_pc_font ( dst + x * 8 , tmv -> pic . linesize [ 0 ] , ff_cga_font , 8 , c , fg , bg ) ;
}
dst += tmv -> pic . linesize [ 0 ] * 8 ;
}
* got_frame = 1 ;
* ( AVFrame * ) data = tmv -> pic ;
return avpkt -> size ;
} |
7,549,435,794,356,072,000 | debian | 10 | 0 | static ASN1_BIT_STRING * obj_to_asn1bstr ( VALUE obj , long unused_bits ) {
ASN1_BIT_STRING * bstr ;
if ( unused_bits < 0 ) unused_bits = 0 ;
StringValue ( obj ) ;
if ( ! ( bstr = ASN1_BIT_STRING_new ( ) ) ) ossl_raise ( eASN1Error , NULL ) ;
ASN1_BIT_STRING_set ( bstr , ( unsigned char * ) RSTRING_PTR ( obj ) , RSTRING_LENINT ( obj ) ) ;
bstr -> flags &= ~ ( ASN1_STRING_FLAG_BITS_LEFT | 0x07 ) ;
bstr -> flags |= ASN1_STRING_FLAG_BITS_LEFT | ( unused_bits & 0x07 ) ;
return bstr ;
} |
-7,136,186,224,744,988,000 | debian | 33 | 0 | CURLcode Curl_http_done ( struct connectdata * conn , CURLcode status , bool premature ) {
struct Curl_easy * data = conn -> data ;
struct HTTP * http = data -> req . protop ;
infof ( data , "Curl_http_done: called premature == %d\n" , premature ) ;
Curl_unencode_cleanup ( conn ) ;
# ifdef USE_SPNEGO if ( data -> state . proxyneg . state == GSS_AUTHSENT || data -> state . negotiate . state == GSS_AUTHSENT ) {
if ( ( data -> req . httpcode != 401 ) && ( data -> req . httpcode != 407 ) && ! data -> set . connect_only ) streamclose ( conn , "Negotiate transfer completed" ) ;
Curl_cleanup_negotiate ( data ) ;
}
# endif conn -> seek_func = data -> set . seek_func ;
conn -> seek_client = data -> set . seek_client ;
if ( ! http ) return CURLE_OK ;
if ( http -> send_buffer ) {
Curl_add_buffer_free ( http -> send_buffer ) ;
http -> send_buffer = NULL ;
}
Curl_http2_done ( conn , premature ) ;
if ( HTTPREQ_POST_FORM == data -> set . httpreq ) {
data -> req . bytecount = http -> readbytecount + http -> writebytecount ;
Curl_formclean ( & http -> sendit ) ;
if ( http -> form . fp ) {
fclose ( http -> form . fp ) ;
http -> form . fp = NULL ;
}
}
else if ( HTTPREQ_PUT == data -> set . httpreq ) data -> req . bytecount = http -> readbytecount + http -> writebytecount ;
if ( status ) return status ;
if ( ! premature && ! conn -> bits . retry && ! data -> set . connect_only && ( http -> readbytecount + data -> req . headerbytecount - data -> req . deductheadercount ) <= 0 ) {
failf ( data , "Empty reply from server" ) ;
return CURLE_GOT_NOTHING ;
}
return CURLE_OK ;
} |
-2,901,388,205,723,537,400 | debian | 39 | 0 | VALUE rb_dlhandle_initialize ( int argc , VALUE argv [ ] , VALUE self ) {
void * ptr ;
struct dl_handle * dlhandle ;
VALUE lib , flag ;
char * clib ;
int cflag ;
const char * err ;
switch ( rb_scan_args ( argc , argv , "02" , & lib , & flag ) ) {
case 0 : clib = NULL ;
cflag = RTLD_LAZY | RTLD_GLOBAL ;
break ;
case 1 : clib = NIL_P ( lib ) ? NULL : SafeStringValuePtr ( lib ) ;
cflag = RTLD_LAZY | RTLD_GLOBAL ;
break ;
case 2 : clib = NIL_P ( lib ) ? NULL : SafeStringValuePtr ( lib ) ;
cflag = NUM2INT ( flag ) ;
break ;
default : rb_bug ( "rb_dlhandle_new" ) ;
}
ptr = dlopen ( clib , cflag ) ;
# if defined ( HAVE_DLERROR ) if ( ! ptr && ( err = dlerror ( ) ) ) {
rb_raise ( rb_eDLError , "%s" , err ) ;
}
# else if ( ! ptr ) {
err = dlerror ( ) ;
rb_raise ( rb_eDLError , "%s" , err ) ;
}
# endif Data_Get_Struct ( self , struct dl_handle , dlhandle ) ;
if ( dlhandle -> ptr && dlhandle -> open && dlhandle -> enable_close ) {
dlclose ( dlhandle -> ptr ) ;
}
dlhandle -> ptr = ptr ;
dlhandle -> open = 1 ;
dlhandle -> enable_close = 0 ;
if ( rb_block_given_p ( ) ) {
rb_ensure ( rb_yield , self , rb_dlhandle_close , self ) ;
}
return Qnil ;
} |
-7,855,974,557,509,681,000 | debian | 12 | 0 | char get_typtype ( Oid typid ) {
HeapTuple tp ;
tp = SearchSysCache1 ( TYPEOID , ObjectIdGetDatum ( typid ) ) ;
if ( HeapTupleIsValid ( tp ) ) {
Form_pg_type typtup = ( Form_pg_type ) GETSTRUCT ( tp ) ;
char result ;
result = typtup -> typtype ;
ReleaseSysCache ( tp ) ;
return result ;
}
else return '\0' ;
} |
-2,648,356,651,055,439,400 | debian | 94 | 0 | void dissect_geographical_description ( tvbuff_t * tvb , packet_info * pinfo _U_ , proto_tree * tree ) {
proto_item * lat_item , * long_item , * major_item , * minor_item , * alt_item , * uncer_item ;
guint8 type_of_shape ;
int offset = 0 ;
int length ;
guint8 value ;
guint32 uvalue32 ;
gint32 svalue32 ;
length = tvb_reported_length_remaining ( tvb , 0 ) ;
proto_tree_add_item ( tree , hf_gsm_a_geo_loc_type_of_shape , tvb , 0 , 1 , ENC_BIG_ENDIAN ) ;
if ( length < 2 ) return ;
type_of_shape = tvb_get_guint8 ( tvb , offset ) >> 4 ;
switch ( type_of_shape ) {
case ELLIPSOID_POINT : case ELLIPSOID_POINT_WITH_UNCERT_CIRC : case ELLIPSOID_POINT_WITH_UNCERT_ELLIPSE : case ELLIPSOID_POINT_WITH_ALT : case ELLIPSOID_POINT_WITH_ALT_AND_UNCERT_ELLIPSOID : case ELLIPSOID_ARC : offset ++ ;
if ( length < 4 ) return ;
proto_tree_add_item ( tree , hf_gsm_a_geo_loc_sign_of_lat , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
uvalue32 = tvb_get_ntoh24 ( tvb , offset ) ;
lat_item = proto_tree_add_item ( tree , hf_gsm_a_geo_loc_deg_of_lat , tvb , offset , 3 , ENC_BIG_ENDIAN ) ;
proto_item_append_text ( lat_item , " (%s%.5f degrees)" , ( uvalue32 & 0x00800000 ) ? "-" : "" , ( ( double ) ( uvalue32 & 0x7fffff ) / 8388607.0 ) * 90 ) ;
if ( length < 7 ) return ;
offset = offset + 3 ;
svalue32 = tvb_get_ntoh24 ( tvb , offset ) ;
svalue32 |= ( svalue32 & 0x800000 ) ? 0xff000000 : 0x00000000 ;
long_item = proto_tree_add_item ( tree , hf_gsm_a_geo_loc_deg_of_long , tvb , offset , 3 , ENC_BIG_ENDIAN ) ;
proto_item_append_text ( long_item , " (%.5f degrees)" , ( ( double ) svalue32 / 16777215.0 ) * 360 ) ;
offset = offset + 3 ;
if ( type_of_shape == ELLIPSOID_POINT_WITH_UNCERT_CIRC ) {
if ( length < 8 ) return ;
value = tvb_get_guint8 ( tvb , offset ) & 0x7f ;
uncer_item = proto_tree_add_item ( tree , hf_gsm_a_geo_loc_uncertainty_code , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_item_append_text ( uncer_item , " (%.1f m)" , 10 * ( pow ( 1.1 , ( double ) value ) - 1 ) ) ;
}
else if ( type_of_shape == ELLIPSOID_POINT_WITH_UNCERT_ELLIPSE ) {
value = tvb_get_guint8 ( tvb , offset ) & 0x7f ;
major_item = proto_tree_add_item ( tree , hf_gsm_a_geo_loc_uncertainty_semi_major , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_item_append_text ( major_item , " (%.1f m)" , 10 * ( pow ( 1.1 , ( double ) value ) - 1 ) ) ;
offset ++ ;
value = tvb_get_guint8 ( tvb , offset ) & 0x7f ;
minor_item = proto_tree_add_item ( tree , hf_gsm_a_geo_loc_uncertainty_semi_minor , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_item_append_text ( minor_item , " (%.1f m)" , 10 * ( pow ( 1.1 , ( double ) value ) - 1 ) ) ;
offset ++ ;
value = tvb_get_guint8 ( tvb , offset ) & 0x7f ;
proto_tree_add_uint ( tree , hf_gsm_a_geo_loc_orientation_of_major_axis , tvb , offset , 1 , value * 2 ) ;
offset ++ ;
proto_tree_add_item ( tree , hf_gsm_a_geo_loc_confidence , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
}
else if ( type_of_shape == ELLIPSOID_POINT_WITH_ALT ) {
proto_tree_add_item ( tree , hf_gsm_a_geo_loc_D , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( tree , hf_gsm_a_geo_loc_altitude , tvb , offset , 2 , ENC_BIG_ENDIAN ) ;
}
else if ( type_of_shape == ELLIPSOID_POINT_WITH_ALT_AND_UNCERT_ELLIPSOID ) {
proto_tree_add_item ( tree , hf_gsm_a_geo_loc_D , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( tree , hf_gsm_a_geo_loc_altitude , tvb , offset , 2 , ENC_BIG_ENDIAN ) ;
offset = offset + 2 ;
value = tvb_get_guint8 ( tvb , offset ) & 0x7f ;
major_item = proto_tree_add_item ( tree , hf_gsm_a_geo_loc_uncertainty_semi_major , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_item_append_text ( major_item , " (%.1f m)" , 10 * ( pow ( 1.1 , ( double ) value ) - 1 ) ) ;
offset ++ ;
value = tvb_get_guint8 ( tvb , offset ) & 0x7f ;
minor_item = proto_tree_add_item ( tree , hf_gsm_a_geo_loc_uncertainty_semi_minor , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_item_append_text ( minor_item , " (%.1f m)" , 10 * ( pow ( 1.1 , ( double ) value ) - 1 ) ) ;
offset ++ ;
value = tvb_get_guint8 ( tvb , offset ) & 0x7f ;
proto_tree_add_uint ( tree , hf_gsm_a_geo_loc_orientation_of_major_axis , tvb , offset , 1 , value * 2 ) ;
offset ++ ;
value = tvb_get_guint8 ( tvb , offset ) & 0x7f ;
alt_item = proto_tree_add_item ( tree , hf_gsm_a_geo_loc_uncertainty_altitude , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_item_append_text ( alt_item , " (%.1f m)" , 45 * ( pow ( 1.025 , ( double ) value ) - 1 ) ) ;
offset ++ ;
proto_tree_add_item ( tree , hf_gsm_a_geo_loc_confidence , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
}
else if ( type_of_shape == ELLIPSOID_ARC ) {
proto_tree_add_item ( tree , hf_gsm_a_geo_loc_inner_radius , tvb , offset , 2 , ENC_BIG_ENDIAN ) ;
offset = offset + 2 ;
proto_tree_add_item ( tree , hf_gsm_a_geo_loc_uncertainty_radius , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( tree , hf_gsm_a_geo_loc_offset_angle , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( tree , hf_gsm_a_geo_loc_included_angle , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( tree , hf_gsm_a_geo_loc_confidence , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
}
break ;
case POLYGON : proto_tree_add_item ( tree , hf_gsm_a_geo_loc_no_of_points , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
# if 0 no_of_points = tvb_get_guint8 ( tvb , offset ) & 0x0f ;
while ( no_of_points > 0 ) {
offset ++ ;
no_of_points -- ;
}
# endif break ;
default : break ;
}
} |
-6,252,714,751,027,238,000 | debian | 3 | 0 | static int gs_heap_register_root ( gs_memory_t * mem , gs_gc_root_t * rp , gs_ptr_type_t ptype , void * * up , client_name_t cname ) {
return 0 ;
} |
-4,136,373,206,107,992,600 | chrome | 19 | 1 | static void _ISCIIReset ( UConverter * cnv , UConverterResetChoice choice ) {
UConverterDataISCII * data = ( UConverterDataISCII * ) ( cnv -> extraInfo ) ;
if ( choice <= UCNV_RESET_TO_UNICODE ) {
cnv -> toUnicodeStatus = missingCharMarker ;
cnv -> mode = 0 ;
data -> currentDeltaToUnicode = data -> defDeltaToUnicode ;
data -> currentMaskToUnicode = data -> defMaskToUnicode ;
data -> contextCharToUnicode = NO_CHAR_MARKER ;
data -> prevToUnicodeStatus = 0x0000 ;
}
if ( choice != UCNV_RESET_TO_UNICODE ) {
cnv -> fromUChar32 = 0x0000 ;
data -> contextCharFromUnicode = 0x00 ;
data -> currentMaskFromUnicode = data -> defMaskToUnicode ;
data -> currentDeltaFromUnicode = data -> defDeltaToUnicode ;
data -> isFirstBuffer = TRUE ;
data -> resetToDefaultToUnicode = FALSE ;
}
} |
3,599,206,110,384,554,500 | debian | 21 | 0 | static ossl_inline int sk_ ## t1 ## _find_ex ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return OPENSSL_sk_find_ex ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline void sk_ ## t1 ## _sort ( STACK_OF ( t1 ) * sk ) {
OPENSSL_sk_sort ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline int sk_ ## t1 ## _is_sorted ( const STACK_OF ( t1 ) * sk ) {
return OPENSSL_sk_is_sorted ( ( const OPENSSL_STACK * ) sk ) ;
}
static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _dup ( const STACK_OF ( t1 ) * sk ) {
return ( STACK_OF ( t1 ) * ) OPENSSL_sk_dup ( ( const OPENSSL_STACK * ) sk ) ;
}
static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _deep_copy ( const STACK_OF ( t1 ) * sk , sk_ ## t1 ## _copyfunc copyfunc , sk_ ## t1 ## _freefunc freefunc ) {
return ( STACK_OF ( t1 ) * ) OPENSSL_sk_deep_copy ( ( const OPENSSL_STACK * ) sk , ( OPENSSL_sk_copyfunc ) copyfunc , ( OPENSSL_sk_freefunc ) freefunc ) ;
}
static ossl_inline sk_ ## t1 ## _compfunc sk_ ## t1 ## _set_cmp_func ( STACK_OF ( t1 ) * sk , sk_ ## t1 ## _compfunc compare ) {
return ( sk_ ## t1 ## _compfunc ) OPENSSL_sk_set_cmp_func ( ( OPENSSL_STACK * ) sk , ( OPENSSL_sk_compfunc ) compare ) ;
}
# define DEFINE_SPECIAL_STACK_OF ( t1 , t2 ) SKM_DEFINE_STACK_OF ( t1 , t2 , t2 ) # define DEFINE_STACK_OF ( t ) SKM_DEFINE_STACK_OF ( t , t , t ) # define DEFINE_SPECIAL_STACK_OF_CONST ( t1 , t2 ) SKM_DEFINE_STACK_OF ( t1 , const t2 , t2 ) # define DEFINE_STACK_OF_CONST ( t ) SKM_DEFINE_STACK_OF ( t , const t , t ) typedef char * OPENSSL_STRING ;
typedef const char * OPENSSL_CSTRING ;
DEFINE_SPECIAL_STACK_OF ( OPENSSL_STRING , char ) DEFINE_SPECIAL_STACK_OF_CONST ( OPENSSL_CSTRING , char ) |
-1,929,262,071,302,712,000 | debian | 5 | 0 | static void * Type_Curve_Dup ( struct _cms_typehandler_struct * self , const void * Ptr , cmsUInt32Number n ) {
return ( void * ) cmsDupToneCurve ( ( cmsToneCurve * ) Ptr ) ;
cmsUNUSED_PARAMETER ( n ) ;
cmsUNUSED_PARAMETER ( self ) ;
} |
1,859,256,631,654,517,000 | chrome | 113 | 0 | static int decode_slice ( struct AVCodecContext * avctx , void * arg ) {
H264Context * h = * ( void * * ) arg ;
int lf_x_start = h -> mb_x ;
h -> mb_skip_run = - 1 ;
av_assert0 ( h -> block_offset [ 15 ] == ( 4 * ( ( scan8 [ 15 ] - scan8 [ 0 ] ) & 7 ) << h -> pixel_shift ) + 4 * h -> linesize * ( ( scan8 [ 15 ] - scan8 [ 0 ] ) >> 3 ) ) ;
h -> is_complex = FRAME_MBAFF ( h ) || h -> picture_structure != PICT_FRAME || avctx -> codec_id != AV_CODEC_ID_H264 || ( CONFIG_GRAY && ( h -> flags & CODEC_FLAG_GRAY ) ) ;
if ( ! ( h -> avctx -> active_thread_type & FF_THREAD_SLICE ) && h -> picture_structure == PICT_FRAME && h -> er . error_status_table ) {
const int start_i = av_clip ( h -> resync_mb_x + h -> resync_mb_y * h -> mb_width , 0 , h -> mb_num - 1 ) ;
if ( start_i ) {
int prev_status = h -> er . error_status_table [ h -> er . mb_index2xy [ start_i - 1 ] ] ;
prev_status &= ~ VP_START ;
if ( prev_status != ( ER_MV_END | ER_DC_END | ER_AC_END ) ) h -> er . error_occurred = 1 ;
}
}
if ( h -> pps . cabac ) {
align_get_bits ( & h -> gb ) ;
ff_init_cabac_decoder ( & h -> cabac , h -> gb . buffer + get_bits_count ( & h -> gb ) / 8 , ( get_bits_left ( & h -> gb ) + 7 ) / 8 ) ;
ff_h264_init_cabac_states ( h ) ;
for ( ;
;
) {
int ret = ff_h264_decode_mb_cabac ( h ) ;
int eos ;
if ( ret >= 0 ) ff_h264_hl_decode_mb ( h ) ;
if ( ret >= 0 && FRAME_MBAFF ( h ) ) {
h -> mb_y ++ ;
ret = ff_h264_decode_mb_cabac ( h ) ;
if ( ret >= 0 ) ff_h264_hl_decode_mb ( h ) ;
h -> mb_y -- ;
}
eos = get_cabac_terminate ( & h -> cabac ) ;
if ( ( h -> workaround_bugs & FF_BUG_TRUNCATED ) && h -> cabac . bytestream > h -> cabac . bytestream_end + 2 ) {
er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x - 1 , h -> mb_y , ER_MB_END ) ;
if ( h -> mb_x >= lf_x_start ) loop_filter ( h , lf_x_start , h -> mb_x + 1 ) ;
return 0 ;
}
if ( h -> cabac . bytestream > h -> cabac . bytestream_end + 2 ) av_log ( h -> avctx , AV_LOG_DEBUG , "bytestream overread %td\n" , h -> cabac . bytestream_end - h -> cabac . bytestream ) ;
if ( ret < 0 || h -> cabac . bytestream > h -> cabac . bytestream_end + 4 ) {
av_log ( h -> avctx , AV_LOG_ERROR , "error while decoding MB %d %d, bytestream (%td)\n" , h -> mb_x , h -> mb_y , h -> cabac . bytestream_end - h -> cabac . bytestream ) ;
er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x , h -> mb_y , ER_MB_ERROR ) ;
return AVERROR_INVALIDDATA ;
}
if ( ++ h -> mb_x >= h -> mb_width ) {
loop_filter ( h , lf_x_start , h -> mb_x ) ;
h -> mb_x = lf_x_start = 0 ;
decode_finish_row ( h ) ;
++ h -> mb_y ;
if ( FIELD_OR_MBAFF_PICTURE ( h ) ) {
++ h -> mb_y ;
if ( FRAME_MBAFF ( h ) && h -> mb_y < h -> mb_height ) predict_field_decoding_flag ( h ) ;
}
}
if ( eos || h -> mb_y >= h -> mb_height ) {
tprintf ( h -> avctx , "slice end %d %d\n" , get_bits_count ( & h -> gb ) , h -> gb . size_in_bits ) ;
er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x - 1 , h -> mb_y , ER_MB_END ) ;
if ( h -> mb_x > lf_x_start ) loop_filter ( h , lf_x_start , h -> mb_x ) ;
return 0 ;
}
}
}
else {
for ( ;
;
) {
int ret = ff_h264_decode_mb_cavlc ( h ) ;
if ( ret >= 0 ) ff_h264_hl_decode_mb ( h ) ;
if ( ret >= 0 && FRAME_MBAFF ( h ) ) {
h -> mb_y ++ ;
ret = ff_h264_decode_mb_cavlc ( h ) ;
if ( ret >= 0 ) ff_h264_hl_decode_mb ( h ) ;
h -> mb_y -- ;
}
if ( ret < 0 ) {
av_log ( h -> avctx , AV_LOG_ERROR , "error while decoding MB %d %d\n" , h -> mb_x , h -> mb_y ) ;
er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x , h -> mb_y , ER_MB_ERROR ) ;
return ret ;
}
if ( ++ h -> mb_x >= h -> mb_width ) {
loop_filter ( h , lf_x_start , h -> mb_x ) ;
h -> mb_x = lf_x_start = 0 ;
decode_finish_row ( h ) ;
++ h -> mb_y ;
if ( FIELD_OR_MBAFF_PICTURE ( h ) ) {
++ h -> mb_y ;
if ( FRAME_MBAFF ( h ) && h -> mb_y < h -> mb_height ) predict_field_decoding_flag ( h ) ;
}
if ( h -> mb_y >= h -> mb_height ) {
tprintf ( h -> avctx , "slice end %d %d\n" , get_bits_count ( & h -> gb ) , h -> gb . size_in_bits ) ;
if ( get_bits_left ( & h -> gb ) == 0 || get_bits_left ( & h -> gb ) > 0 && ! ( h -> avctx -> err_recognition & AV_EF_AGGRESSIVE ) ) {
er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x - 1 , h -> mb_y , ER_MB_END ) ;
return 0 ;
}
else {
er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x , h -> mb_y , ER_MB_END ) ;
return AVERROR_INVALIDDATA ;
}
}
}
if ( get_bits_left ( & h -> gb ) <= 0 && h -> mb_skip_run <= 0 ) {
tprintf ( h -> avctx , "slice end %d %d\n" , get_bits_count ( & h -> gb ) , h -> gb . size_in_bits ) ;
if ( get_bits_left ( & h -> gb ) == 0 ) {
er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x - 1 , h -> mb_y , ER_MB_END ) ;
if ( h -> mb_x > lf_x_start ) loop_filter ( h , lf_x_start , h -> mb_x ) ;
return 0 ;
}
else {
er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x , h -> mb_y , ER_MB_ERROR ) ;
return AVERROR_INVALIDDATA ;
}
}
}
}
} |
3,599,206,110,384,554,500 | debian | 24 | 0 | int X509_REQ_check_private_key ( X509_REQ * x , EVP_PKEY * k ) {
EVP_PKEY * xk = NULL ;
int ok = 0 ;
xk = X509_REQ_get_pubkey ( x ) ;
switch ( EVP_PKEY_cmp ( xk , k ) ) {
case 1 : ok = 1 ;
break ;
case 0 : X509err ( X509_F_X509_REQ_CHECK_PRIVATE_KEY , X509_R_KEY_VALUES_MISMATCH ) ;
break ;
case - 1 : X509err ( X509_F_X509_REQ_CHECK_PRIVATE_KEY , X509_R_KEY_TYPE_MISMATCH ) ;
break ;
case - 2 : # ifndef OPENSSL_NO_EC if ( k -> type == EVP_PKEY_EC ) {
X509err ( X509_F_X509_REQ_CHECK_PRIVATE_KEY , ERR_R_EC_LIB ) ;
break ;
}
# endif # ifndef OPENSSL_NO_DH if ( k -> type == EVP_PKEY_DH ) {
X509err ( X509_F_X509_REQ_CHECK_PRIVATE_KEY , X509_R_CANT_CHECK_DH_KEY ) ;
break ;
}
# endif X509err ( X509_F_X509_REQ_CHECK_PRIVATE_KEY , X509_R_UNKNOWN_KEY_TYPE ) ;
}
EVP_PKEY_free ( xk ) ;
return ( ok ) ;
} |
-2,922,528,420,890,432,000 | debian | 31 | 0 | static void wma_window ( WMACodecContext * s , float * out ) {
float * in = s -> output ;
int block_len , bsize , n ;
if ( s -> block_len_bits <= s -> prev_block_len_bits ) {
block_len = s -> block_len ;
bsize = s -> frame_len_bits - s -> block_len_bits ;
s -> fdsp . vector_fmul_add ( out , in , s -> windows [ bsize ] , out , block_len ) ;
}
else {
block_len = 1 << s -> prev_block_len_bits ;
n = ( s -> block_len - block_len ) / 2 ;
bsize = s -> frame_len_bits - s -> prev_block_len_bits ;
s -> fdsp . vector_fmul_add ( out + n , in + n , s -> windows [ bsize ] , out + n , block_len ) ;
memcpy ( out + n + block_len , in + n + block_len , n * sizeof ( float ) ) ;
}
out += s -> block_len ;
in += s -> block_len ;
if ( s -> block_len_bits <= s -> next_block_len_bits ) {
block_len = s -> block_len ;
bsize = s -> frame_len_bits - s -> block_len_bits ;
s -> fdsp . vector_fmul_reverse ( out , in , s -> windows [ bsize ] , block_len ) ;
}
else {
block_len = 1 << s -> next_block_len_bits ;
n = ( s -> block_len - block_len ) / 2 ;
bsize = s -> frame_len_bits - s -> next_block_len_bits ;
memcpy ( out , in , n * sizeof ( float ) ) ;
s -> fdsp . vector_fmul_reverse ( out + n , in + n , s -> windows [ bsize ] , block_len ) ;
memset ( out + n + block_len , 0 , n * sizeof ( float ) ) ;
}
} |
-482,717,283,558,482,300 | debian | 103 | 0 | static int mpc7_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame_ptr , AVPacket * avpkt ) {
AVFrame * frame = data ;
const uint8_t * buf = avpkt -> data ;
int buf_size ;
MPCContext * c = avctx -> priv_data ;
GetBitContext gb ;
int i , ch ;
int mb = - 1 ;
Band * bands = c -> bands ;
int off , ret , last_frame , skip ;
int bits_used , bits_avail ;
memset ( bands , 0 , sizeof ( * bands ) * ( c -> maxbands + 1 ) ) ;
buf_size = avpkt -> size & ~ 3 ;
if ( buf_size <= 0 ) {
av_log ( avctx , AV_LOG_ERROR , "packet size is too small (%i bytes)\n" , avpkt -> size ) ;
return AVERROR_INVALIDDATA ;
}
if ( buf_size != avpkt -> size ) {
av_log ( avctx , AV_LOG_WARNING , "packet size is not a multiple of 4. " "extra bytes at the end will be skipped.\n" ) ;
}
skip = buf [ 0 ] ;
last_frame = buf [ 1 ] ;
buf += 4 ;
buf_size -= 4 ;
frame -> nb_samples = last_frame ? c -> lastframelen : MPC_FRAME_SIZE ;
if ( ( ret = ff_get_buffer ( avctx , frame , 0 ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
av_fast_padded_malloc ( & c -> bits , & c -> buf_size , buf_size ) ;
if ( ! c -> bits ) return AVERROR ( ENOMEM ) ;
c -> dsp . bswap_buf ( ( uint32_t * ) c -> bits , ( const uint32_t * ) buf , buf_size >> 2 ) ;
init_get_bits ( & gb , c -> bits , buf_size * 8 ) ;
skip_bits_long ( & gb , skip ) ;
for ( i = 0 ;
i <= c -> maxbands ;
i ++ ) {
for ( ch = 0 ;
ch < 2 ;
ch ++ ) {
int t = 4 ;
if ( i ) t = get_vlc2 ( & gb , hdr_vlc . table , MPC7_HDR_BITS , 1 ) - 5 ;
if ( t == 4 ) bands [ i ] . res [ ch ] = get_bits ( & gb , 4 ) ;
else bands [ i ] . res [ ch ] = av_clip ( bands [ i - 1 ] . res [ ch ] + t , 0 , 17 ) ;
}
if ( bands [ i ] . res [ 0 ] || bands [ i ] . res [ 1 ] ) {
mb = i ;
if ( c -> MSS ) bands [ i ] . msf = get_bits1 ( & gb ) ;
}
}
for ( i = 0 ;
i <= mb ;
i ++ ) for ( ch = 0 ;
ch < 2 ;
ch ++ ) if ( bands [ i ] . res [ ch ] ) bands [ i ] . scfi [ ch ] = get_vlc2 ( & gb , scfi_vlc . table , MPC7_SCFI_BITS , 1 ) ;
for ( i = 0 ;
i <= mb ;
i ++ ) {
for ( ch = 0 ;
ch < 2 ;
ch ++ ) {
if ( bands [ i ] . res [ ch ] ) {
bands [ i ] . scf_idx [ ch ] [ 2 ] = c -> oldDSCF [ ch ] [ i ] ;
bands [ i ] . scf_idx [ ch ] [ 0 ] = get_scale_idx ( & gb , bands [ i ] . scf_idx [ ch ] [ 2 ] ) ;
switch ( bands [ i ] . scfi [ ch ] ) {
case 0 : bands [ i ] . scf_idx [ ch ] [ 1 ] = get_scale_idx ( & gb , bands [ i ] . scf_idx [ ch ] [ 0 ] ) ;
bands [ i ] . scf_idx [ ch ] [ 2 ] = get_scale_idx ( & gb , bands [ i ] . scf_idx [ ch ] [ 1 ] ) ;
break ;
case 1 : bands [ i ] . scf_idx [ ch ] [ 1 ] = get_scale_idx ( & gb , bands [ i ] . scf_idx [ ch ] [ 0 ] ) ;
bands [ i ] . scf_idx [ ch ] [ 2 ] = bands [ i ] . scf_idx [ ch ] [ 1 ] ;
break ;
case 2 : bands [ i ] . scf_idx [ ch ] [ 1 ] = bands [ i ] . scf_idx [ ch ] [ 0 ] ;
bands [ i ] . scf_idx [ ch ] [ 2 ] = get_scale_idx ( & gb , bands [ i ] . scf_idx [ ch ] [ 1 ] ) ;
break ;
case 3 : bands [ i ] . scf_idx [ ch ] [ 2 ] = bands [ i ] . scf_idx [ ch ] [ 1 ] = bands [ i ] . scf_idx [ ch ] [ 0 ] ;
break ;
}
c -> oldDSCF [ ch ] [ i ] = bands [ i ] . scf_idx [ ch ] [ 2 ] ;
}
}
}
memset ( c -> Q , 0 , sizeof ( c -> Q ) ) ;
off = 0 ;
for ( i = 0 ;
i < BANDS ;
i ++ , off += SAMPLES_PER_BAND ) for ( ch = 0 ;
ch < 2 ;
ch ++ ) idx_to_quant ( c , & gb , bands [ i ] . res [ ch ] , c -> Q [ ch ] + off ) ;
ff_mpc_dequantize_and_synth ( c , mb , ( int16_t * * ) frame -> extended_data , 2 ) ;
bits_used = get_bits_count ( & gb ) ;
bits_avail = buf_size * 8 ;
if ( ! last_frame && ( ( bits_avail < bits_used ) || ( bits_used + 32 <= bits_avail ) ) ) {
av_log ( avctx , AV_LOG_ERROR , "Error decoding frame: used %i of %i bits\n" , bits_used , bits_avail ) ;
return - 1 ;
}
if ( c -> frames_to_skip ) {
c -> frames_to_skip -- ;
* got_frame_ptr = 0 ;
return avpkt -> size ;
}
* got_frame_ptr = 1 ;
return avpkt -> size ;
} |
6,632,536,031,698,733,000 | debian | 5 | 0 | static void show_usage ( void ) {
av_log ( NULL , AV_LOG_INFO , "Simple multimedia streams analyzer\n" ) ;
av_log ( NULL , AV_LOG_INFO , "usage: %s [OPTIONS] [INPUT_FILE]\n" , program_name ) ;
av_log ( NULL , AV_LOG_INFO , "\n" ) ;
} |
-8,745,685,032,143,263,000 | debian | 51 | 0 | int upx_inflate2b ( const char * src , uint32_t ssize , char * dst , uint32_t * dsize , uint32_t upx0 , uint32_t upx1 , uint32_t ep ) {
int32_t backbytes , unp_offset = - 1 ;
uint32_t backsize , myebx = 0 , scur = 0 , dcur = 0 , i , magic [ ] = {
0x108 , 0x110 , 0xd5 , 0 }
;
int oob ;
while ( 1 ) {
while ( ( oob = doubleebx ( src , & myebx , & scur , ssize ) ) == 1 ) {
if ( scur >= ssize || dcur >= * dsize ) return - 1 ;
dst [ dcur ++ ] = src [ scur ++ ] ;
}
if ( oob == - 1 ) return - 1 ;
backbytes = 1 ;
while ( 1 ) {
if ( ( oob = doubleebx ( src , & myebx , & scur , ssize ) ) == - 1 ) return - 1 ;
backbytes = backbytes * 2 + oob ;
if ( ( oob = doubleebx ( src , & myebx , & scur , ssize ) ) == - 1 ) return - 1 ;
if ( oob ) break ;
}
backbytes -= 3 ;
if ( backbytes >= 0 ) {
if ( scur >= ssize ) return - 1 ;
backbytes <<= 8 ;
backbytes += ( unsigned char ) ( src [ scur ++ ] ) ;
backbytes ^= 0xffffffff ;
if ( ! backbytes ) break ;
unp_offset = backbytes ;
}
if ( ( backsize = ( uint32_t ) doubleebx ( src , & myebx , & scur , ssize ) ) == 0xffffffff ) return - 1 ;
if ( ( oob = doubleebx ( src , & myebx , & scur , ssize ) ) == - 1 ) return - 1 ;
backsize = backsize * 2 + oob ;
if ( ! backsize ) {
backsize ++ ;
do {
if ( ( oob = doubleebx ( src , & myebx , & scur , ssize ) ) == - 1 ) return - 1 ;
backsize = backsize * 2 + oob ;
}
while ( ( oob = doubleebx ( src , & myebx , & scur , ssize ) ) == 0 ) ;
if ( oob == - 1 ) return - 1 ;
backsize += 2 ;
}
if ( ( uint32_t ) unp_offset < 0xfffff300 ) backsize ++ ;
backsize ++ ;
if ( ! CLI_ISCONTAINED ( dst , * dsize , dst + dcur + unp_offset , backsize ) || ! CLI_ISCONTAINED ( dst , * dsize , dst + dcur , backsize ) || unp_offset >= 0 ) return - 1 ;
for ( i = 0 ;
i < backsize ;
i ++ ) dst [ dcur + i ] = dst [ dcur + unp_offset + i ] ;
dcur += backsize ;
}
return pefromupx ( src , ssize , dst , dsize , ep , upx0 , upx1 , magic , dcur ) ;
} |
-5,420,171,864,670,539,000 | debian | 12 | 0 | void qtest_clock_warp ( int64_t dest ) {
int64_t clock = qemu_get_clock_ns ( vm_clock ) ;
assert ( qtest_enabled ( ) ) ;
while ( clock < dest ) {
int64_t deadline = qemu_clock_deadline ( vm_clock ) ;
int64_t warp = MIN ( dest - clock , deadline ) ;
qemu_icount_bias += warp ;
qemu_run_timers ( vm_clock ) ;
clock = qemu_get_clock_ns ( vm_clock ) ;
}
qemu_notify_event ( ) ;
} |
-1,929,262,071,302,712,000 | debian | 3 | 0 | static void Type_Signature_Free ( struct _cms_typehandler_struct * self , void * Ptr ) {
_cmsFree ( self -> ContextID , Ptr ) ;
} |
-6,552,851,419,396,579,000 | debian | 4 | 0 | static int SpoolssStartPagePrinter_r ( tvbuff_t * tvb , int offset , packet_info * pinfo , proto_tree * tree , dcerpc_info * di , guint8 * drep ) {
offset = dissect_doserror ( tvb , offset , pinfo , tree , di , drep , hf_rc , NULL ) ;
return offset ;
} |
7,072,059,544,915,634,000 | chrome | 9 | 0 | static UChar GetUniFromLMBCSUni ( char const * * ppLMBCSin ) {
uint8_t HighCh = * ( * ppLMBCSin ) ++ ;
uint8_t LowCh = * ( * ppLMBCSin ) ++ ;
if ( HighCh == ULMBCS_UNICOMPATZERO ) {
HighCh = LowCh ;
LowCh = 0 ;
}
return ( UChar ) ( ( HighCh << 8 ) | LowCh ) ;
} |
7,191,899,184,788,440,000 | debian | 37 | 1 | char * get_arg ( char * line , my_bool get_next_arg ) {
char * ptr , * start ;
my_bool quoted = 0 , valid_arg = 0 ;
char qtype = 0 ;
ptr = line ;
if ( get_next_arg ) {
for ( ;
* ptr ;
ptr ++ ) ;
if ( * ( ptr + 1 ) ) ptr ++ ;
}
else {
while ( my_isspace ( charset_info , * ptr ) ) ptr ++ ;
if ( * ptr == '\\' ) ptr += 2 ;
else while ( * ptr && ! my_isspace ( charset_info , * ptr ) ) ptr ++ ;
}
if ( ! * ptr ) return NullS ;
while ( my_isspace ( charset_info , * ptr ) ) ptr ++ ;
if ( * ptr == '\'' || * ptr == '\"' || * ptr == '`' ) {
qtype = * ptr ;
quoted = 1 ;
ptr ++ ;
}
for ( start = ptr ;
* ptr ;
ptr ++ ) {
if ( * ptr == '\\' && ptr [ 1 ] ) {
strmov_overlapp ( ptr , ptr + 1 ) ;
}
else if ( ( ! quoted && * ptr == ' ' ) || ( quoted && * ptr == qtype ) ) {
* ptr = 0 ;
break ;
}
}
valid_arg = ptr != start ;
return valid_arg ? start : NullS ;
} |
8,637,588,907,624,250,000 | debian | 14 | 0 | static int dissect_pcp_message_error ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , int offset ) {
gint32 error_num ;
pcp_conv_info_t * pcp_conv_info ;
col_append_str ( pinfo -> cinfo , COL_INFO , "[ERROR] " ) ;
proto_tree_add_item ( tree , hf_pcp_pdu_error , tvb , offset , 4 , ENC_BIG_ENDIAN ) ;
error_num = tvb_get_ntohl ( tvb , offset ) ;
col_append_fstr ( pinfo -> cinfo , COL_INFO , "error=%s " , val_to_str ( error_num , packettypenames_errors , "Unknown Error:%i" ) ) ;
offset += 4 ;
if ( error_num == PM_ERR_NAME ) {
pcp_conv_info = get_pcp_conversation_info ( pinfo ) ;
pcp_conv_info -> pmid_name_candidates = wmem_array_new ( wmem_file_scope ( ) , sizeof ( guint8 * ) ) ;
}
return offset ;
} |
7,424,930,167,238,098,000 | debian | 13 | 0 | static int claimintf ( struct usb_dev_state * ps , unsigned int ifnum ) {
struct usb_device * dev = ps -> dev ;
struct usb_interface * intf ;
int err ;
if ( ifnum >= 8 * sizeof ( ps -> ifclaimed ) ) return - EINVAL ;
if ( test_bit ( ifnum , & ps -> ifclaimed ) ) return 0 ;
if ( ps -> privileges_dropped && ! test_bit ( ifnum , & ps -> interface_allowed_mask ) ) return - EACCES ;
intf = usb_ifnum_to_if ( dev , ifnum ) ;
if ( ! intf ) err = - ENOENT ;
else err = usb_driver_claim_interface ( & usbfs_driver , intf , ps ) ;
if ( err == 0 ) set_bit ( ifnum , & ps -> ifclaimed ) ;
return err ;
} |
1,825,251,920,369,138,400 | debian | 88 | 1 | int dtls1_get_record ( SSL * s ) {
int ssl_major , ssl_minor ;
int i , n ;
SSL3_RECORD * rr ;
unsigned char * p = NULL ;
unsigned short version ;
DTLS1_BITMAP * bitmap ;
unsigned int is_next_epoch ;
rr = RECORD_LAYER_get_rrec ( & s -> rlayer ) ;
again : if ( dtls1_process_buffered_records ( s ) < 0 ) return - 1 ;
if ( dtls1_get_processed_record ( s ) ) return 1 ;
if ( ( RECORD_LAYER_get_rstate ( & s -> rlayer ) != SSL_ST_READ_BODY ) || ( RECORD_LAYER_get_packet_length ( & s -> rlayer ) < DTLS1_RT_HEADER_LENGTH ) ) {
n = ssl3_read_n ( s , DTLS1_RT_HEADER_LENGTH , SSL3_BUFFER_get_len ( & s -> rlayer . rbuf ) , 0 , 1 ) ;
if ( n <= 0 ) return ( n ) ;
if ( RECORD_LAYER_get_packet_length ( & s -> rlayer ) != DTLS1_RT_HEADER_LENGTH ) {
RECORD_LAYER_reset_packet_length ( & s -> rlayer ) ;
goto again ;
}
RECORD_LAYER_set_rstate ( & s -> rlayer , SSL_ST_READ_BODY ) ;
p = RECORD_LAYER_get_packet ( & s -> rlayer ) ;
if ( s -> msg_callback ) s -> msg_callback ( 0 , 0 , SSL3_RT_HEADER , p , DTLS1_RT_HEADER_LENGTH , s , s -> msg_callback_arg ) ;
rr -> type = * ( p ++ ) ;
ssl_major = * ( p ++ ) ;
ssl_minor = * ( p ++ ) ;
version = ( ssl_major << 8 ) | ssl_minor ;
n2s ( p , rr -> epoch ) ;
memcpy ( & ( RECORD_LAYER_get_read_sequence ( & s -> rlayer ) [ 2 ] ) , p , 6 ) ;
p += 6 ;
n2s ( p , rr -> length ) ;
if ( ! s -> first_packet ) {
if ( version != s -> version ) {
rr -> length = 0 ;
RECORD_LAYER_reset_packet_length ( & s -> rlayer ) ;
goto again ;
}
}
if ( ( version & 0xff00 ) != ( s -> version & 0xff00 ) ) {
rr -> length = 0 ;
RECORD_LAYER_reset_packet_length ( & s -> rlayer ) ;
goto again ;
}
if ( rr -> length > SSL3_RT_MAX_ENCRYPTED_LENGTH ) {
rr -> length = 0 ;
RECORD_LAYER_reset_packet_length ( & s -> rlayer ) ;
goto again ;
}
}
if ( rr -> length > RECORD_LAYER_get_packet_length ( & s -> rlayer ) - DTLS1_RT_HEADER_LENGTH ) {
i = rr -> length ;
n = ssl3_read_n ( s , i , i , 1 , 1 ) ;
if ( n != i ) {
rr -> length = 0 ;
RECORD_LAYER_reset_packet_length ( & s -> rlayer ) ;
goto again ;
}
}
RECORD_LAYER_set_rstate ( & s -> rlayer , SSL_ST_READ_HEADER ) ;
bitmap = dtls1_get_bitmap ( s , rr , & is_next_epoch ) ;
if ( bitmap == NULL ) {
rr -> length = 0 ;
RECORD_LAYER_reset_packet_length ( & s -> rlayer ) ;
goto again ;
}
# ifndef OPENSSL_NO_SCTP if ( ! BIO_dgram_is_sctp ( SSL_get_rbio ( s ) ) ) {
# endif if ( ! dtls1_record_replay_check ( s , bitmap ) ) {
rr -> length = 0 ;
RECORD_LAYER_reset_packet_length ( & s -> rlayer ) ;
goto again ;
}
# ifndef OPENSSL_NO_SCTP }
# endif if ( rr -> length == 0 ) goto again ;
if ( is_next_epoch ) {
if ( ( SSL_in_init ( s ) || ossl_statem_get_in_handshake ( s ) ) ) {
if ( dtls1_buffer_record ( s , & ( DTLS_RECORD_LAYER_get_unprocessed_rcds ( & s -> rlayer ) ) , rr -> seq_num ) < 0 ) return - 1 ;
dtls1_record_bitmap_update ( s , bitmap ) ;
}
rr -> length = 0 ;
RECORD_LAYER_reset_packet_length ( & s -> rlayer ) ;
goto again ;
}
if ( ! dtls1_process_record ( s ) ) {
rr -> length = 0 ;
RECORD_LAYER_reset_packet_length ( & s -> rlayer ) ;
goto again ;
}
dtls1_record_bitmap_update ( s , bitmap ) ;
return ( 1 ) ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | int dissect_h245_T38FaxProfile ( 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_T38FaxProfile , T38FaxProfile_sequence ) ;
return offset ;
} |
-5,456,913,190,944,845,000 | chrome | 146 | 0 | TEST_F ( TemplateURLTest , ReplaceSearchTerms ) {
struct TestData {
const std : : string url ;
const std : : string expected_result ;
}
test_data [ ] = {
{
"http://foo/{
language}
{
searchTerms}
{
inputEncoding}
" , "http://foo/{
language}
XUTF-8" }
, {
"http://foo/{
language}
{
inputEncoding}
{
searchTerms}
" , "http://foo/{
language}
UTF-8X" }
, {
"http://foo/{
searchTerms}
{
language}
{
inputEncoding}
" , "http://foo/X{
language}
UTF-8" }
, {
"http://foo/{
searchTerms}
{
inputEncoding}
{
language}
" , "http://foo/XUTF-8{
language}
" }
, {
"http://foo/{
inputEncoding}
{
searchTerms}
{
language}
" , "http://foo/UTF-8X{
language}
" }
, {
"http://foo/{
inputEncoding}
{
language}
{
searchTerms}
" , "http://foo/UTF-8{
language}
X" }
, {
"http://foo/{
language}
a{
searchTerms}
a{
inputEncoding}
a" , "http://foo/{
language}
aXaUTF-8a" }
, {
"http://foo/{
language}
a{
inputEncoding}
a{
searchTerms}
a" , "http://foo/{
language}
aUTF-8aXa" }
, {
"http://foo/{
searchTerms}
a{
language}
a{
inputEncoding}
a" , "http://foo/Xa{
language}
aUTF-8a" }
, {
"http://foo/{
searchTerms}
a{
inputEncoding}
a{
language}
a" , "http://foo/XaUTF-8a{
language}
a" }
, {
"http://foo/{
inputEncoding}
a{
searchTerms}
a{
language}
a" , "http://foo/UTF-8aXa{
language}
a" }
, {
"http://foo/{
inputEncoding}
a{
language}
a{
searchTerms}
a" , "http://foo/UTF-8a{
language}
aXa" }
, }
;
TemplateURLData data ;
data . input_encodings . push_back ( "UTF-8" ) ;
for ( size_t i = 0 ;
i < arraysize ( test_data ) ;
++ i ) {
data . SetURL ( test_data [ i ] . url ) ;
TemplateURL url ( data ) ;
EXPECT_TRUE ( url . url_ref ( ) . IsValid ( search_terms_data_ ) ) ;
ASSERT_TRUE ( url . url_ref ( ) . SupportsReplacement ( search_terms_data_ ) ) ;
std : : string expected_result = test_data [ i ] . expected_result ;
base : : ReplaceSubstringsAfterOffset ( & expected_result , 0 , "{
language}
" , search_terms_data_ . GetApplicationLocale ( ) ) ;
GURL result ( url . url_ref ( ) . ReplaceSearchTerms ( TemplateURLRef : : SearchTermsArgs ( ASCIIToUTF16 ( "X" ) ) , search_terms_data_ ) ) ;
ASSERT_TRUE ( result . is_valid ( ) ) ;
EXPECT_EQ ( expected_result , result . spec ( ) ) ;
}
} |
-7,422,764,464,424,761,000 | chrome | 46 | 0 | TEST_F ( ExtensionServiceSyncTest , DontSelfNotify ) {
base : : FilePath source_install_dir = data_dir ( ) . AppendASCII ( "good" ) . AppendASCII ( "Extensions" ) ;
base : : FilePath pref_path = source_install_dir . DirName ( ) . Append ( chrome : : kPreferencesFilename ) ;
InitializeInstalledExtensionService ( pref_path , source_install_dir ) ;
ProfileSyncServiceFactory : : GetForProfile ( profile ( ) ) -> SetFirstSetupComplete ( ) ;
extension_sync_service ( ) ;
service ( ) -> Init ( ) ;
ASSERT_TRUE ( service ( ) -> is_ready ( ) ) ;
ASSERT_EQ ( 3u , loaded_ . size ( ) ) ;
ASSERT_TRUE ( service ( ) -> IsExtensionEnabled ( good0 ) ) ;
syncer : : FakeSyncChangeProcessor * processor = new syncer : : FakeSyncChangeProcessor ;
extension_sync_service ( ) -> MergeDataAndStartSyncing ( syncer : : EXTENSIONS , syncer : : SyncDataList ( ) , base : : WrapUnique ( processor ) , base : : MakeUnique < syncer : : SyncErrorFactoryMock > ( ) ) ;
processor -> changes ( ) . clear ( ) ;
{
const Extension * extension = service ( ) -> GetExtensionById ( good0 , true ) ;
ASSERT_TRUE ( extension ) ;
ExtensionSyncData data ( * extension , false , extensions : : disable_reason : : DISABLE_USER_ACTION , false , false , ExtensionSyncData : : BOOLEAN_UNSET , false ) ;
SyncChangeList list ( 1 , data . GetSyncChange ( SyncChange : : ACTION_UPDATE ) ) ;
extension_sync_service ( ) -> ProcessSyncChanges ( FROM_HERE , list ) ;
EXPECT_TRUE ( processor -> changes ( ) . empty ( ) ) ;
}
{
const Extension * extension = service ( ) -> GetExtensionById ( good0 , true ) ;
ASSERT_TRUE ( extension ) ;
ExtensionSyncData data ( * extension , false , extensions : : disable_reason : : DISABLE_NONE , true , false , ExtensionSyncData : : BOOLEAN_UNSET , false ) ;
SyncChangeList list ( 1 , data . GetSyncChange ( SyncChange : : ACTION_UPDATE ) ) ;
extension_sync_service ( ) -> ProcessSyncChanges ( FROM_HERE , list ) ;
EXPECT_TRUE ( processor -> changes ( ) . empty ( ) ) ;
}
{
const Extension * extension = service ( ) -> GetExtensionById ( good0 , true ) ;
ASSERT_TRUE ( extension ) ;
ExtensionSyncData data ( * extension , false , extensions : : disable_reason : : DISABLE_USER_ACTION | extensions : : disable_reason : : DISABLE_PERMISSIONS_INCREASE , false , false , ExtensionSyncData : : BOOLEAN_UNSET , false ) ;
SyncChangeList list ( 1 , data . GetSyncChange ( SyncChange : : ACTION_UPDATE ) ) ;
extension_sync_service ( ) -> ProcessSyncChanges ( FROM_HERE , list ) ;
EXPECT_TRUE ( processor -> changes ( ) . empty ( ) ) ;
}
{
const Extension * extension = service ( ) -> GetExtensionById ( good0 , true ) ;
ASSERT_TRUE ( extension ) ;
ExtensionSyncData data ( * extension , false , extensions : : disable_reason : : DISABLE_USER_ACTION | extensions : : disable_reason : : DISABLE_PERMISSIONS_INCREASE , false , false , ExtensionSyncData : : BOOLEAN_UNSET , false ) ;
SyncChangeList list ( 1 , data . GetSyncChange ( SyncChange : : ACTION_DELETE ) ) ;
extension_sync_service ( ) -> ProcessSyncChanges ( FROM_HERE , list ) ;
EXPECT_TRUE ( processor -> changes ( ) . empty ( ) ) ;
}
} |
5,357,882,892,791,796,000 | debian | 15 | 0 | void e1000e_core_pre_save ( E1000ECore * core ) {
int i ;
NetClientState * nc = qemu_get_queue ( core -> owner_nic ) ;
if ( nc -> link_down && e1000e_have_autoneg ( core ) ) {
core -> phy [ 0 ] [ PHY_STATUS ] |= MII_SR_AUTONEG_COMPLETE ;
e1000e_update_flowctl_status ( core ) ;
}
for ( i = 0 ;
i < ARRAY_SIZE ( core -> tx ) ;
i ++ ) {
if ( net_tx_pkt_has_fragments ( core -> tx [ i ] . tx_pkt ) ) {
core -> tx [ i ] . skip_cp = true ;
}
}
} |
4,489,017,523,191,997,000 | debian | 4 | 0 | static int dissect_h225_TBCD_STRING_SIZE_1_4 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_size_constrained_type ( tvb , offset , actx , tree , hf_index , dissect_h225_TBCD_STRING , "TBCD_STRING" , 1 , 4 , FALSE ) ;
return offset ;
} |
-5,706,788,925,640,467,000 | chrome | 7 | 0 | static BLOCK_SIZE get_rd_var_based_fixed_partition ( VP9_COMP * cpi , int mi_row , int mi_col ) {
unsigned int var = get_sby_perpixel_diff_variance ( cpi , & cpi -> mb . plane [ 0 ] . src , mi_row , mi_col , BLOCK_64X64 ) ;
if ( var < 8 ) return BLOCK_64X64 ;
else if ( var < 128 ) return BLOCK_32X32 ;
else if ( var < 2048 ) return BLOCK_16X16 ;
else return BLOCK_8X8 ;
} |
3,557,739,556,029,059,000 | chrome | 7 | 0 | void vp9_sad ## m ## x ## n ## x4d_c ( const uint8_t * src , int src_stride , const uint8_t * const refs [ ] , int ref_stride , unsigned int * sads ) {
int i ;
for ( i = 0 ;
i < 4 ;
++ i ) sads [ i ] = vp9_sad ## m ## x ## n ## _c ( src , src_stride , refs [ i ] , ref_stride ) ;
\ }
sadMxN ( 64 , 64 ) sadMxNxK ( 64 , 64 , 3 ) sadMxNxK ( 64 , 64 , 8 ) sadMxNx4D ( 64 , 64 ) sadMxN ( 64 , 32 ) sadMxNx4D ( 64 , 32 ) sadMxN ( 32 , 64 ) sadMxNx4D ( 32 , 64 ) sadMxN ( 32 , 32 ) sadMxNxK ( 32 , 32 , 3 ) sadMxNxK ( 32 , 32 , 8 ) sadMxNx4D ( 32 , 32 ) sadMxN ( 32 , 16 ) sadMxNx4D ( 32 , 16 ) sadMxN ( 16 , 32 ) sadMxNx4D ( 16 , 32 ) sadMxN ( 16 , 16 ) sadMxNxK ( 16 , 16 , 3 ) sadMxNxK ( 16 , 16 , 8 ) sadMxNx4D ( 16 , 16 ) |
6,790,518,433,053,241,000 | debian | 104 | 0 | static void gtkui_connection_data_split ( void ) {
GtkWidget * vbox , * scrolled , * label , * child ;
GtkWidget * hbox_big , * hbox_small , * button ;
GtkTextIter iter ;
char tmp [ MAX_ASCII_ADDR_LEN ] ;
char title [ MAX_ASCII_ADDR_LEN + 6 ] ;
static gint scroll_split = 1 ;
DEBUG_MSG ( "gtk_connection_data_split" ) ;
conntrack_hook_conn_del ( curr_conn , join_print_po ) ;
if ( data_window ) {
child = gtk_bin_get_child ( GTK_BIN ( data_window ) ) ;
gtk_container_remove ( GTK_CONTAINER ( data_window ) , child ) ;
textview3 = NULL ;
joinedbuf = NULL ;
endmark3 = NULL ;
}
else {
data_window = gtkui_page_new ( "Connection data" , & gtkui_destroy_conndata , & gtkui_connection_data_detach ) ;
}
curr_conn -> flags |= CONN_VIEWING ;
hbox_big = gtkui_box_new ( GTK_ORIENTATION_HORIZONTAL , 5 , TRUE ) ;
gtk_container_add ( GTK_CONTAINER ( data_window ) , hbox_big ) ;
gtk_widget_show ( hbox_big ) ;
vbox = gtkui_box_new ( GTK_ORIENTATION_VERTICAL , 0 , FALSE ) ;
gtk_box_pack_start ( GTK_BOX ( hbox_big ) , vbox , TRUE , TRUE , 0 ) ;
gtk_widget_show ( vbox ) ;
snprintf ( title , MAX_ASCII_ADDR_LEN + 6 , "%s:%d" , ip_addr_ntoa ( & curr_conn -> L3_addr1 , tmp ) , ntohs ( curr_conn -> L4_addr1 ) ) ;
label = gtk_label_new ( title ) ;
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0 , 0.5 ) ;
gtk_box_pack_start ( GTK_BOX ( vbox ) , label , FALSE , FALSE , 0 ) ;
gtk_widget_show ( label ) ;
scrolled = gtk_scrolled_window_new ( NULL , NULL ) ;
gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW ( scrolled ) , GTK_POLICY_AUTOMATIC , GTK_POLICY_AUTOMATIC ) ;
gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW ( scrolled ) , GTK_SHADOW_IN ) ;
gtk_box_pack_start ( GTK_BOX ( vbox ) , scrolled , TRUE , TRUE , 0 ) ;
gtk_widget_show ( scrolled ) ;
textview1 = gtk_text_view_new ( ) ;
gtk_text_view_set_wrap_mode ( GTK_TEXT_VIEW ( textview1 ) , GTK_WRAP_CHAR ) ;
gtk_text_view_set_editable ( GTK_TEXT_VIEW ( textview1 ) , FALSE ) ;
gtk_text_view_set_cursor_visible ( GTK_TEXT_VIEW ( textview1 ) , FALSE ) ;
gtk_text_view_set_right_margin ( GTK_TEXT_VIEW ( textview1 ) , 5 ) ;
gtk_text_view_set_right_margin ( GTK_TEXT_VIEW ( textview1 ) , 5 ) ;
gtk_container_add ( GTK_CONTAINER ( scrolled ) , textview1 ) ;
gtk_widget_show ( textview1 ) ;
splitbuf1 = gtk_text_view_get_buffer ( GTK_TEXT_VIEW ( textview1 ) ) ;
gtk_text_buffer_create_tag ( splitbuf1 , "blue_fg" , "foreground" , "blue" , NULL ) ;
gtk_text_buffer_create_tag ( splitbuf1 , "monospace" , "family" , "monospace" , NULL ) ;
gtk_text_buffer_get_end_iter ( splitbuf1 , & iter ) ;
endmark1 = gtk_text_buffer_create_mark ( splitbuf1 , "end" , & iter , FALSE ) ;
hbox_small = gtkui_box_new ( GTK_ORIENTATION_HORIZONTAL , 5 , TRUE ) ;
gtk_box_pack_start ( GTK_BOX ( vbox ) , hbox_small , FALSE , FALSE , 0 ) ;
gtk_widget_show ( hbox_small ) ;
button = gtk_button_new_with_mnemonic ( "_Join Views" ) ;
g_signal_connect ( G_OBJECT ( button ) , "clicked" , G_CALLBACK ( gtkui_connection_data_join ) , NULL ) ;
gtk_box_pack_start ( GTK_BOX ( hbox_small ) , button , TRUE , TRUE , 0 ) ;
gtk_widget_show ( button ) ;
button = gtk_button_new_with_mnemonic ( "_Inject Data" ) ;
g_signal_connect ( G_OBJECT ( button ) , "clicked" , G_CALLBACK ( gtkui_connection_inject ) , NULL ) ;
gtk_box_pack_start ( GTK_BOX ( hbox_small ) , button , TRUE , TRUE , 0 ) ;
gtk_widget_show ( button ) ;
vbox = gtkui_box_new ( GTK_ORIENTATION_VERTICAL , 0 , FALSE ) ;
gtk_box_pack_start ( GTK_BOX ( hbox_big ) , vbox , TRUE , TRUE , 0 ) ;
gtk_widget_show ( vbox ) ;
snprintf ( title , MAX_ASCII_ADDR_LEN + 6 , "%s:%d" , ip_addr_ntoa ( & curr_conn -> L3_addr2 , tmp ) , ntohs ( curr_conn -> L4_addr2 ) ) ;
label = gtk_label_new ( title ) ;
gtk_misc_set_alignment ( GTK_MISC ( label ) , 0 , 0.5 ) ;
gtk_box_pack_start ( GTK_BOX ( vbox ) , label , FALSE , FALSE , 0 ) ;
gtk_widget_show ( label ) ;
scrolled = gtk_scrolled_window_new ( NULL , NULL ) ;
gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW ( scrolled ) , GTK_POLICY_AUTOMATIC , GTK_POLICY_AUTOMATIC ) ;
gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW ( scrolled ) , GTK_SHADOW_IN ) ;
gtk_box_pack_start ( GTK_BOX ( vbox ) , scrolled , TRUE , TRUE , 0 ) ;
gtk_widget_show ( scrolled ) ;
textview2 = gtk_text_view_new ( ) ;
gtk_text_view_set_wrap_mode ( GTK_TEXT_VIEW ( textview2 ) , GTK_WRAP_CHAR ) ;
gtk_text_view_set_editable ( GTK_TEXT_VIEW ( textview2 ) , FALSE ) ;
gtk_text_view_set_cursor_visible ( GTK_TEXT_VIEW ( textview2 ) , FALSE ) ;
gtk_text_view_set_right_margin ( GTK_TEXT_VIEW ( textview2 ) , 5 ) ;
gtk_text_view_set_right_margin ( GTK_TEXT_VIEW ( textview2 ) , 5 ) ;
gtk_container_add ( GTK_CONTAINER ( scrolled ) , textview2 ) ;
gtk_widget_show ( textview2 ) ;
splitbuf2 = gtk_text_view_get_buffer ( GTK_TEXT_VIEW ( textview2 ) ) ;
gtk_text_buffer_create_tag ( splitbuf2 , "blue_fg" , "foreground" , "blue" , NULL ) ;
gtk_text_buffer_create_tag ( splitbuf2 , "monospace" , "family" , "monospace" , NULL ) ;
gtk_text_buffer_get_end_iter ( splitbuf2 , & iter ) ;
endmark2 = gtk_text_buffer_create_mark ( splitbuf2 , "end" , & iter , FALSE ) ;
hbox_small = gtkui_box_new ( GTK_ORIENTATION_HORIZONTAL , 5 , TRUE ) ;
gtk_box_pack_start ( GTK_BOX ( vbox ) , hbox_small , FALSE , FALSE , 0 ) ;
gtk_widget_show ( hbox_small ) ;
button = gtk_button_new_with_mnemonic ( "Inject _File" ) ;
g_signal_connect ( G_OBJECT ( button ) , "clicked" , G_CALLBACK ( gtkui_connection_inject_file ) , NULL ) ;
gtk_box_pack_start ( GTK_BOX ( hbox_small ) , button , TRUE , TRUE , 0 ) ;
gtk_widget_show ( button ) ;
button = gtk_button_new_with_mnemonic ( "_Kill Connection" ) ;
g_signal_connect ( G_OBJECT ( button ) , "clicked" , G_CALLBACK ( gtkui_connection_kill_curr_conn ) , NULL ) ;
gtk_box_pack_start ( GTK_BOX ( hbox_small ) , button , TRUE , TRUE , 0 ) ;
gtk_widget_show ( button ) ;
gtk_widget_show ( data_window ) ;
if ( GTK_IS_WINDOW ( data_window ) ) gtk_window_present ( GTK_WINDOW ( data_window ) ) ;
else gtkui_page_present ( data_window ) ;
g_timeout_add ( 500 , gtkui_connections_scroll , & scroll_split ) ;
connbuf_print ( & curr_conn -> data , split_print ) ;
conntrack_hook_conn_add ( curr_conn , split_print_po ) ;
} |
-341,028,540,041,678,100 | debian | 3 | 0 | int main ( int argc , char * argv [ ] ) {
return ntpqmain ( argc , argv ) ;
} |
1,676,654,288,894,940,700 | debian | 10 | 0 | void kadmin_lock ( int argc , char * argv [ ] ) {
kadm5_ret_t retval ;
if ( locked ) return ;
retval = kadm5_lock ( handle ) ;
if ( retval ) {
com_err ( "lock" , retval , "" ) ;
return ;
}
locked = 1 ;
} |
8,460,430,819,945,784,000 | debian | 14 | 0 | int load_initrd ( const char * filename , uint8_t * addr ) {
int fd , size ;
printf ( "Load initrd\n" ) ;
fd = open ( filename , O_RDONLY ) ;
if ( fd < 0 ) return - 1 ;
size = read ( fd , addr , 16 * 1024 * 1024 ) ;
if ( size < 0 ) goto fail ;
close ( fd ) ;
printf ( "Load initrd: %d\n" , size ) ;
return size ;
fail : close ( fd ) ;
printf ( "Load initrd failed\n" ) ;
return - 1 ;
} |
5,838,244,232,542,872,000 | chrome | 28 | 0 | TEST_F ( ScoredHistoryMatchTest , CullSearchResults ) {
scoped_ptr < TemplateURLService > template_url_service = make_scoped_ptr ( new TemplateURLService ( nullptr , make_scoped_ptr ( new SearchTermsData ) , nullptr , scoped_ptr < TemplateURLServiceClient > ( ) , nullptr , nullptr , base : : Closure ( ) ) ) ;
base : : Time now = base : : Time : : NowFromSystemTime ( ) ;
history : : URLRow row ( MakeURLRow ( "http://testsearch.com/thequery" , "Test Search Engine" , 3 , 30 , 1 ) ) ;
RowWordStarts word_starts ;
PopulateWordStarts ( row , & word_starts ) ;
WordStarts one_word_no_offset ( 1 , 0u ) ;
VisitInfoVector visits = CreateVisitInfoVector ( 3 , 30 , now ) ;
visits [ 0 ] . second = ui : : PAGE_TRANSITION_TYPED ;
ScoredHistoryMatch scored_a ( row , visits , ASCIIToUTF16 ( "thequery" ) , Make1Term ( "thequery" ) , one_word_no_offset , word_starts , false , template_url_service . get ( ) , now ) ;
EXPECT_GT ( scored_a . raw_score , 0 ) ;
ScoredHistoryMatch scored_b ( row , visits , ASCIIToUTF16 ( "testsearch" ) , Make1Term ( "testsearch" ) , one_word_no_offset , word_starts , false , template_url_service . get ( ) , now ) ;
EXPECT_GT ( scored_b . raw_score , 0 ) ;
TemplateURLData data ;
data . SetShortName ( ASCIIToUTF16 ( "TestEngine" ) ) ;
data . SetKeyword ( ASCIIToUTF16 ( "TestEngine" ) ) ;
data . SetURL ( "http://testsearch.com/{
searchTerms}
" ) ;
TemplateURL * template_url = new TemplateURL ( data ) ;
template_url_service -> Add ( template_url ) ;
template_url_service -> SetUserSelectedDefaultSearchProvider ( template_url ) ;
template_url_service -> Load ( ) ;
ScoredHistoryMatch scored_c ( row , visits , ASCIIToUTF16 ( "thequery" ) , Make1Term ( "thequery" ) , one_word_no_offset , word_starts , false , template_url_service . get ( ) , now ) ;
EXPECT_EQ ( 0 , scored_c . raw_score ) ;
ScoredHistoryMatch scored_d ( row , visits , ASCIIToUTF16 ( "testsearch" ) , Make1Term ( "testsearch" ) , one_word_no_offset , word_starts , false , template_url_service . get ( ) , now ) ;
EXPECT_EQ ( 0 , scored_d . raw_score ) ;
} |
-2,654,475,221,056,024,000 | debian | 36 | 1 | void traverse_commit_list ( struct rev_info * revs , show_commit_fn show_commit , show_object_fn show_object , void * data ) {
int i ;
struct commit * commit ;
struct strbuf base ;
strbuf_init ( & base , PATH_MAX ) ;
while ( ( commit = get_revision ( revs ) ) != NULL ) {
if ( commit -> tree ) add_pending_tree ( revs , commit -> tree ) ;
show_commit ( commit , data ) ;
}
for ( i = 0 ;
i < revs -> pending . nr ;
i ++ ) {
struct object_array_entry * pending = revs -> pending . objects + i ;
struct object * obj = pending -> item ;
const char * name = pending -> name ;
const char * path = pending -> path ;
if ( obj -> flags & ( UNINTERESTING | SEEN ) ) continue ;
if ( obj -> type == OBJ_TAG ) {
obj -> flags |= SEEN ;
show_object ( obj , NULL , name , data ) ;
continue ;
}
if ( ! path ) path = "" ;
if ( obj -> type == OBJ_TREE ) {
process_tree ( revs , ( struct tree * ) obj , show_object , NULL , & base , path , data ) ;
continue ;
}
if ( obj -> type == OBJ_BLOB ) {
process_blob ( revs , ( struct blob * ) obj , show_object , NULL , path , data ) ;
continue ;
}
die ( "unknown pending object %s (%s)" , oid_to_hex ( & obj -> oid ) , name ) ;
}
object_array_clear ( & revs -> pending ) ;
strbuf_release ( & base ) ;
} |
-3,616,725,510,139,109,000 | chrome | 31 | 0 | static unsigned int do_16x16_motion_iteration ( VP9_COMP * cpi , const MV * ref_mv , MV * dst_mv , int mb_row , int mb_col ) {
MACROBLOCK * const x = & cpi -> mb ;
MACROBLOCKD * const xd = & x -> e_mbd ;
const MV_SPEED_FEATURES * const mv_sf = & cpi -> sf . mv ;
const vp9_variance_fn_ptr_t v_fn_ptr = cpi -> fn_ptr [ BLOCK_16X16 ] ;
const int tmp_col_min = x -> mv_col_min ;
const int tmp_col_max = x -> mv_col_max ;
const int tmp_row_min = x -> mv_row_min ;
const int tmp_row_max = x -> mv_row_max ;
MV ref_full ;
int sad_list [ 5 ] ;
int step_param = mv_sf -> reduce_first_step_size ;
step_param = MIN ( step_param , MAX_MVSEARCH_STEPS - 2 ) ;
vp9_set_mv_search_range ( x , ref_mv ) ;
ref_full . col = ref_mv -> col >> 3 ;
ref_full . row = ref_mv -> row >> 3 ;
vp9_hex_search ( x , & ref_full , step_param , x -> errorperbit , 0 , cond_sad_list ( cpi , sad_list ) , & v_fn_ptr , 0 , ref_mv , dst_mv ) ;
{
int distortion ;
unsigned int sse ;
cpi -> find_fractional_mv_step ( x , dst_mv , ref_mv , cpi -> common . allow_high_precision_mv , x -> errorperbit , & v_fn_ptr , 0 , mv_sf -> subpel_iters_per_step , cond_sad_list ( cpi , sad_list ) , NULL , NULL , & distortion , & sse , NULL , 0 , 0 ) ;
}
xd -> mi [ 0 ] . src_mi -> mbmi . mode = NEWMV ;
xd -> mi [ 0 ] . src_mi -> mbmi . mv [ 0 ] . as_mv = * dst_mv ;
vp9_build_inter_predictors_sby ( xd , mb_row , mb_col , BLOCK_16X16 ) ;
x -> mv_col_min = tmp_col_min ;
x -> mv_col_max = tmp_col_max ;
x -> mv_row_min = tmp_row_min ;
x -> mv_row_max = tmp_row_max ;
return vp9_sad16x16 ( x -> plane [ 0 ] . src . buf , x -> plane [ 0 ] . src . stride , xd -> plane [ 0 ] . dst . buf , xd -> plane [ 0 ] . dst . stride ) ;
} |
3,649,198,920,984,613,400 | debian | 4 | 0 | static void vmsvga_index_write ( void * opaque , uint32_t address , uint32_t index ) {
struct vmsvga_state_s * s = opaque ;
s -> index = index ;
} |
-866,921,002,076,081,900 | debian | 24 | 0 | EXCLUSIVE_REGRESSION_TEST ( SDK_API_TSHttpConnectIntercept ) ( RegressionTest * test , int , int * pstatus ) {
* pstatus = REGRESSION_TEST_INPROGRESS ;
TSDebug ( UTDBG_TAG , "Starting test TSHttpConnectIntercept" ) ;
TSCont cont_test = TSContCreate ( cont_test_handler , TSMutexCreate ( ) ) ;
ConnectTestData * data = ( ConnectTestData * ) TSmalloc ( sizeof ( ConnectTestData ) ) ;
TSContDataSet ( cont_test , data ) ;
data -> test = test ;
data -> pstatus = pstatus ;
data -> magic = MAGIC_ALIVE ;
data -> test_case = TEST_CASE_CONNECT_ID1 ;
TSHttpHookAdd ( TS_HTTP_READ_REQUEST_HDR_HOOK , cont_test ) ;
data -> os = synserver_create ( SYNSERVER_DUMMY_PORT ) ;
data -> browser = synclient_txn_create ( ) ;
data -> request = generate_request ( 9 ) ;
sockaddr_in addr ;
ats_ip4_set ( & addr , 1 , 1 ) ;
data -> vc = TSHttpConnect ( ats_ip_sa_cast ( & addr ) ) ;
if ( TSVConnClosedGet ( data -> vc ) ) {
SDK_RPRINT ( data -> test , "TSHttpConnect" , "TestCase 1" , TC_FAIL , "Connect reported as closed immediately after open" ) ;
}
synclient_txn_send_request_to_vc ( data -> browser , data -> request , data -> vc ) ;
TSContSchedule ( cont_test , 25 , TS_THREAD_POOL_DEFAULT ) ;
return ;
} |
-6,024,601,983,167,899,000 | debian | 39 | 0 | static ActivationAction get_activation_action ( NautilusFile * file ) {
ActivationAction action ;
char * activation_uri ;
gboolean can_extract ;
can_extract = g_settings_get_boolean ( nautilus_preferences , NAUTILUS_PREFERENCES_AUTOMATIC_DECOMPRESSION ) ;
if ( can_extract && nautilus_file_is_archive ( file ) ) {
return ACTIVATION_ACTION_EXTRACT ;
}
if ( nautilus_file_is_nautilus_link ( file ) ) {
return ACTIVATION_ACTION_LAUNCH_DESKTOP_FILE ;
}
activation_uri = nautilus_file_get_activation_uri ( file ) ;
if ( activation_uri == NULL ) {
activation_uri = nautilus_file_get_uri ( file ) ;
}
action = ACTIVATION_ACTION_DO_NOTHING ;
if ( nautilus_file_is_launchable ( file ) ) {
char * executable_path ;
action = ACTIVATION_ACTION_LAUNCH ;
executable_path = g_filename_from_uri ( activation_uri , NULL , NULL ) ;
if ( ! executable_path ) {
action = ACTIVATION_ACTION_DO_NOTHING ;
}
else if ( nautilus_file_contains_text ( file ) ) {
action = get_default_executable_text_file_action ( ) ;
}
g_free ( executable_path ) ;
}
if ( action == ACTIVATION_ACTION_DO_NOTHING ) {
if ( nautilus_file_opens_in_view ( file ) ) {
action = ACTIVATION_ACTION_OPEN_IN_VIEW ;
}
else {
action = ACTIVATION_ACTION_OPEN_IN_APPLICATION ;
}
}
g_free ( activation_uri ) ;
return action ;
} |
5,651,124,822,185,018,000 | debian | 14 | 0 | static VALUE ossl_x509name_add_entry ( int argc , VALUE * argv , VALUE self ) {
X509_NAME * name ;
VALUE oid , value , type ;
const char * oid_name ;
rb_scan_args ( argc , argv , "21" , & oid , & value , & type ) ;
oid_name = StringValueCStr ( oid ) ;
StringValue ( value ) ;
if ( NIL_P ( type ) ) type = rb_aref ( OBJECT_TYPE_TEMPLATE , oid ) ;
GetX509Name ( self , name ) ;
if ( ! X509_NAME_add_entry_by_txt ( name , oid_name , NUM2INT ( type ) , ( const unsigned char * ) RSTRING_PTR ( value ) , RSTRING_LENINT ( value ) , - 1 , 0 ) ) {
ossl_raise ( eX509NameError , NULL ) ;
}
return self ;
} |
-6,105,298,668,491,047,000 | debian | 50 | 0 | static int msmpeg4_decode_dc ( MpegEncContext * s , int n , int * dir_ptr ) {
int level , pred ;
if ( s -> msmpeg4_version <= 2 ) {
if ( n < 4 ) {
level = get_vlc2 ( & s -> gb , v2_dc_lum_vlc . table , DC_VLC_BITS , 3 ) ;
}
else {
level = get_vlc2 ( & s -> gb , v2_dc_chroma_vlc . table , DC_VLC_BITS , 3 ) ;
}
if ( level < 0 ) return - 1 ;
level -= 256 ;
}
else {
if ( n < 4 ) {
level = get_vlc2 ( & s -> gb , ff_msmp4_dc_luma_vlc [ s -> dc_table_index ] . table , DC_VLC_BITS , 3 ) ;
}
else {
level = get_vlc2 ( & s -> gb , ff_msmp4_dc_chroma_vlc [ s -> dc_table_index ] . table , DC_VLC_BITS , 3 ) ;
}
if ( level < 0 ) {
av_log ( s -> avctx , AV_LOG_ERROR , "illegal dc vlc\n" ) ;
return - 1 ;
}
if ( level == DC_MAX ) {
level = get_bits ( & s -> gb , 8 ) ;
if ( get_bits1 ( & s -> gb ) ) level = - level ;
}
else if ( level != 0 ) {
if ( get_bits1 ( & s -> gb ) ) level = - level ;
}
}
if ( s -> msmpeg4_version == 1 ) {
int32_t * dc_val ;
pred = msmpeg4v1_pred_dc ( s , n , & dc_val ) ;
level += pred ;
* dc_val = level ;
}
else {
int16_t * dc_val ;
pred = ff_msmpeg4_pred_dc ( s , n , & dc_val , dir_ptr ) ;
level += pred ;
if ( n < 4 ) {
* dc_val = level * s -> y_dc_scale ;
}
else {
* dc_val = level * s -> c_dc_scale ;
}
}
return level ;
} |
-3,591,633,859,713,840,600 | debian | 30 | 0 | static void reorder_block ( MPADecodeContext * s , GranuleDef * g ) {
int i , j , len ;
INTFLOAT * ptr , * dst , * ptr1 ;
INTFLOAT tmp [ 576 ] ;
if ( g -> block_type != 2 ) return ;
if ( g -> switch_point ) {
if ( s -> sample_rate_index != 8 ) ptr = g -> sb_hybrid + 36 ;
else ptr = g -> sb_hybrid + 72 ;
}
else {
ptr = g -> sb_hybrid ;
}
for ( i = g -> short_start ;
i < 13 ;
i ++ ) {
len = band_size_short [ s -> sample_rate_index ] [ i ] ;
ptr1 = ptr ;
dst = tmp ;
for ( j = len ;
j > 0 ;
j -- ) {
* dst ++ = ptr [ 0 * len ] ;
* dst ++ = ptr [ 1 * len ] ;
* dst ++ = ptr [ 2 * len ] ;
ptr ++ ;
}
ptr += 2 * len ;
memcpy ( ptr1 , tmp , len * 3 * sizeof ( * ptr1 ) ) ;
}
} |
1,760,449,185,745,615,400 | debian | 10 | 0 | TSReturnCode TSHttpHdrUrlGet ( TSMBuffer bufp , TSMLoc obj , TSMLoc * locp ) {
sdk_assert ( sdk_sanity_check_mbuffer ( bufp ) == TS_SUCCESS ) ;
sdk_assert ( sdk_sanity_check_http_hdr_handle ( obj ) == TS_SUCCESS ) ;
HTTPHdrImpl * hh = ( HTTPHdrImpl * ) obj ;
if ( hh -> m_polarity != HTTP_TYPE_REQUEST ) {
return TS_ERROR ;
}
* locp = ( ( TSMLoc ) hh -> u . req . m_url_impl ) ;
return TS_SUCCESS ;
} |
6,323,824,267,898,511,000 | debian | 3 | 0 | void fz_cmm_fin_profile ( fz_context * ctx , fz_iccprofile * profile ) {
if ( ctx && ctx -> colorspace && ctx -> colorspace -> cmm && ctx -> cmm_instance ) if ( profile && profile -> cmm_handle != NULL ) ctx -> colorspace -> cmm -> fin_profile ( ctx -> cmm_instance , profile ) ;
} |
3,599,206,110,384,554,500 | debian | 74 | 0 | void name ## _free ( type * a ) ;
# define DECLARE_ASN1_PRINT_FUNCTION ( stname ) DECLARE_ASN1_PRINT_FUNCTION_fname ( stname , stname ) # define DECLARE_ASN1_PRINT_FUNCTION_fname ( stname , fname ) int fname ## _print_ctx ( BIO * out , stname * x , int indent , const ASN1_PCTX * pctx ) ;
# define D2I_OF ( type ) type * ( * ) ( type * * , const unsigned char * * , long ) # define I2D_OF ( type ) int ( * ) ( type * , unsigned char * * ) # define I2D_OF_const ( type ) int ( * ) ( const type * , unsigned char * * ) # define CHECKED_D2I_OF ( type , d2i ) ( ( d2i_of_void * ) ( 1 ? d2i : ( ( D2I_OF ( type ) ) 0 ) ) ) # define CHECKED_I2D_OF ( type , i2d ) ( ( i2d_of_void * ) ( 1 ? i2d : ( ( I2D_OF ( type ) ) 0 ) ) ) # define CHECKED_NEW_OF ( type , xnew ) ( ( void * ( * ) ( void ) ) ( 1 ? xnew : ( ( type * ( * ) ( void ) ) 0 ) ) ) # define CHECKED_PTR_OF ( type , p ) ( ( void * ) ( 1 ? p : ( type * ) 0 ) ) # define CHECKED_PPTR_OF ( type , p ) ( ( void * * ) ( 1 ? p : ( type * * ) 0 ) ) # define TYPEDEF_D2I_OF ( type ) typedef type * d2i_of_ ## type ( type * * , const unsigned char * * , long ) # define TYPEDEF_I2D_OF ( type ) typedef int i2d_of_ ## type ( type * , unsigned char * * ) # define TYPEDEF_D2I2D_OF ( type ) TYPEDEF_D2I_OF ( type ) ;
TYPEDEF_I2D_OF ( type ) TYPEDEF_D2I2D_OF ( void ) ;
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION typedef const ASN1_ITEM ASN1_ITEM_EXP ;
# define ASN1_ITEM_ptr ( iptr ) ( iptr ) # define ASN1_ITEM_ref ( iptr ) ( & ( iptr ## _it ) ) # define ASN1_ITEM_rptr ( ref ) ( & ( ref ## _it ) ) # define DECLARE_ASN1_ITEM ( name ) OPENSSL_EXTERN const ASN1_ITEM name ## _it ;
# else typedef const ASN1_ITEM * ASN1_ITEM_EXP ( void ) ;
# define ASN1_ITEM_ptr ( iptr ) ( iptr ( ) ) # define ASN1_ITEM_ref ( iptr ) ( iptr ## _it ) # define ASN1_ITEM_rptr ( ref ) ( ref ## _it ( ) ) # define DECLARE_ASN1_ITEM ( name ) const ASN1_ITEM * name ## _it ( void ) ;
# endif # define ASN1_STRFLGS_ESC_2253 1 # define ASN1_STRFLGS_ESC_CTRL 2 # define ASN1_STRFLGS_ESC_MSB 4 # define ASN1_STRFLGS_ESC_QUOTE 8 # define CHARTYPE_PRINTABLESTRING 0x10 # define CHARTYPE_FIRST_ESC_2253 0x20 # define CHARTYPE_LAST_ESC_2253 0x40 # define ASN1_STRFLGS_UTF8_CONVERT 0x10 # define ASN1_STRFLGS_IGNORE_TYPE 0x20 # define ASN1_STRFLGS_SHOW_TYPE 0x40 # define ASN1_STRFLGS_DUMP_ALL 0x80 # define ASN1_STRFLGS_DUMP_UNKNOWN 0x100 # define ASN1_STRFLGS_DUMP_DER 0x200 # define ASN1_STRFLGS_ESC_2254 0x400 # define ASN1_STRFLGS_RFC2253 ( ASN1_STRFLGS_ESC_2253 | ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_DUMP_UNKNOWN | ASN1_STRFLGS_DUMP_DER ) DEFINE_STACK_OF ( ASN1_INTEGER ) DEFINE_STACK_OF ( ASN1_GENERALSTRING ) DEFINE_STACK_OF ( ASN1_UTF8STRING ) typedef struct asn1_type_st {
int type ;
union {
char * ptr ;
ASN1_BOOLEAN boolean ;
ASN1_STRING * asn1_string ;
ASN1_OBJECT * object ;
ASN1_INTEGER * integer ;
ASN1_ENUMERATED * enumerated ;
ASN1_BIT_STRING * bit_string ;
ASN1_OCTET_STRING * octet_string ;
ASN1_PRINTABLESTRING * printablestring ;
ASN1_T61STRING * t61string ;
ASN1_IA5STRING * ia5string ;
ASN1_GENERALSTRING * generalstring ;
ASN1_BMPSTRING * bmpstring ;
ASN1_UNIVERSALSTRING * universalstring ;
ASN1_UTCTIME * utctime ;
ASN1_GENERALIZEDTIME * generalizedtime ;
ASN1_VISIBLESTRING * visiblestring ;
ASN1_UTF8STRING * utf8string ;
ASN1_STRING * set ;
ASN1_STRING * sequence ;
ASN1_VALUE * asn1_value ;
}
value ;
}
ASN1_TYPE ;
DEFINE_STACK_OF ( ASN1_TYPE ) typedef STACK_OF ( ASN1_TYPE ) ASN1_SEQUENCE_ANY ;
DECLARE_ASN1_ENCODE_FUNCTIONS_const ( ASN1_SEQUENCE_ANY , ASN1_SEQUENCE_ANY ) DECLARE_ASN1_ENCODE_FUNCTIONS_const ( ASN1_SEQUENCE_ANY , ASN1_SET_ANY ) typedef struct BIT_STRING_BITNAME_st {
int bitnum ;
const char * lname ;
const char * sname ;
}
BIT_STRING_BITNAME ;
# define B_ASN1_TIME B_ASN1_UTCTIME | B_ASN1_GENERALIZEDTIME # define B_ASN1_PRINTABLE B_ASN1_NUMERICSTRING | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING | B_ASN1_BIT_STRING | B_ASN1_UNIVERSALSTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING | B_ASN1_SEQUENCE | B_ASN1_UNKNOWN # define B_ASN1_DIRECTORYSTRING B_ASN1_PRINTABLESTRING | B_ASN1_TELETEXSTRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING | B_ASN1_UTF8STRING # define B_ASN1_DISPLAYTEXT B_ASN1_IA5STRING | B_ASN1_VISIBLESTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING DECLARE_ASN1_FUNCTIONS_fname ( ASN1_TYPE , ASN1_ANY , ASN1_TYPE ) int ASN1_TYPE_get ( const ASN1_TYPE * a ) ;
void ASN1_TYPE_set ( ASN1_TYPE * a , int type , void * value ) ;
int ASN1_TYPE_set1 ( ASN1_TYPE * a , int type , const void * value ) ;
int ASN1_TYPE_cmp ( const ASN1_TYPE * a , const ASN1_TYPE * b ) ;
ASN1_TYPE * ASN1_TYPE_pack_sequence ( const ASN1_ITEM * it , void * s , ASN1_TYPE * * t ) ;
void * ASN1_TYPE_unpack_sequence ( const ASN1_ITEM * it , const ASN1_TYPE * t ) ;
ASN1_OBJECT * ASN1_OBJECT_new ( void ) ;
void ASN1_OBJECT_free ( ASN1_OBJECT * a ) ;
int i2d_ASN1_OBJECT ( const ASN1_OBJECT * a , unsigned char * * pp ) ;
ASN1_OBJECT * d2i_ASN1_OBJECT ( ASN1_OBJECT * * a , const unsigned char * * pp , long length ) ;
DECLARE_ASN1_ITEM ( ASN1_OBJECT ) DEFINE_STACK_OF ( ASN1_OBJECT ) ASN1_STRING * ASN1_STRING_new ( void ) ;
void ASN1_STRING_free ( ASN1_STRING * a ) ;
void ASN1_STRING_clear_free ( ASN1_STRING * a ) ;
int ASN1_STRING_copy ( ASN1_STRING * dst , const ASN1_STRING * str ) ;
ASN1_STRING * ASN1_STRING_dup ( const ASN1_STRING * a ) ;
ASN1_STRING * ASN1_STRING_type_new ( int type ) ;
int ASN1_STRING_cmp ( const ASN1_STRING * a , const ASN1_STRING * b ) ;
int ASN1_STRING_set ( ASN1_STRING * str , const void * data , int len ) ;
void ASN1_STRING_set0 ( ASN1_STRING * str , void * data , int len ) ;
int ASN1_STRING_length ( const ASN1_STRING * x ) ;
void ASN1_STRING_length_set ( ASN1_STRING * x , int n ) ;
int ASN1_STRING_type ( const ASN1_STRING * x ) ;
DEPRECATEDIN_1_1_0 ( unsigned char * ASN1_STRING_data ( ASN1_STRING * x ) ) const unsigned char * ASN1_STRING_get0_data ( const ASN1_STRING * x ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_BIT_STRING ) int ASN1_BIT_STRING_set ( ASN1_BIT_STRING * a , unsigned char * d , int length ) ;
int ASN1_BIT_STRING_set_bit ( ASN1_BIT_STRING * a , int n , int value ) ;
int ASN1_BIT_STRING_get_bit ( const ASN1_BIT_STRING * a , int n ) ;
int ASN1_BIT_STRING_check ( const ASN1_BIT_STRING * a , const unsigned char * flags , int flags_len ) ;
int ASN1_BIT_STRING_name_print ( BIO * out , ASN1_BIT_STRING * bs , BIT_STRING_BITNAME * tbl , int indent ) ;
int ASN1_BIT_STRING_num_asc ( const char * name , BIT_STRING_BITNAME * tbl ) ;
int ASN1_BIT_STRING_set_asc ( ASN1_BIT_STRING * bs , const char * name , int value , BIT_STRING_BITNAME * tbl ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_INTEGER ) |
-1,672,864,273,235,910,400 | debian | 21 | 0 | static void _slurm_rpc_get_priority_factors ( slurm_msg_t * msg ) {
DEF_TIMERS ;
priority_factors_request_msg_t * req_msg = ( priority_factors_request_msg_t * ) msg -> data ;
priority_factors_response_msg_t resp_msg ;
slurm_msg_t response_msg ;
uid_t uid = g_slurm_auth_get_uid ( msg -> auth_cred , slurmctld_config . auth_info ) ;
START_TIMER ;
debug2 ( "Processing RPC: REQUEST_PRIORITY_FACTORS from uid=%d" , uid ) ;
resp_msg . priority_factors_list = priority_g_get_priority_factors_list ( req_msg , uid ) ;
slurm_msg_t_init ( & response_msg ) ;
response_msg . flags = msg -> flags ;
response_msg . protocol_version = msg -> protocol_version ;
response_msg . address = msg -> address ;
response_msg . conn = msg -> conn ;
response_msg . msg_type = RESPONSE_PRIORITY_FACTORS ;
response_msg . data = & resp_msg ;
slurm_send_node_msg ( msg -> conn_fd , & response_msg ) ;
FREE_NULL_LIST ( resp_msg . priority_factors_list ) ;
END_TIMER2 ( "_slurm_rpc_get_priority_factors" ) ;
debug2 ( "_slurm_rpc_get_priority_factors %s" , TIME_STR ) ;
} |
-6,068,976,579,504,841,000 | debian | 8 | 0 | int ctlclrtrap ( sockaddr_u * raddr , struct interface * linter , int traptype ) {
register struct ctl_trap * tp ;
if ( ( tp = ctlfindtrap ( raddr , linter ) ) == NULL ) return ( 0 ) ;
if ( tp -> tr_flags & TRAP_CONFIGURED && traptype != TRAP_TYPE_CONFIG ) return ( 0 ) ;
tp -> tr_flags = 0 ;
num_ctl_traps -- ;
return ( 1 ) ;
} |
3,487,622,904,170,815,000 | debian | 30 | 1 | static int decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
Indeo3DecodeContext * ctx = avctx -> priv_data ;
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
int res ;
res = decode_frame_headers ( ctx , avctx , buf , buf_size ) ;
if ( res < 0 ) return res ;
if ( res ) {
* got_frame = 0 ;
return buf_size ;
}
if ( ctx -> frame_flags & BS_NONREF && ( avctx -> skip_frame >= AVDISCARD_NONREF ) ) return 0 ;
if ( ! ( ctx -> frame_flags & BS_KEYFRAME ) && avctx -> skip_frame >= AVDISCARD_NONKEY ) return 0 ;
ctx -> buf_sel = ( ctx -> frame_flags >> BS_BUFFER ) & 1 ;
if ( ( res = decode_plane ( ctx , avctx , ctx -> planes , ctx -> y_data_ptr , ctx -> y_data_size , 40 ) ) ) return res ;
if ( ( res = decode_plane ( ctx , avctx , & ctx -> planes [ 1 ] , ctx -> u_data_ptr , ctx -> u_data_size , 10 ) ) ) return res ;
if ( ( res = decode_plane ( ctx , avctx , & ctx -> planes [ 2 ] , ctx -> v_data_ptr , ctx -> v_data_size , 10 ) ) ) return res ;
if ( ctx -> frame . data [ 0 ] ) avctx -> release_buffer ( avctx , & ctx -> frame ) ;
ctx -> frame . reference = 0 ;
if ( ( res = ff_get_buffer ( avctx , & ctx -> frame ) ) < 0 ) {
av_log ( ctx -> avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return res ;
}
output_plane ( & ctx -> planes [ 0 ] , ctx -> buf_sel , ctx -> frame . data [ 0 ] , ctx -> frame . linesize [ 0 ] , avctx -> height ) ;
output_plane ( & ctx -> planes [ 1 ] , ctx -> buf_sel , ctx -> frame . data [ 1 ] , ctx -> frame . linesize [ 1 ] , ( avctx -> height + 3 ) >> 2 ) ;
output_plane ( & ctx -> planes [ 2 ] , ctx -> buf_sel , ctx -> frame . data [ 2 ] , ctx -> frame . linesize [ 2 ] , ( avctx -> height + 3 ) >> 2 ) ;
* got_frame = 1 ;
* ( AVFrame * ) data = ctx -> frame ;
return buf_size ;
} |
4,489,017,523,191,997,000 | debian | 4 | 0 | static int dissect_h225_T_cic_2_4 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence_of ( tvb , offset , actx , tree , hf_index , ett_h225_T_cic_2_4 , T_cic_2_4_sequence_of ) ;
return offset ;
} |
1,760,449,185,745,615,400 | debian | 6 | 0 | inline TSReturnCode sdk_sanity_check_cachekey ( TSCacheKey key ) {
if ( nullptr == key ) {
return TS_ERROR ;
}
return TS_SUCCESS ;
} |
-2,385,618,084,223,928,300 | debian | 87 | 1 | static int decode_frame ( AVCodecContext * avctx , void * data , int * got_frame_ptr , AVPacket * avpkt ) {
RALFContext * ctx = avctx -> priv_data ;
AVFrame * frame = data ;
int16_t * samples0 ;
int16_t * samples1 ;
int ret ;
GetBitContext gb ;
int table_size , table_bytes , i ;
const uint8_t * src , * block_pointer ;
int src_size ;
int bytes_left ;
if ( ctx -> has_pkt ) {
ctx -> has_pkt = 0 ;
table_bytes = ( AV_RB16 ( avpkt -> data ) + 7 ) >> 3 ;
if ( table_bytes + 3 > avpkt -> size || avpkt -> size > RALF_MAX_PKT_SIZE ) {
av_log ( avctx , AV_LOG_ERROR , "Wrong packet's breath smells of wrong data!\n" ) ;
return AVERROR_INVALIDDATA ;
}
if ( memcmp ( ctx -> pkt , avpkt -> data , 2 + table_bytes ) ) {
av_log ( avctx , AV_LOG_ERROR , "Wrong packet tails are wrong!\n" ) ;
return AVERROR_INVALIDDATA ;
}
src = ctx -> pkt ;
src_size = RALF_MAX_PKT_SIZE + avpkt -> size ;
memcpy ( ctx -> pkt + RALF_MAX_PKT_SIZE , avpkt -> data + 2 + table_bytes , avpkt -> size - 2 - table_bytes ) ;
}
else {
if ( avpkt -> size == RALF_MAX_PKT_SIZE ) {
memcpy ( ctx -> pkt , avpkt -> data , avpkt -> size ) ;
ctx -> has_pkt = 1 ;
* got_frame_ptr = 0 ;
return avpkt -> size ;
}
src = avpkt -> data ;
src_size = avpkt -> size ;
}
frame -> nb_samples = ctx -> max_frame_size ;
if ( ( ret = ff_get_buffer ( avctx , frame ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "Me fail get_buffer()? That's unpossible!\n" ) ;
return ret ;
}
samples0 = ( int16_t * ) frame -> data [ 0 ] ;
samples1 = ( int16_t * ) frame -> data [ 1 ] ;
if ( src_size < 5 ) {
av_log ( avctx , AV_LOG_ERROR , "too short packets are too short!\n" ) ;
return AVERROR_INVALIDDATA ;
}
table_size = AV_RB16 ( src ) ;
table_bytes = ( table_size + 7 ) >> 3 ;
if ( src_size < table_bytes + 3 ) {
av_log ( avctx , AV_LOG_ERROR , "short packets are short!\n" ) ;
return AVERROR_INVALIDDATA ;
}
init_get_bits ( & gb , src + 2 , table_size ) ;
ctx -> num_blocks = 0 ;
while ( get_bits_left ( & gb ) > 0 ) {
ctx -> block_size [ ctx -> num_blocks ] = get_bits ( & gb , 15 ) ;
if ( get_bits1 ( & gb ) ) {
ctx -> block_pts [ ctx -> num_blocks ] = get_bits ( & gb , 9 ) ;
}
else {
ctx -> block_pts [ ctx -> num_blocks ] = 0 ;
}
ctx -> num_blocks ++ ;
}
block_pointer = src + table_bytes + 2 ;
bytes_left = src_size - table_bytes - 2 ;
ctx -> sample_offset = 0 ;
for ( i = 0 ;
i < ctx -> num_blocks ;
i ++ ) {
if ( bytes_left < ctx -> block_size [ i ] ) {
av_log ( avctx , AV_LOG_ERROR , "I'm pedaling backwards\n" ) ;
break ;
}
init_get_bits ( & gb , block_pointer , ctx -> block_size [ i ] * 8 ) ;
if ( decode_block ( avctx , & gb , samples0 + ctx -> sample_offset , samples1 + ctx -> sample_offset ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "Sir, I got carsick in your office. Not decoding the rest of packet.\n" ) ;
break ;
}
block_pointer += ctx -> block_size [ i ] ;
bytes_left -= ctx -> block_size [ i ] ;
}
frame -> nb_samples = ctx -> sample_offset ;
* got_frame_ptr = ctx -> sample_offset > 0 ;
return avpkt -> size ;
} |
-2,740,750,333,757,361,000 | debian | 26 | 0 | static void truespeech_apply_twopoint_filter ( TSContext * dec , int quart ) {
int16_t tmp [ 146 + 60 ] , * ptr0 , * ptr1 ;
const int16_t * filter ;
int i , t , off ;
t = dec -> offset2 [ quart ] ;
if ( t == 127 ) {
memset ( dec -> newvec , 0 , 60 * sizeof ( * dec -> newvec ) ) ;
return ;
}
for ( i = 0 ;
i < 146 ;
i ++ ) tmp [ i ] = dec -> filtbuf [ i ] ;
off = ( t / 25 ) + dec -> offset1 [ quart >> 1 ] + 18 ;
off = av_clip ( off , 0 , 145 ) ;
ptr0 = tmp + 145 - off ;
ptr1 = tmp + 146 ;
filter = ts_order2_coeffs + ( t % 25 ) * 2 ;
for ( i = 0 ;
i < 60 ;
i ++ ) {
t = ( ptr0 [ 0 ] * filter [ 0 ] + ptr0 [ 1 ] * filter [ 1 ] + 0x2000 ) >> 14 ;
ptr0 ++ ;
dec -> newvec [ i ] = t ;
ptr1 [ i ] = t ;
}
} |
4,206,838,170,759,624,700 | debian | 8 | 0 | static void nbd_client_closed ( NBDClient * client , bool negotiated ) {
nb_fds -- ;
if ( negotiated && nb_fds == 0 && ! persistent && state == RUNNING ) {
state = TERMINATE ;
}
nbd_update_server_watch ( ) ;
nbd_client_put ( client ) ;
} |
-5,280,794,106,681,745,000 | debian | 48 | 0 | static GstFlowReturn gst_asf_demux_process_metadata ( GstASFDemux * demux , guint8 * data , guint64 size ) {
guint16 blockcount , i ;
GST_INFO_OBJECT ( demux , "object is a metadata object" ) ;
if ( size < 2 ) goto not_enough_data ;
blockcount = gst_asf_demux_get_uint16 ( & data , & size ) ;
for ( i = 0 ;
i < blockcount ;
++ i ) {
GstStructure * s ;
guint16 stream_num , name_len , data_type , lang_idx G_GNUC_UNUSED ;
guint32 data_len , ival ;
gchar * name_utf8 ;
if ( size < ( 2 + 2 + 2 + 2 + 4 ) ) goto not_enough_data ;
lang_idx = gst_asf_demux_get_uint16 ( & data , & size ) ;
stream_num = gst_asf_demux_get_uint16 ( & data , & size ) ;
name_len = gst_asf_demux_get_uint16 ( & data , & size ) ;
data_type = gst_asf_demux_get_uint16 ( & data , & size ) ;
data_len = gst_asf_demux_get_uint32 ( & data , & size ) ;
if ( size < name_len + data_len ) goto not_enough_data ;
name_utf8 = g_convert ( ( gchar * ) data , name_len , "UTF-8" , "UTF-16LE" , NULL , NULL , NULL ) ;
gst_asf_demux_skip_bytes ( name_len , & data , & size ) ;
if ( name_utf8 == NULL ) {
GST_WARNING ( "Failed to convert value name to UTF8, skipping" ) ;
gst_asf_demux_skip_bytes ( data_len , & data , & size ) ;
continue ;
}
if ( data_type != ASF_DEMUX_DATA_TYPE_DWORD ) {
gst_asf_demux_skip_bytes ( data_len , & data , & size ) ;
g_free ( name_utf8 ) ;
continue ;
}
if ( size < 4 ) {
g_free ( name_utf8 ) ;
goto not_enough_data ;
}
ival = gst_asf_demux_get_uint32 ( & data , & size ) ;
gst_asf_demux_skip_bytes ( data_len - 4 , & data , & size ) ;
s = gst_asf_demux_get_metadata_for_stream ( demux , stream_num ) ;
gst_structure_set ( s , name_utf8 , G_TYPE_INT , ival , NULL ) ;
g_free ( name_utf8 ) ;
}
GST_INFO_OBJECT ( demux , "metadata = %" GST_PTR_FORMAT , demux -> metadata ) ;
return GST_FLOW_OK ;
not_enough_data : {
GST_WARNING ( "Unexpected end of data parsing metadata object" ) ;
return GST_FLOW_OK ;
}
} |
5,360,072,031,850,966,000 | debian | 190 | 0 | static void ppc_prep_init ( QEMUMachineInitArgs * args ) {
ram_addr_t ram_size = args -> ram_size ;
const char * cpu_model = args -> cpu_model ;
const char * kernel_filename = args -> kernel_filename ;
const char * kernel_cmdline = args -> kernel_cmdline ;
const char * initrd_filename = args -> initrd_filename ;
const char * boot_device = args -> boot_device ;
MemoryRegion * sysmem = get_system_memory ( ) ;
PowerPCCPU * cpu = NULL ;
CPUPPCState * env = NULL ;
char * filename ;
nvram_t nvram ;
M48t59State * m48t59 ;
MemoryRegion * PPC_io_memory = g_new ( MemoryRegion , 1 ) ;
PortioList * port_list = g_new ( PortioList , 1 ) ;
# if 0 MemoryRegion * xcsr = g_new ( MemoryRegion , 1 ) ;
# endif int linux_boot , i , nb_nics1 , bios_size ;
MemoryRegion * ram = g_new ( MemoryRegion , 1 ) ;
MemoryRegion * bios = g_new ( MemoryRegion , 1 ) ;
uint32_t kernel_base , initrd_base ;
long kernel_size , initrd_size ;
DeviceState * dev ;
PCIHostState * pcihost ;
PCIBus * pci_bus ;
PCIDevice * pci ;
ISABus * isa_bus ;
ISADevice * isa ;
qemu_irq * cpu_exit_irq ;
int ppc_boot_device ;
DriveInfo * hd [ MAX_IDE_BUS * MAX_IDE_DEVS ] ;
sysctrl = g_malloc0 ( sizeof ( sysctrl_t ) ) ;
linux_boot = ( kernel_filename != NULL ) ;
if ( cpu_model == NULL ) cpu_model = "602" ;
for ( i = 0 ;
i < smp_cpus ;
i ++ ) {
cpu = cpu_ppc_init ( cpu_model ) ;
if ( cpu == NULL ) {
fprintf ( stderr , "Unable to find PowerPC CPU definition\n" ) ;
exit ( 1 ) ;
}
env = & cpu -> env ;
if ( env -> flags & POWERPC_FLAG_RTC_CLK ) {
cpu_ppc_tb_init ( env , 7812500UL ) ;
}
else {
cpu_ppc_tb_init ( env , 100UL * 1000UL * 1000UL ) ;
}
qemu_register_reset ( ppc_prep_reset , cpu ) ;
}
memory_region_init_ram ( ram , NULL , "ppc_prep.ram" , ram_size ) ;
vmstate_register_ram_global ( ram ) ;
memory_region_add_subregion ( sysmem , 0 , ram ) ;
memory_region_init_ram ( bios , NULL , "ppc_prep.bios" , BIOS_SIZE ) ;
memory_region_set_readonly ( bios , true ) ;
memory_region_add_subregion ( sysmem , ( uint32_t ) ( - BIOS_SIZE ) , bios ) ;
vmstate_register_ram_global ( bios ) ;
if ( bios_name == NULL ) bios_name = BIOS_FILENAME ;
filename = qemu_find_file ( QEMU_FILE_TYPE_BIOS , bios_name ) ;
if ( filename ) {
bios_size = load_elf ( filename , NULL , NULL , NULL , NULL , NULL , 1 , ELF_MACHINE , 0 ) ;
if ( bios_size < 0 ) {
bios_size = get_image_size ( filename ) ;
if ( bios_size > 0 && bios_size <= BIOS_SIZE ) {
hwaddr bios_addr ;
bios_size = ( bios_size + 0xfff ) & ~ 0xfff ;
bios_addr = ( uint32_t ) ( - bios_size ) ;
bios_size = load_image_targphys ( filename , bios_addr , bios_size ) ;
}
if ( bios_size > BIOS_SIZE ) {
fprintf ( stderr , "qemu: PReP bios '%s' is too large (0x%x)\n" , bios_name , bios_size ) ;
exit ( 1 ) ;
}
}
}
else {
bios_size = - 1 ;
}
if ( bios_size < 0 && ! qtest_enabled ( ) ) {
fprintf ( stderr , "qemu: could not load PPC PReP bios '%s'\n" , bios_name ) ;
exit ( 1 ) ;
}
if ( filename ) {
g_free ( filename ) ;
}
if ( linux_boot ) {
kernel_base = KERNEL_LOAD_ADDR ;
kernel_size = load_image_targphys ( kernel_filename , kernel_base , ram_size - kernel_base ) ;
if ( kernel_size < 0 ) {
hw_error ( "qemu: could not load kernel '%s'\n" , kernel_filename ) ;
exit ( 1 ) ;
}
if ( initrd_filename ) {
initrd_base = INITRD_LOAD_ADDR ;
initrd_size = load_image_targphys ( initrd_filename , initrd_base , ram_size - initrd_base ) ;
if ( initrd_size < 0 ) {
hw_error ( "qemu: could not load initial ram disk '%s'\n" , initrd_filename ) ;
}
}
else {
initrd_base = 0 ;
initrd_size = 0 ;
}
ppc_boot_device = 'm' ;
}
else {
kernel_base = 0 ;
kernel_size = 0 ;
initrd_base = 0 ;
initrd_size = 0 ;
ppc_boot_device = '\0' ;
for ( i = 0 ;
boot_device [ i ] != '\0' ;
i ++ ) {
if ( boot_device [ i ] >= 'a' && boot_device [ i ] <= 'f' ) {
ppc_boot_device = boot_device [ i ] ;
break ;
}
}
if ( ppc_boot_device == '\0' ) {
fprintf ( stderr , "No valid boot device for Mac99 machine\n" ) ;
exit ( 1 ) ;
}
}
if ( PPC_INPUT ( env ) != PPC_FLAGS_INPUT_6xx ) {
hw_error ( "Only 6xx bus is supported on PREP machine\n" ) ;
}
dev = qdev_create ( NULL , "raven-pcihost" ) ;
pcihost = PCI_HOST_BRIDGE ( dev ) ;
object_property_add_child ( qdev_get_machine ( ) , "raven" , OBJECT ( dev ) , NULL ) ;
qdev_init_nofail ( dev ) ;
pci_bus = ( PCIBus * ) qdev_get_child_bus ( dev , "pci.0" ) ;
if ( pci_bus == NULL ) {
fprintf ( stderr , "Couldn't create PCI host controller.\n" ) ;
exit ( 1 ) ;
}
pci = pci_create_simple ( pci_bus , PCI_DEVFN ( 1 , 0 ) , "i82378" ) ;
cpu_exit_irq = qemu_allocate_irqs ( cpu_request_exit , NULL , 1 ) ;
qdev_connect_gpio_out ( & pci -> qdev , 0 , first_cpu -> irq_inputs [ PPC6xx_INPUT_INT ] ) ;
qdev_connect_gpio_out ( & pci -> qdev , 1 , * cpu_exit_irq ) ;
sysbus_connect_irq ( & pcihost -> busdev , 0 , qdev_get_gpio_in ( & pci -> qdev , 9 ) ) ;
sysbus_connect_irq ( & pcihost -> busdev , 1 , qdev_get_gpio_in ( & pci -> qdev , 11 ) ) ;
sysbus_connect_irq ( & pcihost -> busdev , 2 , qdev_get_gpio_in ( & pci -> qdev , 9 ) ) ;
sysbus_connect_irq ( & pcihost -> busdev , 3 , qdev_get_gpio_in ( & pci -> qdev , 11 ) ) ;
isa_bus = ISA_BUS ( qdev_get_child_bus ( DEVICE ( pci ) , "isa.0" ) ) ;
isa = isa_create ( isa_bus , TYPE_PC87312 ) ;
dev = DEVICE ( isa ) ;
qdev_prop_set_uint8 ( dev , "config" , 13 ) ;
qdev_init_nofail ( dev ) ;
memory_region_init_io ( PPC_io_memory , NULL , & PPC_prep_io_ops , sysctrl , "ppc-io" , 0x00800000 ) ;
memory_region_add_subregion ( sysmem , 0x80000000 , PPC_io_memory ) ;
pci_vga_init ( pci_bus ) ;
nb_nics1 = nb_nics ;
if ( nb_nics1 > NE2000_NB_MAX ) nb_nics1 = NE2000_NB_MAX ;
for ( i = 0 ;
i < nb_nics1 ;
i ++ ) {
if ( nd_table [ i ] . model == NULL ) {
nd_table [ i ] . model = g_strdup ( "ne2k_isa" ) ;
}
if ( strcmp ( nd_table [ i ] . model , "ne2k_isa" ) == 0 ) {
isa_ne2000_init ( isa_bus , ne2000_io [ i ] , ne2000_irq [ i ] , & nd_table [ i ] ) ;
}
else {
pci_nic_init_nofail ( & nd_table [ i ] , pci_bus , "ne2k_pci" , NULL ) ;
}
}
ide_drive_get ( hd , MAX_IDE_BUS ) ;
for ( i = 0 ;
i < MAX_IDE_BUS ;
i ++ ) {
isa_ide_init ( isa_bus , ide_iobase [ i ] , ide_iobase2 [ i ] , ide_irq [ i ] , hd [ 2 * i ] , hd [ 2 * i + 1 ] ) ;
}
isa_create_simple ( isa_bus , "i8042" ) ;
sysctrl -> reset_irq = first_cpu -> irq_inputs [ PPC6xx_INPUT_HRESET ] ;
portio_list_init ( port_list , NULL , prep_portio_list , sysctrl , "prep" ) ;
portio_list_add ( port_list , get_system_io ( ) , 0x0 ) ;
# if 0 memory_region_init_io ( xcsr , NULL , & PPC_XCSR_ops , NULL , "ppc-xcsr" , 0x1000 ) ;
memory_region_add_subregion ( sysmem , 0xFEFF0000 , xcsr ) ;
# endif if ( usb_enabled ( false ) ) {
pci_create_simple ( pci_bus , - 1 , "pci-ohci" ) ;
}
m48t59 = m48t59_init_isa ( isa_bus , 0x0074 , NVRAM_SIZE , 59 ) ;
if ( m48t59 == NULL ) return ;
sysctrl -> nvram = m48t59 ;
nvram . opaque = m48t59 ;
nvram . read_fn = & m48t59_read ;
nvram . write_fn = & m48t59_write ;
PPC_NVRAM_set_params ( & nvram , NVRAM_SIZE , "PREP" , ram_size , ppc_boot_device , kernel_base , kernel_size , kernel_cmdline , initrd_base , initrd_size , 0 , graphic_width , graphic_height , graphic_depth ) ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_INTEGER_1_19200 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_constrained_integer ( tvb , offset , actx , tree , hf_index , 1U , 19200U , NULL , FALSE ) ;
return offset ;
} |
-7,076,754,245,473,579,000 | chrome | 4 | 0 | static int evhttp_valid_response_code ( int code ) {
if ( code == 0 ) return ( 0 ) ;
return ( 1 ) ;
} |
-3,591,633,859,713,840,600 | debian | 10 | 0 | static void switch_buffer ( MPADecodeContext * s , int * pos , int * end_pos , int * end_pos2 ) {
if ( s -> in_gb . buffer && * pos >= s -> gb . size_in_bits ) {
s -> gb = s -> in_gb ;
s -> in_gb . buffer = NULL ;
assert ( ( get_bits_count ( & s -> gb ) & 7 ) == 0 ) ;
skip_bits_long ( & s -> gb , * pos - * end_pos ) ;
* end_pos2 = * end_pos = * end_pos2 + get_bits_count ( & s -> gb ) - * pos ;
* pos = get_bits_count ( & s -> gb ) ;
}
} |
-2,222,463,888,415,250,000 | chrome | 6 | 0 | static void alloc_util_frame_buffers ( VP9_COMP * cpi ) {
VP9_COMMON * const cm = & cpi -> common ;
if ( vp9_realloc_frame_buffer ( & cpi -> last_frame_uf , cm -> width , cm -> height , cm -> subsampling_x , cm -> subsampling_y , # if CONFIG_VP9_HIGHBITDEPTH cm -> use_highbitdepth , # endif VP9_ENC_BORDER_IN_PIXELS , NULL , NULL , NULL ) ) vpx_internal_error ( & cm -> error , VPX_CODEC_MEM_ERROR , "Failed to allocate last frame buffer" ) ;
if ( vp9_realloc_frame_buffer ( & cpi -> scaled_source , cm -> width , cm -> height , cm -> subsampling_x , cm -> subsampling_y , # if CONFIG_VP9_HIGHBITDEPTH cm -> use_highbitdepth , # endif VP9_ENC_BORDER_IN_PIXELS , NULL , NULL , NULL ) ) vpx_internal_error ( & cm -> error , VPX_CODEC_MEM_ERROR , "Failed to allocate scaled source buffer" ) ;
if ( vp9_realloc_frame_buffer ( & cpi -> scaled_last_source , cm -> width , cm -> height , cm -> subsampling_x , cm -> subsampling_y , # if CONFIG_VP9_HIGHBITDEPTH cm -> use_highbitdepth , # endif VP9_ENC_BORDER_IN_PIXELS , NULL , NULL , NULL ) ) vpx_internal_error ( & cm -> error , VPX_CODEC_MEM_ERROR , "Failed to allocate scaled last source buffer" ) ;
} |
-6,024,601,983,167,899,000 | debian | 3 | 0 | gint nautilus_mime_types_get_number_of_groups ( void ) {
return G_N_ELEMENTS ( mimetype_groups ) ;
} |
-5,260,094,338,219,890,000 | debian | 6 | 0 | static void stroke_terminate_srcip ( private_stroke_socket_t * this , stroke_msg_t * msg , FILE * out ) {
pop_string ( msg , & msg -> terminate_srcip . start ) ;
pop_string ( msg , & msg -> terminate_srcip . end ) ;
DBG1 ( DBG_CFG , "received stroke: terminate-srcip %s-%s" , msg -> terminate_srcip . start , msg -> terminate_srcip . end ) ;
this -> control -> terminate_srcip ( this -> control , msg , out ) ;
} |
4,876,100,961,671,883,000 | debian | 4 | 0 | static int dissect_pvfs_pdu ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data _U_ ) {
dissect_pvfs_common ( tvb , pinfo , tree , FALSE ) ;
return tvb_reported_length ( tvb ) ;
} |
378,220,832,151,730,900 | debian | 31 | 0 | int qemuMonitorTextAddDevice ( qemuMonitorPtr mon , const char * devicestr ) {
char * cmd = NULL ;
char * reply = NULL ;
char * safedev ;
int ret = - 1 ;
if ( ! ( safedev = qemuMonitorEscapeArg ( devicestr ) ) ) {
virReportOOMError ( ) ;
goto cleanup ;
}
if ( virAsprintf ( & cmd , "device_add %s" , safedev ) < 0 ) {
virReportOOMError ( ) ;
goto cleanup ;
}
if ( qemuMonitorHMPCommand ( mon , cmd , & reply ) < 0 ) {
qemuReportError ( VIR_ERR_OPERATION_FAILED , _ ( "cannot attach %s device" ) , devicestr ) ;
goto cleanup ;
}
if ( STRPREFIX ( reply , "husb: using" ) ) {
ret = 0 ;
goto cleanup ;
}
if ( STRNEQ ( reply , "" ) ) {
qemuReportError ( VIR_ERR_OPERATION_FAILED , _ ( "adding %s device failed: %s" ) , devicestr , reply ) ;
goto cleanup ;
}
ret = 0 ;
cleanup : VIR_FREE ( cmd ) ;
VIR_FREE ( reply ) ;
VIR_FREE ( safedev ) ;
return ret ;
} |
-2,591,112,946,600,337,000 | debian | 19 | 0 | static void residual_interp ( int16_t * buf , int16_t * out , int lag , int gain , int * rseed ) {
int i ;
if ( lag ) {
int16_t * vector_ptr = buf + PITCH_MAX ;
for ( i = 0 ;
i < lag ;
i ++ ) out [ i ] = vector_ptr [ i - lag ] * 3 >> 2 ;
av_memcpy_backptr ( ( uint8_t * ) ( out + lag ) , lag * sizeof ( * out ) , ( FRAME_LEN - lag ) * sizeof ( * out ) ) ;
}
else {
for ( i = 0 ;
i < FRAME_LEN ;
i ++ ) {
* rseed = * rseed * 521 + 259 ;
out [ i ] = gain * * rseed >> 15 ;
}
memset ( buf , 0 , ( FRAME_LEN + PITCH_MAX ) * sizeof ( * buf ) ) ;
}
} |
4,876,100,961,671,883,000 | debian | 5 | 0 | static int dissect_pvfs2_mgmt_get_dirdata_handle_request ( tvbuff_t * tvb , proto_tree * tree , int offset , packet_info * pinfo ) {
offset = dissect_pvfs_fh ( tvb , offset , pinfo , tree , "handle" , NULL ) ;
offset = dissect_pvfs_fs_id ( tvb , tree , offset ) ;
return offset ;
} |
-7,137,859,843,679,923,000 | chrome | 26 | 0 | static void build_inter_predictors_for_planes ( MACROBLOCKD * xd , BLOCK_SIZE bsize , int mi_row , int mi_col , int plane_from , int plane_to ) {
int plane ;
const int mi_x = mi_col * MI_SIZE ;
const int mi_y = mi_row * MI_SIZE ;
for ( plane = plane_from ;
plane <= plane_to ;
++ plane ) {
const BLOCK_SIZE plane_bsize = get_plane_block_size ( bsize , & xd -> plane [ plane ] ) ;
const int num_4x4_w = num_4x4_blocks_wide_lookup [ plane_bsize ] ;
const int num_4x4_h = num_4x4_blocks_high_lookup [ plane_bsize ] ;
const int bw = 4 * num_4x4_w ;
const int bh = 4 * num_4x4_h ;
if ( xd -> mi [ 0 ] . src_mi -> mbmi . sb_type < BLOCK_8X8 ) {
int i = 0 , x , y ;
assert ( bsize == BLOCK_8X8 ) ;
for ( y = 0 ;
y < num_4x4_h ;
++ y ) for ( x = 0 ;
x < num_4x4_w ;
++ x ) build_inter_predictors ( xd , plane , i ++ , bw , bh , * x , 4 * y , 4 , 4 , mi_x , mi_y ) ;
}
else {
build_inter_predictors ( xd , plane , 0 , bw , bh , 0 , 0 , bw , bh , mi_x , mi_y ) ;
}
}
} |
-5,300,415,683,778,647,000 | chrome | 3 | 0 | IN_PROC_BROWSER_TEST_F ( ExtensionMessageBubbleViewBrowserTest , TestClickingDismissButton ) {
TestClickingDismissButton ( ) ;
} |
2,713,698,759,296,604,700 | debian | 44 | 0 | void ff_draw_horiz_band ( AVCodecContext * avctx , DSPContext * dsp , Picture * cur , Picture * last , int y , int h , int picture_structure , int first_field , int draw_edges , int low_delay , int v_edge_pos , int h_edge_pos ) {
const AVPixFmtDescriptor * desc = av_pix_fmt_desc_get ( avctx -> pix_fmt ) ;
int hshift = desc -> log2_chroma_w ;
int vshift = desc -> log2_chroma_h ;
const int field_pic = picture_structure != PICT_FRAME ;
if ( field_pic ) {
h <<= 1 ;
y <<= 1 ;
}
if ( ! avctx -> hwaccel && ! ( avctx -> codec -> capabilities & CODEC_CAP_HWACCEL_VDPAU ) && draw_edges && cur -> reference && ! ( avctx -> flags & CODEC_FLAG_EMU_EDGE ) ) {
int * linesize = cur -> f . linesize ;
int sides = 0 , edge_h ;
if ( y == 0 ) sides |= EDGE_TOP ;
if ( y + h >= v_edge_pos ) sides |= EDGE_BOTTOM ;
edge_h = FFMIN ( h , v_edge_pos - y ) ;
dsp -> draw_edges ( cur -> f . data [ 0 ] + y * linesize [ 0 ] , linesize [ 0 ] , h_edge_pos , edge_h , EDGE_WIDTH , EDGE_WIDTH , sides ) ;
dsp -> draw_edges ( cur -> f . data [ 1 ] + ( y >> vshift ) * linesize [ 1 ] , linesize [ 1 ] , h_edge_pos >> hshift , edge_h >> vshift , EDGE_WIDTH >> hshift , EDGE_WIDTH >> vshift , sides ) ;
dsp -> draw_edges ( cur -> f . data [ 2 ] + ( y >> vshift ) * linesize [ 2 ] , linesize [ 2 ] , h_edge_pos >> hshift , edge_h >> vshift , EDGE_WIDTH >> hshift , EDGE_WIDTH >> vshift , sides ) ;
}
h = FFMIN ( h , avctx -> height - y ) ;
if ( field_pic && first_field && ! ( avctx -> slice_flags & SLICE_FLAG_ALLOW_FIELD ) ) return ;
if ( avctx -> draw_horiz_band ) {
AVFrame * src ;
int offset [ AV_NUM_DATA_POINTERS ] ;
int i ;
if ( cur -> f . pict_type == AV_PICTURE_TYPE_B || low_delay || ( avctx -> slice_flags & SLICE_FLAG_CODED_ORDER ) ) src = & cur -> f ;
else if ( last ) src = & last -> f ;
else return ;
if ( cur -> f . pict_type == AV_PICTURE_TYPE_B && picture_structure == PICT_FRAME && avctx -> codec_id != AV_CODEC_ID_H264 && avctx -> codec_id != AV_CODEC_ID_SVQ3 ) {
for ( i = 0 ;
i < AV_NUM_DATA_POINTERS ;
i ++ ) offset [ i ] = 0 ;
}
else {
offset [ 0 ] = y * src -> linesize [ 0 ] ;
offset [ 1 ] = offset [ 2 ] = ( y >> vshift ) * src -> linesize [ 1 ] ;
for ( i = 3 ;
i < AV_NUM_DATA_POINTERS ;
i ++ ) offset [ i ] = 0 ;
}
emms_c ( ) ;
avctx -> draw_horiz_band ( avctx , src , offset , y , picture_structure , h ) ;
}
} |
4,180,964,683,905,831,000 | debian | 9 | 0 | static inline void take_option ( char * * to , char * from , int * first , int len ) {
if ( ! * first ) {
* * to = ',' ;
* to += 1 ;
}
else * first = 0 ;
memcpy ( * to , from , len ) ;
* to += len ;
} |
914,926,989,019,402,500 | debian | 12 | 0 | static void main_external_compression_cleanup ( void ) {
int i ;
for ( i = 0 ;
i < num_subprocs ;
i += 1 ) {
if ( ! ext_subprocs [ i ] ) {
continue ;
}
kill ( ext_subprocs [ i ] , SIGTERM ) ;
ext_subprocs [ i ] = 0 ;
}
} |
-5,706,788,925,640,467,000 | chrome | 196 | 1 | static void rd_use_partition ( VP9_COMP * cpi , const TileInfo * const tile , MODE_INFO * * mi_8x8 , TOKENEXTRA * * tp , int mi_row , int mi_col , BLOCK_SIZE bsize , int * rate , int64_t * dist , int do_recon , PC_TREE * pc_tree ) {
VP9_COMMON * const cm = & cpi -> common ;
MACROBLOCK * const x = & cpi -> mb ;
MACROBLOCKD * const xd = & x -> e_mbd ;
const int mis = cm -> mi_stride ;
const int bsl = b_width_log2 ( bsize ) ;
const int mi_step = num_4x4_blocks_wide_lookup [ bsize ] / 2 ;
const int bss = ( 1 << bsl ) / 4 ;
int i , pl ;
PARTITION_TYPE partition = PARTITION_NONE ;
BLOCK_SIZE subsize ;
ENTROPY_CONTEXT l [ 16 * MAX_MB_PLANE ] , a [ 16 * MAX_MB_PLANE ] ;
PARTITION_CONTEXT sl [ 8 ] , sa [ 8 ] ;
int last_part_rate = INT_MAX ;
int64_t last_part_dist = INT64_MAX ;
int64_t last_part_rd = INT64_MAX ;
int none_rate = INT_MAX ;
int64_t none_dist = INT64_MAX ;
int64_t none_rd = INT64_MAX ;
int chosen_rate = INT_MAX ;
int64_t chosen_dist = INT64_MAX ;
int64_t chosen_rd = INT64_MAX ;
BLOCK_SIZE sub_subsize = BLOCK_4X4 ;
int splits_below = 0 ;
BLOCK_SIZE bs_type = mi_8x8 [ 0 ] -> mbmi . sb_type ;
int do_partition_search = 1 ;
PICK_MODE_CONTEXT * ctx = & pc_tree -> none ;
if ( mi_row >= cm -> mi_rows || mi_col >= cm -> mi_cols ) return ;
assert ( num_4x4_blocks_wide_lookup [ bsize ] == num_4x4_blocks_high_lookup [ bsize ] ) ;
partition = partition_lookup [ bsl ] [ bs_type ] ;
subsize = get_subsize ( bsize , partition ) ;
pc_tree -> partitioning = partition ;
save_context ( cpi , mi_row , mi_col , a , l , sa , sl , bsize ) ;
if ( bsize == BLOCK_16X16 && cpi -> oxcf . aq_mode ) {
set_offsets ( cpi , tile , mi_row , mi_col , bsize ) ;
x -> mb_energy = vp9_block_energy ( cpi , x , bsize ) ;
}
if ( do_partition_search && cpi -> sf . partition_search_type == SEARCH_PARTITION && cpi -> sf . adjust_partitioning_from_last_frame ) {
if ( partition == PARTITION_SPLIT && subsize > BLOCK_8X8 ) {
sub_subsize = get_subsize ( subsize , PARTITION_SPLIT ) ;
splits_below = 1 ;
for ( i = 0 ;
i < 4 ;
i ++ ) {
int jj = i >> 1 , ii = i & 0x01 ;
MODE_INFO * this_mi = mi_8x8 [ jj * bss * mis + ii * bss ] ;
if ( this_mi && this_mi -> mbmi . sb_type >= sub_subsize ) {
splits_below = 0 ;
}
}
}
if ( partition != PARTITION_NONE && ! splits_below && mi_row + ( mi_step >> 1 ) < cm -> mi_rows && mi_col + ( mi_step >> 1 ) < cm -> mi_cols ) {
pc_tree -> partitioning = PARTITION_NONE ;
rd_pick_sb_modes ( cpi , tile , mi_row , mi_col , & none_rate , & none_dist , bsize , ctx , INT64_MAX , 0 ) ;
pl = partition_plane_context ( xd , mi_row , mi_col , bsize ) ;
if ( none_rate < INT_MAX ) {
none_rate += cpi -> partition_cost [ pl ] [ PARTITION_NONE ] ;
none_rd = RDCOST ( x -> rdmult , x -> rddiv , none_rate , none_dist ) ;
}
restore_context ( cpi , mi_row , mi_col , a , l , sa , sl , bsize ) ;
mi_8x8 [ 0 ] -> mbmi . sb_type = bs_type ;
pc_tree -> partitioning = partition ;
}
}
switch ( partition ) {
case PARTITION_NONE : rd_pick_sb_modes ( cpi , tile , mi_row , mi_col , & last_part_rate , & last_part_dist , bsize , ctx , INT64_MAX , 0 ) ;
break ;
case PARTITION_HORZ : rd_pick_sb_modes ( cpi , tile , mi_row , mi_col , & last_part_rate , & last_part_dist , subsize , & pc_tree -> horizontal [ 0 ] , INT64_MAX , 0 ) ;
if ( last_part_rate != INT_MAX && bsize >= BLOCK_8X8 && mi_row + ( mi_step >> 1 ) < cm -> mi_rows ) {
int rt = 0 ;
int64_t dt = 0 ;
PICK_MODE_CONTEXT * ctx = & pc_tree -> horizontal [ 0 ] ;
update_state ( cpi , ctx , mi_row , mi_col , subsize , 0 ) ;
encode_superblock ( cpi , tp , 0 , mi_row , mi_col , subsize , ctx ) ;
rd_pick_sb_modes ( cpi , tile , mi_row + ( mi_step >> 1 ) , mi_col , & rt , & dt , subsize , & pc_tree -> horizontal [ 1 ] , INT64_MAX , 1 ) ;
if ( rt == INT_MAX || dt == INT64_MAX ) {
last_part_rate = INT_MAX ;
last_part_dist = INT64_MAX ;
break ;
}
last_part_rate += rt ;
last_part_dist += dt ;
}
break ;
case PARTITION_VERT : rd_pick_sb_modes ( cpi , tile , mi_row , mi_col , & last_part_rate , & last_part_dist , subsize , & pc_tree -> vertical [ 0 ] , INT64_MAX , 0 ) ;
if ( last_part_rate != INT_MAX && bsize >= BLOCK_8X8 && mi_col + ( mi_step >> 1 ) < cm -> mi_cols ) {
int rt = 0 ;
int64_t dt = 0 ;
PICK_MODE_CONTEXT * ctx = & pc_tree -> vertical [ 0 ] ;
update_state ( cpi , ctx , mi_row , mi_col , subsize , 0 ) ;
encode_superblock ( cpi , tp , 0 , mi_row , mi_col , subsize , ctx ) ;
rd_pick_sb_modes ( cpi , tile , mi_row , mi_col + ( mi_step >> 1 ) , & rt , & dt , subsize , & pc_tree -> vertical [ bsize > BLOCK_8X8 ] , INT64_MAX , 1 ) ;
if ( rt == INT_MAX || dt == INT64_MAX ) {
last_part_rate = INT_MAX ;
last_part_dist = INT64_MAX ;
break ;
}
last_part_rate += rt ;
last_part_dist += dt ;
}
break ;
case PARTITION_SPLIT : if ( bsize == BLOCK_8X8 ) {
rd_pick_sb_modes ( cpi , tile , mi_row , mi_col , & last_part_rate , & last_part_dist , subsize , pc_tree -> leaf_split [ 0 ] , INT64_MAX , 0 ) ;
break ;
}
last_part_rate = 0 ;
last_part_dist = 0 ;
for ( i = 0 ;
i < 4 ;
i ++ ) {
int x_idx = ( i & 1 ) * ( mi_step >> 1 ) ;
int y_idx = ( i >> 1 ) * ( mi_step >> 1 ) ;
int jj = i >> 1 , ii = i & 0x01 ;
int rt ;
int64_t dt ;
if ( ( mi_row + y_idx >= cm -> mi_rows ) || ( mi_col + x_idx >= cm -> mi_cols ) ) continue ;
rd_use_partition ( cpi , tile , mi_8x8 + jj * bss * mis + ii * bss , tp , mi_row + y_idx , mi_col + x_idx , subsize , & rt , & dt , i != 3 , pc_tree -> split [ i ] ) ;
if ( rt == INT_MAX || dt == INT64_MAX ) {
last_part_rate = INT_MAX ;
last_part_dist = INT64_MAX ;
break ;
}
last_part_rate += rt ;
last_part_dist += dt ;
}
break ;
default : assert ( 0 ) ;
break ;
}
pl = partition_plane_context ( xd , mi_row , mi_col , bsize ) ;
if ( last_part_rate < INT_MAX ) {
last_part_rate += cpi -> partition_cost [ pl ] [ partition ] ;
last_part_rd = RDCOST ( x -> rdmult , x -> rddiv , last_part_rate , last_part_dist ) ;
}
if ( do_partition_search && cpi -> sf . adjust_partitioning_from_last_frame && cpi -> sf . partition_search_type == SEARCH_PARTITION && partition != PARTITION_SPLIT && bsize > BLOCK_8X8 && ( mi_row + mi_step < cm -> mi_rows || mi_row + ( mi_step >> 1 ) == cm -> mi_rows ) && ( mi_col + mi_step < cm -> mi_cols || mi_col + ( mi_step >> 1 ) == cm -> mi_cols ) ) {
BLOCK_SIZE split_subsize = get_subsize ( bsize , PARTITION_SPLIT ) ;
chosen_rate = 0 ;
chosen_dist = 0 ;
restore_context ( cpi , mi_row , mi_col , a , l , sa , sl , bsize ) ;
pc_tree -> partitioning = PARTITION_SPLIT ;
for ( i = 0 ;
i < 4 ;
i ++ ) {
int x_idx = ( i & 1 ) * ( mi_step >> 1 ) ;
int y_idx = ( i >> 1 ) * ( mi_step >> 1 ) ;
int rt = 0 ;
int64_t dt = 0 ;
ENTROPY_CONTEXT l [ 16 * MAX_MB_PLANE ] , a [ 16 * MAX_MB_PLANE ] ;
PARTITION_CONTEXT sl [ 8 ] , sa [ 8 ] ;
if ( ( mi_row + y_idx >= cm -> mi_rows ) || ( mi_col + x_idx >= cm -> mi_cols ) ) continue ;
save_context ( cpi , mi_row , mi_col , a , l , sa , sl , bsize ) ;
pc_tree -> split [ i ] -> partitioning = PARTITION_NONE ;
rd_pick_sb_modes ( cpi , tile , mi_row + y_idx , mi_col + x_idx , & rt , & dt , split_subsize , & pc_tree -> split [ i ] -> none , INT64_MAX , i ) ;
restore_context ( cpi , mi_row , mi_col , a , l , sa , sl , bsize ) ;
if ( rt == INT_MAX || dt == INT64_MAX ) {
chosen_rate = INT_MAX ;
chosen_dist = INT64_MAX ;
break ;
}
chosen_rate += rt ;
chosen_dist += dt ;
if ( i != 3 ) encode_sb ( cpi , tile , tp , mi_row + y_idx , mi_col + x_idx , 0 , split_subsize , pc_tree -> split [ i ] ) ;
pl = partition_plane_context ( xd , mi_row + y_idx , mi_col + x_idx , split_subsize ) ;
chosen_rate += cpi -> partition_cost [ pl ] [ PARTITION_NONE ] ;
}
pl = partition_plane_context ( xd , mi_row , mi_col , bsize ) ;
if ( chosen_rate < INT_MAX ) {
chosen_rate += cpi -> partition_cost [ pl ] [ PARTITION_SPLIT ] ;
chosen_rd = RDCOST ( x -> rdmult , x -> rddiv , chosen_rate , chosen_dist ) ;
}
}
if ( last_part_rd < chosen_rd ) {
mi_8x8 [ 0 ] -> mbmi . sb_type = bsize ;
if ( bsize >= BLOCK_8X8 ) pc_tree -> partitioning = partition ;
chosen_rate = last_part_rate ;
chosen_dist = last_part_dist ;
chosen_rd = last_part_rd ;
}
if ( none_rd < chosen_rd ) {
if ( bsize >= BLOCK_8X8 ) pc_tree -> partitioning = PARTITION_NONE ;
chosen_rate = none_rate ;
chosen_dist = none_dist ;
}
restore_context ( cpi , mi_row , mi_col , a , l , sa , sl , bsize ) ;
if ( bsize == BLOCK_64X64 ) assert ( chosen_rate < INT_MAX && chosen_dist < INT64_MAX ) ;
if ( do_recon ) {
int output_enabled = ( bsize == BLOCK_64X64 ) ;
if ( ( cpi -> oxcf . aq_mode == COMPLEXITY_AQ ) && cm -> seg . update_map ) {
vp9_select_in_frame_q_segment ( cpi , mi_row , mi_col , output_enabled , chosen_rate ) ;
}
if ( cpi -> oxcf . aq_mode == CYCLIC_REFRESH_AQ ) vp9_cyclic_refresh_set_rate_and_dist_sb ( cpi -> cyclic_refresh , chosen_rate , chosen_dist ) ;
encode_sb ( cpi , tile , tp , mi_row , mi_col , output_enabled , bsize , pc_tree ) ;
}
* rate = chosen_rate ;
* dist = chosen_dist ;
} |
7,651,945,086,108,393,000 | debian | 3 | 0 | static void qemuMonitorJSONHandleVNCConnect ( qemuMonitorPtr mon , virJSONValuePtr data ) {
qemuMonitorJSONHandleVNC ( mon , data , VIR_DOMAIN_EVENT_GRAPHICS_CONNECT ) ;
} |
-8,620,097,311,326,519,000 | chrome | 6 | 0 | err_status_t srtp_shutdown ( ) {
err_status_t status ;
status = crypto_kernel_shutdown ( ) ;
if ( status ) return status ;
return err_status_ok ;
} |
3,728,341,105,073,176,600 | debian | 23 | 1 | static ossl_inline void lh_ ## type ## _node_stats_bio ( const LHASH_OF ( type ) * lh , BIO * out ) {
OPENSSL_LH_node_stats_bio ( ( const OPENSSL_LHASH * ) lh , out ) ;
}
static ossl_inline void lh_ ## type ## _node_usage_stats_bio ( const LHASH_OF ( type ) * lh , BIO * out ) {
OPENSSL_LH_node_usage_stats_bio ( ( const OPENSSL_LHASH * ) lh , out ) ;
}
static ossl_inline void lh_ ## type ## _stats_bio ( const LHASH_OF ( type ) * lh , BIO * out ) {
OPENSSL_LH_stats_bio ( ( const OPENSSL_LHASH * ) lh , out ) ;
}
static ossl_inline unsigned long lh_ ## type ## _get_down_load ( LHASH_OF ( type ) * lh ) {
return OPENSSL_LH_get_down_load ( ( OPENSSL_LHASH * ) lh ) ;
}
static ossl_inline void lh_ ## type ## _set_down_load ( LHASH_OF ( type ) * lh , unsigned long dl ) {
OPENSSL_LH_set_down_load ( ( OPENSSL_LHASH * ) lh , dl ) ;
}
static ossl_inline void lh_ ## type ## _doall ( LHASH_OF ( type ) * lh , void ( * doall ) ( type * ) ) {
OPENSSL_LH_doall ( ( OPENSSL_LHASH * ) lh , ( OPENSSL_LH_DOALL_FUNC ) doall ) ;
}
LHASH_OF ( type ) # define IMPLEMENT_LHASH_DOALL_ARG_CONST ( type , argtype ) int_implement_lhash_doall ( type , argtype , const type ) # define IMPLEMENT_LHASH_DOALL_ARG ( type , argtype ) int_implement_lhash_doall ( type , argtype , type ) # define int_implement_lhash_doall ( type , argtype , cbargtype ) static ossl_inline void lh_ ## type ## _doall_ ## argtype ( LHASH_OF ( type ) * lh , void ( * fn ) ( cbargtype * , argtype * ) , argtype * arg ) {
OPENSSL_LH_doall_arg ( ( OPENSSL_LHASH * ) lh , ( OPENSSL_LH_DOALL_FUNCARG ) fn , ( void * ) arg ) ;
}
LHASH_OF ( type ) DEFINE_LHASH_OF ( OPENSSL_STRING ) ;
# ifdef _MSC_VER # pragma warning ( push ) # pragma warning ( disable : 4090 ) # endif DEFINE_LHASH_OF ( OPENSSL_CSTRING ) |
-8,933,711,118,846,966,000 | debian | 63 | 0 | static void cirrus_init_common ( CirrusVGAState * s , Object * owner , int device_id , int is_pci , MemoryRegion * system_memory , MemoryRegion * system_io ) {
int i ;
static int inited ;
if ( ! inited ) {
inited = 1 ;
for ( i = 0 ;
i < 256 ;
i ++ ) rop_to_index [ i ] = CIRRUS_ROP_NOP_INDEX ;
rop_to_index [ CIRRUS_ROP_0 ] = 0 ;
rop_to_index [ CIRRUS_ROP_SRC_AND_DST ] = 1 ;
rop_to_index [ CIRRUS_ROP_NOP ] = 2 ;
rop_to_index [ CIRRUS_ROP_SRC_AND_NOTDST ] = 3 ;
rop_to_index [ CIRRUS_ROP_NOTDST ] = 4 ;
rop_to_index [ CIRRUS_ROP_SRC ] = 5 ;
rop_to_index [ CIRRUS_ROP_1 ] = 6 ;
rop_to_index [ CIRRUS_ROP_NOTSRC_AND_DST ] = 7 ;
rop_to_index [ CIRRUS_ROP_SRC_XOR_DST ] = 8 ;
rop_to_index [ CIRRUS_ROP_SRC_OR_DST ] = 9 ;
rop_to_index [ CIRRUS_ROP_NOTSRC_OR_NOTDST ] = 10 ;
rop_to_index [ CIRRUS_ROP_SRC_NOTXOR_DST ] = 11 ;
rop_to_index [ CIRRUS_ROP_SRC_OR_NOTDST ] = 12 ;
rop_to_index [ CIRRUS_ROP_NOTSRC ] = 13 ;
rop_to_index [ CIRRUS_ROP_NOTSRC_OR_DST ] = 14 ;
rop_to_index [ CIRRUS_ROP_NOTSRC_AND_NOTDST ] = 15 ;
s -> device_id = device_id ;
if ( is_pci ) s -> bustype = CIRRUS_BUSTYPE_PCI ;
else s -> bustype = CIRRUS_BUSTYPE_ISA ;
}
memory_region_init_io ( & s -> cirrus_vga_io , owner , & cirrus_vga_io_ops , s , "cirrus-io" , 0x30 ) ;
memory_region_set_flush_coalesced ( & s -> cirrus_vga_io ) ;
memory_region_add_subregion ( system_io , 0x3b0 , & s -> cirrus_vga_io ) ;
memory_region_init ( & s -> low_mem_container , owner , "cirrus-lowmem-container" , 0x20000 ) ;
memory_region_init_io ( & s -> low_mem , owner , & cirrus_vga_mem_ops , s , "cirrus-low-memory" , 0x20000 ) ;
memory_region_add_subregion ( & s -> low_mem_container , 0 , & s -> low_mem ) ;
for ( i = 0 ;
i < 2 ;
++ i ) {
static const char * names [ ] = {
"vga.bank0" , "vga.bank1" }
;
MemoryRegion * bank = & s -> cirrus_bank [ i ] ;
memory_region_init_alias ( bank , owner , names [ i ] , & s -> vga . vram , 0 , 0x8000 ) ;
memory_region_set_enabled ( bank , false ) ;
memory_region_add_subregion_overlap ( & s -> low_mem_container , i * 0x8000 , bank , 1 ) ;
}
memory_region_add_subregion_overlap ( system_memory , 0x000a0000 , & s -> low_mem_container , 1 ) ;
memory_region_set_coalescing ( & s -> low_mem ) ;
memory_region_init_io ( & s -> cirrus_linear_io , owner , & cirrus_linear_io_ops , s , "cirrus-linear-io" , s -> vga . vram_size_mb * 1024 * 1024 ) ;
memory_region_set_flush_coalesced ( & s -> cirrus_linear_io ) ;
memory_region_init_io ( & s -> cirrus_linear_bitblt_io , owner , & cirrus_linear_bitblt_io_ops , s , "cirrus-bitblt-mmio" , 0x400000 ) ;
memory_region_set_flush_coalesced ( & s -> cirrus_linear_bitblt_io ) ;
memory_region_init_io ( & s -> cirrus_mmio_io , owner , & cirrus_mmio_io_ops , s , "cirrus-mmio" , CIRRUS_PNPMMIO_SIZE ) ;
memory_region_set_flush_coalesced ( & s -> cirrus_mmio_io ) ;
s -> real_vram_size = ( s -> device_id == CIRRUS_ID_CLGD5446 ) ? 4096 * 1024 : 2048 * 1024 ;
s -> cirrus_addr_mask = s -> real_vram_size - 1 ;
s -> linear_mmio_mask = s -> real_vram_size - 256 ;
s -> vga . get_bpp = cirrus_get_bpp ;
s -> vga . get_offsets = cirrus_get_offsets ;
s -> vga . get_resolution = cirrus_get_resolution ;
s -> vga . cursor_invalidate = cirrus_cursor_invalidate ;
s -> vga . cursor_draw_line = cirrus_cursor_draw_line ;
qemu_register_reset ( cirrus_reset , s ) ;
} |