instruction
stringclasses
1 value
output
stringclasses
2 values
input
stringlengths
21
96.3k
negative
AioContext *bdrv_get_aio_context(BlockDriverState *bs){ /* Currently BlockDriverState always uses the main loop AioContext */ return qemu_get_aio_context();}
negative
static int video_get_buffer(AVCodecContext *s, AVFrame *pic){ FramePool *pool = s->internal->pool; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pic->format); int i; if (pic->data[0]) { av_log(s, AV_LOG_ERROR, "pic->data[0]!=NULL in avcodec_default_get_buffer\n"); return -1; } if (!desc) { av_log(s, AV_LOG_ERROR...
negative
static int qio_dns_resolver_lookup_sync_nop(QIODNSResolver *resolver, SocketAddress *addr, size_t *naddrs, SocketAddress ***addrs, Error **errp){ *naddrs = 1; *addrs = g_new0(SocketAddress *, 1); (*addrs)[0] = QAPI_CLONE(SocketAddress, addr); return 0;}
negative
static int nvdimm_plugged_device_list(Object *obj, void *opaque){ GSList **list = opaque; if (object_dynamic_cast(obj, TYPE_NVDIMM)) { *list = g_slist_append(*list, DEVICE(obj)); } object_child_foreach(obj, nvdimm_plugged_device_list, opaque); return 0;}
negative
AddfdInfo *qmp_add_fd(bool has_fdset_id, int64_t fdset_id, bool has_opaque, const char *opaque, Error **errp){ int fd; Monitor *mon = cur_mon; MonFdset *mon_fdset = NULL; MonFdsetFd *mon_fdset_fd; AddfdInfo *fdinfo; fd = qemu_chr_fe_get_msgfd(mon->chr); if (fd == -1) { error_set(errp, QERR_FD_NOT_SUPPLIED); goto error;...
negative
static BlockDriverAIOCB *paio_ioctl(BlockDriverState *bs, int fd, unsigned long int req, void *buf, BlockDriverCompletionFunc *cb, void *opaque){ RawPosixAIOData *acb = g_slice_new(RawPosixAIOData); acb->bs = bs; acb->aio_type = QEMU_AIO_IOCTL; acb->aio_fildes = fd; acb->aio_offset = 0; acb->aio_ioctl_buf = buf; acb->a...
negative
static int readv_f(BlockBackend *blk, int argc, char **argv){ struct timeval t1, t2; int Cflag = 0, qflag = 0, vflag = 0; int c, cnt; char *buf; int64_t offset; /* Some compilers get confused and warn if this is not initialized. */ int total = 0; int nr_iov; QEMUIOVector qiov; int pattern = 0; int Pflag = 0; while ((c ...
negative
static void iter_func(QObject *obj, void *opaque){ QInt *qi; fail_unless(opaque == NULL); qi = qobject_to_qint(obj); fail_unless(qi != NULL); fail_unless((qint_get_int(qi) >= 0) && (qint_get_int(qi) <= iter_max)); iter_called++;}
negative
int avfilter_init_str(AVFilterContext *filter, const char *args){ return avfilter_init_filter(filter, args, NULL);}
negative
SerialState *serial_mm_init(MemoryRegion *address_space, hwaddr base, int it_shift, qemu_irq irq, int baudbase, CharDriverState *chr, enum device_endian end){ SerialState *s; Error *err = NULL; s = g_malloc0(sizeof(SerialState)); s->it_shift = it_shift; s->irq = irq; s->baudbase = baudbase; s->chr = chr; serial_realize...
negative
static void virtio_net_save_device(VirtIODevice *vdev, QEMUFile *f){ VirtIONet *n = VIRTIO_NET(vdev); int i; qemu_put_buffer(f, n->mac, ETH_ALEN); qemu_put_be32(f, n->vqs[0].tx_waiting); qemu_put_be32(f, n->mergeable_rx_bufs); qemu_put_be16(f, n->status); qemu_put_byte(f, n->promisc); qemu_put_byte(f, n->allmulti); qem...
negative
udp_listen(port, laddr, lport, flags)u_int port;u_int32_t laddr;u_int lport;int flags;{struct sockaddr_in addr;struct socket *so;int addrlen = sizeof(struct sockaddr_in), opt = 1;if ((so = socreate()) == NULL) {free(so);return NULL;}so->s = socket(AF_INET,SOCK_DGRAM,0);so->so_expire = curtime + SO_EXPIRE;insque(so,&udb...
negative
void cpu_x86_inject_mce(Monitor *mon, CPUState *cenv, int bank, uint64_t status, uint64_t mcg_status, uint64_t addr, uint64_t misc, int flags){ unsigned bank_num = cenv->mcg_cap & 0xff; CPUState *env; int flag = 0; if (!cenv->mcg_cap) { monitor_printf(mon, "MCE injection not supported\n"); return; } if (bank >= bank_nu...
negative
static void piix3_set_irq(void *opaque, int irq_num, int level){ int i, pic_irq, pic_level; PIIX3State *piix3 = opaque; /* now we change the pic irq level according to the piix irq mappings */ /* XXX: optimize */ pic_irq = piix3->dev.config[0x60 + irq_num]; if (pic_irq < 16) { /* The pic level is the logical OR of all ...
negative
static void mirror_iteration_done(MirrorOp *op, int ret){ MirrorBlockJob *s = op->s; struct iovec *iov; int64_t chunk_num; int i, nb_chunks, sectors_per_chunk; trace_mirror_iteration_done(s, op->sector_num * BDRV_SECTOR_SIZE, op->nb_sectors * BDRV_SECTOR_SIZE, ret); s->in_flight--; s->sectors_in_flight -= op->nb_sector...
negative
static ssize_t spapr_vlan_receive(NetClientState *nc, const uint8_t *buf, size_t size){ VIOsPAPRDevice *sdev = DO_UPCAST(NICState, nc, nc)->opaque; VIOsPAPRVLANDevice *dev = (VIOsPAPRVLANDevice *)sdev; vlan_bd_t rxq_bd = vio_ldq(sdev, dev->buf_list + VLAN_RXQ_BD_OFF); vlan_bd_t bd; int buf_ptr = dev->use_buf_ptr; uint6...
negative
int av_write_frame(AVFormatContext *s, AVPacket *pkt){ int ret = compute_pkt_fields2(s, s->streams[pkt->stream_index], pkt); if(ret<0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS)) return ret; ret= s->oformat->write_packet(s, pkt); if(!ret) ret= url_ferror(s->pb); return ret;}
negative
av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse){ int i, j, n; if (nbits < 2 || nbits > 16) goto fail; s->nbits = nbits; n = 1 << nbits; s->revtab = av_malloc(n * sizeof(uint16_t)); if (!s->revtab) goto fail; s->tmp_buf = av_malloc(n * sizeof(FFTComplex)); if (!s->tmp_buf) goto fail; s->inverse = inverse;...
positive
DisplaySurface *qemu_create_displaysurface_guestmem(int width, int height, pixman_format_code_t format, int linesize, uint64_t addr){ DisplaySurface *surface; hwaddr size; void *data; if (linesize == 0) { linesize = width * PIXMAN_FORMAT_BPP(format) / 8; } size = linesize * height; data = cpu_physical_memory_map(addr, ...
positive
static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref){ AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0); AVFilterContext *ctx = inlink->dst; OverlayContext *over = ctx->priv; av_unused AVFilterLink *outlink = ctx->outputs[0]; inlink->dst->outputs[0]->out_buf = outpicref; outpicref->...
positive
static void monitor_puts(Monitor *mon, const char *str){ char c; for(;;) { assert(mon->outbuf_index < sizeof(mon->outbuf) - 1); c = *str++; if (c == '\0') break; if (c == '\n') mon->outbuf[mon->outbuf_index++] = '\r'; mon->outbuf[mon->outbuf_index++] = c; if (mon->outbuf_index >= (sizeof(mon->outbuf) - 1) || c == '\n')...
positive
void timer_del(QEMUTimer *ts){ QEMUTimerList *timer_list = ts->timer_list; qemu_mutex_lock(&timer_list->active_timers_lock); timer_del_locked(timer_list, ts); qemu_mutex_unlock(&timer_list->active_timers_lock);}
positive
static void put_bitmap(QEMUFile *f, void *pv, size_t size){ unsigned long *bmp = pv; int i, idx = 0; for (i = 0; i < BITS_TO_U64S(size); i++) { uint64_t w = bmp[idx++]; if (sizeof(unsigned long) == 4 && idx < BITS_TO_LONGS(size)) { w |= ((uint64_t)bmp[idx++]) << 32; } qemu_put_be64(f, w); }}
positive
void run_on_cpu(CPUState *env, void (*func)(void *data), void *data){ func(data);}
positive
static int dirac_decode_picture_header(DiracContext *s){ unsigned retire, picnum; int i, j, ret; int64_t refdist, refnum; GetBitContext *gb = &s->gb; /* [DIRAC_STD] 11.1.1 Picture Header. picture_header() PICTURE_NUM */ picnum = s->current_picture->avframe->display_picture_number = get_bits_long(gb, 32); av_log(s->avct...
positive
static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eof){ int ret = 0, i; int got_output = 0; AVPacket avpkt; if (!ist->saw_first_ts) { ist->dts = ist->st->avg_frame_rate.num ? - ist->dec_ctx->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0; ist->pts = 0; if (pkt && pkt->pts ...
negative
static int interleave_new_audio_packet(AVFormatContext *s, AVPacket *pkt, int stream_index, int flush){ AVStream *st = s->streams[stream_index]; AudioInterleaveContext *aic = st->priv_data; int size = FFMIN(av_fifo_size(aic->fifo), *aic->samples * aic->sample_size); if (!size || (!flush && size == av_fifo_size(aic->fif...
negative
static void memcard_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size){ MilkymistMemcardState *s = opaque; trace_milkymist_memcard_memory_write(addr, value); addr >>= 2; switch (addr) { case R_PENDING: /* clear rx pending bits */ s->regs[R_PENDING] &= ~(value & (PENDING_CMD_RX | PENDING_DAT_RX)...
negative
static uint32_t arm_v7m_load_vector(ARMCPU *cpu){ CPUState *cs = CPU(cpu); CPUARMState *env = &cpu->env; MemTxResult result; hwaddr vec = env->v7m.vecbase + env->v7m.exception * 4; uint32_t addr; addr = address_space_ldl(cs->as, vec, MEMTXATTRS_UNSPECIFIED, &result); if (result != MEMTX_OK) { /* Architecturally this sh...
negative
static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque){ SerialState *s = opaque; if (s->tsr_retry <= 0) { if (s->fcr & UART_FCR_FE) { s->tsr = fifo8_is_full(&s->xmit_fifo) ? 0 : fifo8_pop(&s->xmit_fifo); if (!s->xmit_fifo.num) { s->lsr |= UART_LSR_THRE; } } else if ((s->lsr & UART_LSR_THRE)) { r...
negative
ssize_t nbd_send_request(QIOChannel *ioc, NBDRequest *request){ uint8_t buf[NBD_REQUEST_SIZE]; TRACE("Sending request to server: " "{ .from = %" PRIu64", .len = %" PRIu32 ", .handle = %" PRIu64 ", .flags = %" PRIx16 ", .type = %" PRIu16 " }", request->from, request->len, request->handle, request->flags, request->type);...
negative
static AVFilterContext *create_filter(AVFilterGraph *ctx, int index, const char *name, const char *args, AVClass *log_ctx){ AVFilterContext *filt; AVFilter *filterdef; char inst_name[30]; snprintf(inst_name, sizeof(inst_name), "Parsed filter %d", index); if(!(filterdef = avfilter_get_by_name(name))) { av_log(log_ctx, A...
negative
static void scsi_dma_complete_noio(void *opaque, int ret){ SCSIDiskReq *r = (SCSIDiskReq *)opaque; SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); if (r->req.aiocb != NULL) { r->req.aiocb = NULL; block_acct_done(bdrv_get_stats(s->qdev.conf.bs), &r->acct); } if (r->req.io_canceled) { goto done; } if (ret ...
negative
int vnc_display_password(DisplayState *ds, const char *password){ VncDisplay *vs = vnc_display; if (!vs) { return -EINVAL; } if (!password) { /* This is not the intention of this interface but err on the side of being safe */ return vnc_display_disable_login(ds); } if (vs->password) { g_free(vs->password); vs->password...
negative
START_TEST(qdict_get_str_test){ const char *p; const char *key = "key"; const char *str = "string"; qdict_put(tests_dict, key, qstring_from_str(str)); p = qdict_get_str(tests_dict, key); fail_unless(p != NULL); fail_unless(strcmp(p, str) == 0);}
negative
static void rtas_set_tce_bypass(sPAPREnvironment *spapr, uint32_t token, uint32_t nargs, target_ulong args, uint32_t nret, target_ulong rets){ VIOsPAPRBus *bus = spapr->vio_bus; VIOsPAPRDevice *dev; uint32_t unit, enable; if (nargs != 2) { rtas_st(rets, 0, -3); return; } unit = rtas_ld(args, 0); enable = rtas_ld(args, ...
negative
void uuid_generate(uuid_t out){ memset(out, 0, sizeof(uuid_t));}
negative
static void test_unaligned_write_same(void){ QVirtIOSCSI *vs; uint8_t buf[512] = { 0 }; const uint8_t write_same_cdb[CDB_SIZE] = { 0x41, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00 }; qvirtio_scsi_start("-drive file=blkdebug::null-co://,if=none,id=dr1" ",format=raw,file.align=4k " "-device scsi-disk,drive=dr1,...
negative
static void *spapr_build_fdt(sPAPRMachineState *spapr, hwaddr rtas_addr, hwaddr rtas_size){ MachineState *machine = MACHINE(qdev_get_machine()); MachineClass *mc = MACHINE_GET_CLASS(machine); sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(machine); int ret; void *fdt; sPAPRPHBState *phb; char *buf; fdt = g_malloc0(FD...
negative
static void cpu_unlink_tb(CPUState *env){#if defined(CONFIG_USE_NPTL) /* FIXME: TB unchaining isn't SMP safe. For now just ignore the problem and hope the cpu will stop of its own accord. For userspace emulation this often isn't actually as bad as it sounds. Often signals are used primarily to interrupt blocking syscal...
negative
void ppc_hash64_store_hpte(PowerPCCPU *cpu, hwaddr ptex, uint64_t pte0, uint64_t pte1){ CPUPPCState *env = &cpu->env; hwaddr offset = ptex * HASH_PTE_SIZE_64; if (env->external_htab == MMU_HASH64_KVM_MANAGED_HPT) { kvmppc_write_hpte(ptex, pte0, pte1); return; } if (env->external_htab) { stq_p(env->external_htab + offse...
negative
static int get_last_needed_nal(H264Context *h){ int nals_needed = 0; int i; for (i = 0; i < h->pkt.nb_nals; i++) { H2645NAL *nal = &h->pkt.nals[i]; GetBitContext gb; /* packets can sometimes contain multiple PPS/SPS, * e.g. two PAFF field pictures in one packet, or a demuxer * which splits NALs strangely if so, when fr...
negative
static void *qemu_tcg_rr_cpu_thread_fn(void *arg){ CPUState *cpu = arg; rcu_register_thread(); qemu_mutex_lock_iothread(); qemu_thread_get_self(cpu->thread); CPU_FOREACH(cpu) { cpu->thread_id = qemu_get_thread_id(); cpu->created = true; cpu->can_do_io = 1; } qemu_cond_signal(&qemu_cpu_cond); /* wait for initial kick-of...
negative
static QPCIDevice *start_ahci_device(QPCIDevice *ahci, void **hba_base){ /* Map AHCI's ABAR (BAR5) */ *hba_base = qpci_iomap(ahci, 5, NULL); /* turns on pci.cmd.iose, pci.cmd.mse and pci.cmd.bme */ qpci_device_enable(ahci); return ahci;}
negative
static DriveInfo *blockdev_init(const char *file, QDict *bs_opts, BlockInterfaceType type, Error **errp){ const char *buf; const char *serial; int ro = 0; int bdrv_flags = 0; int on_read_error, on_write_error; DriveInfo *dinfo; ThrottleConfig cfg; int snapshot = 0; bool copy_on_read; int ret; Error *error = NULL; QemuO...
negative
static void tcp_chr_connect(void *opaque){ CharDriverState *chr = opaque; TCPCharDriver *s = chr->opaque; struct sockaddr_storage ss, ps; socklen_t ss_len = sizeof(ss), ps_len = sizeof(ps); memset(&ss, 0, ss_len); if (getsockname(s->fd, (struct sockaddr *) &ss, &ss_len) != 0) { snprintf(chr->filename, CHR_MAX_FILENAME_...
negative
static inline int get_bat(CPUPPCState *env, mmu_ctx_t *ctx, target_ulong virtual, int rw, int type){ target_ulong *BATlt, *BATut, *BATu, *BATl; target_ulong BEPIl, BEPIu, bl; int i, valid, prot; int ret = -1; LOG_BATS("%s: %cBAT v " TARGET_FMT_lx "\n", __func__, type == ACCESS_CODE ? 'I' : 'D', virtual); switch (type) ...
negative
static void ehci_flush_qh(EHCIQueue *q){ uint32_t *qh = (uint32_t *) &q->qh; uint32_t dwords = sizeof(EHCIqh) >> 2; uint32_t addr = NLPTR_GET(q->qhaddr); put_dwords(addr + 3 * sizeof(uint32_t), qh + 3, dwords - 3);}
negative
static void v9fs_statfs(void *opaque){ int32_t fid; ssize_t retval = 0; size_t offset = 7; V9fsFidState *fidp; struct statfs stbuf; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; pdu_unmarshal(pdu, offset, "d", &fid); fidp = get_fid(pdu, fid); if (fidp == NULL) { retval = -ENOENT; goto out_nofid; } retval = v9fs_co_stat...
positive
static enum AVPixelFormat get_chroma_format(SchroChromaFormat schro_pix_fmt){ int num_formats = sizeof(schro_pixel_format_map) / sizeof(schro_pixel_format_map[0]); int idx; for (idx = 0; idx < num_formats; ++idx) if (schro_pixel_format_map[idx].schro_pix_fmt == schro_pix_fmt) return schro_pixel_format_map[idx].ff_pix_f...
positive
static void disas_uncond_b_reg(DisasContext *s, uint32_t insn){ unsigned int opc, op2, op3, rn, op4; opc = extract32(insn, 21, 4); op2 = extract32(insn, 16, 5); op3 = extract32(insn, 10, 6); rn = extract32(insn, 5, 5); op4 = extract32(insn, 0, 5); if (op4 != 0x0 || op3 != 0x0 || op2 != 0x1f) { unallocated_encoding(s); ...
positive
static uint32_t openpic_cpu_read_internal(void *opaque, hwaddr addr, int idx){ OpenPICState *opp = opaque; IRQ_src_t *src; IRQ_dst_t *dst; uint32_t retval; int n_IRQ; DPRINTF("%s: cpu %d addr " TARGET_FMT_plx "\n", __func__, idx, addr); retval = 0xFFFFFFFF; if (idx < 0) { return retval; } if (addr & 0xF) return retval;...
positive
static const unsigned char *seq_decode_op3(SeqVideoContext *seq, const unsigned char *src, unsigned char *dst){ int pos, offset; do { pos = *src++; offset = ((pos >> 3) & 7) * seq->frame.linesize[0] + (pos & 7); dst[offset] = *src++; } while (!(pos & 0x80)); return src;}
positive
static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb){ Vp3DecodeContext *s = avctx->priv_data; int visible_width, visible_height, colorspace; int offset_x = 0, offset_y = 0; AVRational fps, aspect; s->theora = get_bits_long(gb, 24); av_log(avctx, AV_LOG_DEBUG, "Theora bitstream version %X\n", s->the...
positive
static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt){ CDXLDemuxContext *cdxl = s->priv_data; AVIOContext *pb = s->pb; uint32_t current_size, video_size, image_size; uint16_t audio_size, palette_size, width, height; int64_t pos; int ret; if (pb->eof_reached) return AVERROR_EOF; pos = avio_tell(pb); if (!cdxl->...
positive
static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size){ CadenceGEMState *s; unsigned rxbufsize, bytes_to_copy; unsigned rxbuf_offset; uint8_t rxbuf[2048]; uint8_t *rxbuf_ptr; bool first_desc = true; int maf; s = qemu_get_nic_opaque(nc); /* Is this destination MAC address "for us" ? */ maf = gem...
positive
static int mpegts_read_close(AVFormatContext *s){ MpegTSContext *ts = s->priv_data; int i; clear_programs(ts); for(i=0;i<NB_PID_MAX;i++) if (ts->pids[i]) mpegts_close_filter(ts, ts->pids[i]); return 0;}
positive
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align){ int line_size; int sample_size = av_get_bytes_per_sample(sample_fmt); int planar = av_sample_fmt_is_planar(sample_fmt); /* validate parameter ranges */ if (!sample_size || nb_samples <= 0 || nb_cha...
positive
int pt_setxattr(FsContext *ctx, const char *path, const char *name, void *value, size_t size, int flags){ char *buffer; int ret; buffer = rpath(ctx, path); ret = lsetxattr(buffer, name, value, size, flags); g_free(buffer); return ret;}
positive
static void gen_b(DisasContext *ctx){ target_ulong li, target; ctx->exception = POWERPC_EXCP_BRANCH; /* sign extend LI */#if defined(TARGET_PPC64) if (ctx->sf_mode) li = ((int64_t)LI(ctx->opcode) << 38) >> 38; else#endif li = ((int32_t)LI(ctx->opcode) << 6) >> 6; if (likely(AA(ctx->opcode) == 0)) target = ctx->nip + li...
positive
bool qdict_get_bool(const QDict *qdict, const char *key){ QObject *obj = qdict_get_obj(qdict, key, QTYPE_QBOOL); return qbool_get_bool(qobject_to_qbool(obj));}
positive
static void adx_encode(unsigned char *adx,const short *wav, ADXChannelState *prev){ int scale; int i; int s0,s1,s2,d; int max=0; int min=0; int data[32]; s1 = prev->s1; s2 = prev->s2; for(i=0;i<32;i++) { s0 = wav[i]; d = ((s0<<14) - SCALE1*s1 + SCALE2*s2)/BASEVOL; data[i]=d; if (max<d) max=d; if (min>d) min=d; s2 = s1;...
positive
static int coroutine_fn bdrv_aligned_pwritev(BlockDriverState *bs, BdrvTrackedRequest *req, int64_t offset, unsigned int bytes, int64_t align, QEMUIOVector *qiov, int flags){ BlockDriver *drv = bs->drv; bool waited; int ret; int64_t start_sector = offset >> BDRV_SECTOR_BITS; int64_t end_sector = DIV_ROUND_UP(offset + b...
negative
int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame, const void *pp, unsigned pp_size, const void *qm, unsigned qm_size, int (*commit_bs_si)(AVCodecContext *, DECODER_BUFFER_DESC *bs, DECODER_BUFFER_DESC *slice)){ AVDXVAContext *ctx = DXVA_CONTEXT(avctx); unsigned buffer_count = 0;#if CONFIG_D3D11VA D3D...
negative
static void put_no_rnd_pixels_x2_mmx( UINT8 *block, const UINT8 *pixels, int line_size, int h){ UINT8 *p; const UINT8 *pix; p = block; pix = pixels; MOVQ_ZERO(mm7); do { __asm __volatile("movq%1, %%mm0\n\t""movq1%1, %%mm1\n\t""movq%%mm0, %%mm2\n\t""movq%%mm1, %%mm3\n\t""punpcklbw %%mm7, %%mm0\n\t""punpcklbw %%mm7, %%mm...
negative
static int attribute_align_arg av_buffersrc_add_frame_internal(AVFilterContext *ctx, AVFrame *frame, int flags){ BufferSourceContext *s = ctx->priv; AVFrame *copy; int ret; if (!frame) { s->eof = 1; return 0; } else if (s->eof) return AVERROR(EINVAL); if (!(flags & AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT)) { switch (ctx->out...
positive
static void av_estimate_timings_from_pts(AVFormatContext *ic, offset_t old_offset){ AVPacket pkt1, *pkt = &pkt1; AVStream *st; int read_size, i, ret; int64_t end_time; int64_t filesize, offset, duration; /* free previous packet */ if (ic->cur_st && ic->cur_st->parser) av_free_packet(&ic->cur_pkt); ic->cur_st = NULL; /*...
positive
static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size, int64_t pos, uint64_t cluster_time, uint64_t block_duration, int is_keyframe, int64_t cluster_pos){ uint64_t timecode = AV_NOPTS_VALUE; MatroskaTrack *track; int res = 0; AVStream *st; int16_t block_time; uint32_t *lace_size = NULL...
positive
GAChannel *ga_channel_new(GAChannelMethod method, const gchar *path, GAChannelCallback cb, gpointer opaque){ GAChannel *c = g_malloc0(sizeof(GAChannel)); SECURITY_ATTRIBUTES sec_attrs; if (!ga_channel_open(c, method, path)) { g_critical("error opening channel"); g_free(c); return NULL; } c->cb = cb; c->user_data = opaq...
positive
static void coroutine_fn verify_entered_step_2(void *opaque){ Coroutine *caller = (Coroutine *)opaque; g_assert(qemu_coroutine_entered(caller)); g_assert(qemu_coroutine_entered(qemu_coroutine_self())); qemu_coroutine_yield(); /* Once more to check it still works after yielding */ g_assert(qemu_coroutine_entered(caller)...
positive
static void mirror_complete(BlockJob *job, Error **errp){ MirrorBlockJob *s = container_of(job, MirrorBlockJob, common); int ret; ret = bdrv_open_backing_file(s->target); if (ret < 0) { char backing_filename[PATH_MAX]; bdrv_get_full_backing_filename(s->target, backing_filename, sizeof(backing_filename)); error_set(errp...
positive
decode_cabac_residual_internal(const H264Context *h, H264SliceContext *sl, int16_t *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff, int is_dc, int chroma422){ static const int significant_coeff_flag_offset[2][14] = { { 105+0, 105+15, 105+29, 105+44, 105+47, 402, 484+0, 484+15, 484+...
positive
static int opus_header(AVFormatContext *avf, int idx){ struct ogg *ogg = avf->priv_data; struct ogg_stream *os = &ogg->streams[idx]; AVStream *st = avf->streams[idx]; struct oggopus_private *priv = os->private; uint8_t *packet = os->buf + os->pstart; if (!priv) { priv = os->private = av_mallocz(sizeof(*priv)); if (!pri...
positive
av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter){ int i; int usesVFilter, usesHFilter; int unscaled; SwsFilter dummyFilter = { NULL, NULL, NULL, NULL }; int srcW = c->srcW; int srcH = c->srcH; int dstW = c->dstW; int dstH = c->dstH; int dst_stride = FFALIGN(dstW * sizeof(int16_t) ...
positive
static int spapr_vio_busdev_init(DeviceState *qdev){ VIOsPAPRDevice *dev = (VIOsPAPRDevice *)qdev; VIOsPAPRDeviceClass *pc = VIO_SPAPR_DEVICE_GET_CLASS(dev); char *id; if (dev->reg != -1) { /* * Explicitly assigned address, just verify that no-one else * is using it. other mechanism). We have to open code this * rather...
positive
static void generate_joint_tables(HYuvContext *s){ uint16_t symbols[1 << VLC_BITS]; uint16_t bits[1 << VLC_BITS]; uint8_t len[1 << VLC_BITS]; if (s->bitstream_bpp < 24) { int p, i, y, u; for (p = 0; p < 3; p++) { for (i = y = 0; y < 256; y++) { int len0 = s->len[0][y]; int limit = VLC_BITS - len0; if (limit <= 0) conti...
positive
static DeviceState *slavio_intctl_init(target_phys_addr_t addr, target_phys_addr_t addrg, qemu_irq **parent_irq){ DeviceState *dev; SysBusDevice *s; unsigned int i, j; dev = qdev_create(NULL, "slavio_intctl"); qdev_init(dev); s = sysbus_from_qdev(dev); for (i = 0; i < MAX_CPUS; i++) { for (j = 0; j < MAX_PILS; j++) { s...
positive
static int stellaris_enet_load(QEMUFile *f, void *opaque, int version_id){ stellaris_enet_state *s = (stellaris_enet_state *)opaque; int i; if (version_id != 1) return -EINVAL; s->ris = qemu_get_be32(f); s->im = qemu_get_be32(f); s->rctl = qemu_get_be32(f); s->tctl = qemu_get_be32(f); s->thr = qemu_get_be32(f); s->mctl...
positive
AudioState *AUD_init (void){ size_t i; int done = 0; const char *drvname; AudioState *s = &glob_audio_state; LIST_INIT (&s->hw_head_out); LIST_INIT (&s->hw_head_in); LIST_INIT (&s->cap_head); atexit (audio_atexit); s->ts = qemu_new_timer (vm_clock, audio_timer, s); if (!s->ts) { dolog ("Could not create audio timer\n")...
positive
static void s390_cpu_model_initfn(Object *obj){
positive
static void spapr_finalize_fdt(sPAPREnvironment *spapr, target_phys_addr_t fdt_addr, target_phys_addr_t rtas_addr, target_phys_addr_t rtas_size){ int ret; void *fdt; sPAPRPHBState *phb; fdt = g_malloc(FDT_MAX_SIZE); /* open out the base tree into a temp buffer for the final tweaks */ _FDT((fdt_open_into(spapr->fdt_skel...
positive
void ff_check_pixfmt_descriptors(void){ int i, j; for (i=0; i<FF_ARRAY_ELEMS(av_pix_fmt_descriptors); i++) { const AVPixFmtDescriptor *d = &av_pix_fmt_descriptors[i]; uint8_t fill[4][8+6+3] = {{0}}; uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]}; int linesize[4] = {0,0,0,0}; uint16_t tmp[2]; if (!d->name && !d...
positive
static void disas_thumb_insn(CPUState *env, DisasContext *s){ uint32_t val, insn, op, rm, rn, rd, shift, cond; int32_t offset; int i; TCGv tmp; TCGv tmp2; TCGv addr; if (s->condexec_mask) { cond = s->condexec_cond; if (cond != 0x0e) { /* Skip conditional when condition is AL. */ s->condlabel = gen_new_label(); gen_test...
positive
int qcow2_snapshot_goto(BlockDriverState *bs, const char *snapshot_id){ BDRVQcowState *s = bs->opaque; QCowSnapshot *sn; int i, snapshot_index, l1_size2; snapshot_index = find_snapshot_by_id_or_name(bs, snapshot_id); if (snapshot_index < 0) return -ENOENT; sn = &s->snapshots[snapshot_index]; if (qcow2_update_snapshot_r...
positive
static int xenstore_scan(const char *type, int dom, struct XenDevOps *ops){ struct XenDevice *xendev; char path[XEN_BUFSIZE], token[XEN_BUFSIZE]; char **dev = NULL, *dom0; unsigned int cdev, j; /* setup watch */ dom0 = xs_get_domain_path(xenstore, 0); snprintf(token, sizeof(token), "be:%p:%d:%p", type, dom, ops); snpri...
positive
static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor, int point_transform, int nb_components){ int i, mb_x, mb_y, mask; int bits= (s->bits+7)&~7; int resync_mb_y = 0; int resync_mb_x = 0; point_transform += bits - s->bits; mask = ((1 << s->bits) - 1) << point_transform; av_assert0(nb_components>=1 && n...
positive
inline static int push_frame(AVFilterLink *outlink){ AVFilterContext *ctx = outlink->src; AVFilterLink *inlink = ctx->inputs[0]; ShowWavesContext *showwaves = outlink->src->priv; int nb_channels = inlink->channels; int ret, i; if ((ret = ff_filter_frame(outlink, showwaves->outpicref)) >= 0) showwaves->req_fullfilled = ...
positive
static void virtio_blk_handle_scsi(VirtIOBlockReq *req){ int status; status = virtio_blk_handle_scsi_req(req->dev, req->elem); virtio_blk_req_complete(req, status); virtio_blk_free_request(req);}
negative
static int generate_fake_vps(QSVEncContext *q, AVCodecContext *avctx){ GetByteContext gbc; PutByteContext pbc; GetBitContext gb; H2645NAL sps_nal = { NULL }; HEVCSPS sps = { 0 }; HEVCVPS vps = { 0 }; uint8_t vps_buf[128], vps_rbsp_buf[128]; uint8_t *new_extradata; unsigned int sps_id; int ret, i, type, vps_size; if (!a...
negative
static int qcelp_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){ const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; QCELPContext *q = avctx->priv_data; float *outbuffer = data; int i; float quantized_lspf[10], lpc[10]; float gain[16]; float *formant_mem; if((q->bitrate = det...
negative
int avio_read(AVIOContext *s, unsigned char *buf, int size){ int len, size1; size1 = size; while (size > 0) { len = FFMIN(s->buf_end - s->buf_ptr, size); if (len == 0 || s->write_flag) { if((s->direct || size > s->buffer_size) && !s->update_checksum) { // bypass the buffer and read data directly into buf if(s->read_pac...
negative
static int hls_probe(AVProbeData *p){ /* Require #EXTM3U at the start, and either one of the ones below * somewhere for a proper match. */ if (strncmp(p->buf, "#EXTM3U", 7)) return 0; if (p->filename && !av_match_ext(p->filename, "m3u8,m3u")) return 0; if (strstr(p->buf, "#EXT-X-STREAM-INF:") || strstr(p->buf, "#EXT-X-...
negative
static int svq1_motion_inter_block(MpegEncContext *s, GetBitContext *bitbuf, uint8_t *current, uint8_t *previous, int pitch, svq1_pmv *motion, int x, int y){ uint8_t *src; uint8_t *dst; svq1_pmv mv; svq1_pmv *pmv[3]; int result; /* predict and decode motion vector */ pmv[0] = &motion[0]; if (y == 0) { pmv[1] = pmv[2] =...
negative
int opt_default(void *optctx, const char *opt, const char *arg){ const AVOption *o; int consumed = 0; char opt_stripped[128]; const char *p; const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class();#if CONFIG_AVRESAMPLE const AVClass *rc = avresample_get_class();#endif const AVClass *sc, *swr_class; if (!str...
positive
static void usb_xhci_realize(struct PCIDevice *dev, Error **errp){ int i, ret; Error *err = NULL; XHCIState *xhci = XHCI(dev); dev->config[PCI_CLASS_PROG] = 0x30; /* xHCI */ dev->config[PCI_INTERRUPT_PIN] = 0x01; /* interrupt pin 1 */ dev->config[PCI_CACHE_LINE_SIZE] = 0x10; dev->config[0x60] = 0x30; /* release number ...
positive
int fw_cfg_add_file(FWCfgState *s, const char *filename, uint8_t *data, uint32_t len){ int i, index; if (!s->files) { int dsize = sizeof(uint32_t) + sizeof(FWCfgFile) * FW_CFG_FILE_SLOTS; s->files = g_malloc0(dsize); fw_cfg_add_bytes(s, FW_CFG_FILE_DIR, (uint8_t*)s->files, dsize); } index = be32_to_cpu(s->files->count)...
positive
static void *postcopy_ram_fault_thread(void *opaque){ MigrationIncomingState *mis = opaque; struct uffd_msg msg; int ret; RAMBlock *rb = NULL; RAMBlock *last_rb = NULL; /* last RAMBlock we sent part of */ trace_postcopy_ram_fault_thread_entry(); qemu_sem_post(&mis->fault_thread_sem); while (true) { ram_addr_t rb_offset...
positive
static ssize_t qio_channel_websock_decode_header(QIOChannelWebsock *ioc, Error **errp){ unsigned char opcode, fin, has_mask; size_t header_size; size_t payload_len; QIOChannelWebsockHeader *header = (QIOChannelWebsockHeader *)ioc->encinput.buffer; if (ioc->payload_remain) { error_setg(errp, "Decoding header but %zu byt...
positive
static int vscsi_send_iu(VSCSIState *s, vscsi_req *req, uint64_t length, uint8_t format){ long rc, rc1; /* First copy the SRP */ rc = spapr_vio_dma_write(&s->vdev, req->crq.s.IU_data_ptr, &req->iu, length); if (rc) { fprintf(stderr, "vscsi_send_iu: DMA write failure !\n"); } req->crq.s.valid = 0x80; req->crq.s.format =...
positive
static int r3d_read_reda(AVFormatContext *s, AVPacket *pkt, Atom *atom){ AVStream *st = s->streams[1]; int av_unused tmp, tmp2; int samples, size; uint64_t pos = avio_tell(s->pb); unsigned dts; int ret; dts = avio_rb32(s->pb); st->codec->sample_rate = avio_rb32(s->pb); samples = avio_rb32(s->pb); tmp = avio_rb32(s->pb)...