static int set_string_binary(void *obj, const AVOption *o, const char *val, uint8_t **dst)

{

    int *lendst = (int *)(dst + 1);

    uint8_t *bin, *ptr;

    int len = strlen(val);



    av_freep(dst);

    *lendst = 0;



    if (len & 1)

        return AVERROR(EINVAL);

    len /= 2;



    ptr = bin = av_malloc(len);

    while (*val) {

        int a = hexchar2int(*val++);

        int b = hexchar2int(*val++);

        if (a < 0 || b < 0) {

            av_free(bin);

            return AVERROR(EINVAL);

        }

        *ptr++ = (a << 4) | b;

    }

    *dst = bin;

    *lendst = len;



    return 0;

}

static int set_string_binary(void *obj, const AVOption *o, const char *val, uint8_t **dst)

{

    int *lendst = (int *)(dst + 1);

    uint8_t *bin, *ptr;

    int len = strlen(val);



    av_freep(dst);

    *lendst = 0;



    if (len & 1)

        return AVERROR(EINVAL);

    len /= 2;



    ptr = bin = av_malloc(len);

    while (*val) {

        int a = hexchar2int(*val++);

        int b = hexchar2int(*val++);

        if (a < 0 || b < 0) {

            av_free(bin);

            return AVERROR(EINVAL);

        }

        *ptr++ = (a << 4) | b;

    }

    *dst = bin;

    *lendst = len;



    return 0;

}

    int len = strlen(val);
static int FUNC_0(void *VAR_0, const AVOption *VAR_1, const char *VAR_2, uint8_t **VAR_3)

{

    int *VAR_4 = (int *)(VAR_3 + 1);

    uint8_t *bin, *ptr;

    int VAR_5 = strlen(VAR_2);



    av_freep(VAR_3);

    *VAR_4 = 0;



    if (VAR_5 & 1)

        return AVERROR(EINVAL);

    VAR_5 /= 2;



    ptr = bin = av_malloc(VAR_5);

    while (*VAR_2) {

        int VAR_6 = hexchar2int(*VAR_2++);

        int VAR_7 = hexchar2int(*VAR_2++);

        if (VAR_6 < 0 || VAR_7 < 0) {

            av_free(bin);

            return AVERROR(EINVAL);

        }

        *ptr++ = (VAR_6 << 4) | VAR_7;

    }

    *VAR_3 = bin;

    *VAR_4 = VAR_5;



    return 0;

}

static int FUNC_0(void *VAR_0, const AVOption *VAR_1, const char *VAR_2, uint8_t **VAR_3)
{ int *VAR_4 = (int *)(VAR_3 + 1); uint8_t *bin, *ptr; int VAR_5 = strlen(VAR_2); av_freep(VAR_3); *VAR_4 = 0; if (VAR_5 & 1)
return AVERROR(EINVAL); VAR_5 /= 2; ptr = bin = av_malloc(VAR_5); while (*VAR_2) { int VAR_6 = hexchar2int(*VAR_2++); int VAR_7 = hexchar2int(*VAR_2++); if (VAR_6 < 0 || VAR_7 < 0) { av_free(bin); return AVERROR(EINVAL); } *ptr++ = (VAR_6 << 4) | VAR_7; } *VAR_3 = bin; *VAR_4 = VAR_5; return 0; }