linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] nowebcam segfault


From: Craig Matsuura
Subject: [Linphone-developers] nowebcam segfault
Date: Wed, 24 Sep 2014 20:47:25 +0000

Not sure this was fixed or not.

I corrected a problem when using nowebcam that potentially can cause issues for when videoenc.  The call to avcodec_get_frame_defaults(&pict); would segfault.  Before calling with an initialized pict, we clear the memory.  Like you do for the packet.

in the mediastreamer2/src/videofilters/videoenc.c (about line 819)

static void process_frame(MSFilter *f, mblk_t *inm){
        EncState *s=(EncState*)f->data;
        AVFrame pict;
        AVCodecContext *c=&s->av_context;
        int error,got_packet;
        mblk_t *comp_buf=s->comp_buf;
        int comp_buf_sz=comp_buf->b_datap->db_lim-comp_buf->b_datap->db_base;
        YuvBuf yuv;
        struct AVPacket packet;
        memset(&packet, 0, sizeof(packet));
        memset(&pict, 0, sizeof(pict));

        ms_yuv_buf_init_from_mblk(&yuv, inm);
        /* convert image if necessary */
        avcodec_get_frame_defaults(&pict);
        avpicture_fill((AVPicture*)&pict,yuv.planes[0],c->pix_fmt,c->width,c->height);


Now no segfault and the nowebcam image displays on the other client your calling.

Craig

reply via email to

[Prev in Thread] Current Thread [Next in Thread]