static int oma_read_seek(struct AVFormatContext *s,

                         int stream_index, int64_t timestamp, int flags)

{

    OMAContext *oc = s->priv_data;

    int err = ff_pcm_read_seek(s, stream_index, timestamp, flags);



    if (!oc->encrypted)

        return err;



    /* readjust IV for CBC */

    if (err || avio_tell(s->pb) < oc->content_start)

        goto wipe;

    if ((err = avio_seek(s->pb, -8, SEEK_CUR)) < 0)

        goto wipe;

    if ((err = avio_read(s->pb, oc->iv, 8)) < 8) {

        if (err >= 0)

            err = AVERROR_EOF;

        goto wipe;

    }



    return 0;

wipe:

    memset(oc->iv, 0, 8);

    return err;

}

static int oma_read_seek(struct AVFormatContext *s,

                         int stream_index, int64_t timestamp, int flags)

{

    OMAContext *oc = s->priv_data;

    int err = ff_pcm_read_seek(s, stream_index, timestamp, flags);



    if (!oc->encrypted)

        return err;



    

    if (err || avio_tell(s->pb) < oc->content_start)

        goto wipe;

    if ((err = avio_seek(s->pb, -8, SEEK_CUR)) < 0)

        goto wipe;

    if ((err = avio_read(s->pb, oc->iv, 8)) < 8) {

        if (err >= 0)

            err = AVERROR_EOF;

        goto wipe;

    }



    return 0;

wipe:

    memset(oc->iv, 0, 8);

    return err;

}

    int err = ff_pcm_read_seek(s, stream_index, timestamp, flags);
static int FUNC_0(struct AVFormatContext *VAR_0,

                         int VAR_1, int64_t VAR_2, int VAR_3)

{

    OMAContext *oc = VAR_0->priv_data;

    int VAR_4 = ff_pcm_read_seek(VAR_0, VAR_1, VAR_2, VAR_3);



    if (!oc->encrypted)

        return VAR_4;



    

    if (VAR_4 || avio_tell(VAR_0->pb) < oc->content_start)

        goto wipe;

    if ((VAR_4 = avio_seek(VAR_0->pb, -8, SEEK_CUR)) < 0)

        goto wipe;

    if ((VAR_4 = avio_read(VAR_0->pb, oc->iv, 8)) < 8) {

        if (VAR_4 >= 0)

            VAR_4 = AVERROR_EOF;

        goto wipe;

    }



    return 0;

wipe:

    memset(oc->iv, 0, 8);

    return VAR_4;

}

static int FUNC_0(struct AVFormatContext *VAR_0,
int VAR_1, int64_t VAR_2, int VAR_3)
{ OMAContext *oc = VAR_0->priv_data; int VAR_4 = ff_pcm_read_seek(VAR_0, VAR_1, VAR_2, VAR_3); if (!oc->encrypted)
return VAR_4; if (VAR_4 || avio_tell(VAR_0->pb) < oc->content_start)
goto wipe; if ((VAR_4 = avio_seek(VAR_0->pb, -8, SEEK_CUR)) < 0)
goto wipe; if ((VAR_4 = avio_read(VAR_0->pb, oc->iv, 8)) < 8) { if (VAR_4 >= 0)
VAR_4 = AVERROR_EOF; goto wipe; } return 0; wipe:
memset(oc->iv, 0, 8); return VAR_4; }