On Mon, Apr 29, 2013 at 08:16:28AM +0200, Luca Barbato wrote:
> --- a/libavformat/omadec.c
> +++ b/libavformat/omadec.c
> @@ -442,24 +442,23 @@ 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);
> 
> -    ff_pcm_read_seek(s, stream_index, timestamp, flags);
> +    if (!oc->encrypted)
> +        return err;
> 
> -    if (oc->encrypted) {
> -        /* readjust IV for CBC */
> -        int64_t pos = avio_tell(s->pb);
> -        if (pos < oc->content_start)
> -            memset(oc->iv, 0, 8);
> -        else {
> -            if (avio_seek(s->pb, -8, SEEK_CUR) < 0 ||
> -                avio_read(s->pb, oc->iv, 8) < 8) {
> -                memset(oc->iv, 0, 8);
> -                return -1;
> -            }
> -        }
> -    }
> +    /* readjust IV for CBC */
> +    if (!err && avio_tell(s->pb) >= oc->content_start &&
> +        (err = avio_seek(s->pb, -8, SEEK_CUR)) >= 0 &&
> +        (err = avio_read(s->pb, oc->iv, 8)) < 8)
> +        err = AVERROR_EOF;
> 
> -    return 0;
> +    if (err < 0)
> +        memset(oc->iv, 0, 8);
> +    else
> +        err = 0;
> +
> +    return err;
>  }

This belongs in a different commit IMO.  I suggest you push the rest,
which is OK, separately right away.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to