if(size<0) goto fail;
int avpicture_alloc(AVPicture *picture,                           int pix_fmt, int width, int height){    unsigned int size;    void *ptr;    size = avpicture_get_size(pix_fmt, width, height);    ptr = av_malloc(size);    if (!ptr)        goto fail;    avpicture_fill(picture, ptr, pix_fmt, width, height);    return 0; fail:    memset(picture, 0, sizeof(AVPicture));    return -1;}