On Tue, Apr 16, 2013 at 03:19:36PM +0200, Anton Khirnov wrote:
> --- a/libavcodec/indeo3.c
> +++ b/libavcodec/indeo3.c
> @@ -232,6 +232,16 @@ static void copy_cell(Indeo3DecodeContext *ctx, Plane 
> *plane, Cell *cell)
> +
> +    /* -1 because there is an extra line on top for prediction */
> +    if ((cell->ypos << 2) + mv_y < -1 || (cell->xpos << 2) + mv_x < 0 ||
> +        ((cell->ypos + cell->height) << 2) + mv_y >= plane->height    ||
> +        ((cell->xpos + cell->width)  << 2) + mv_x >= plane->width) {
> +        av_log(ctx->avctx, AV_LOG_ERROR, "Motion vectors point out of "
> +               "the frame.\n");
> +        return AVERROR_INVALIDDATA;
> +    }
> @@ -585,11 +597,23 @@ static int decode_cell(Indeo3DecodeContext *ctx, 
> AVCodecContext *avctx,
> +        /* -1 because there is an extra line on top for prediction */
> +        if ((cell->ypos << 2) + mv_y < -1 || (cell->xpos << 2) + mv_x < 0 ||
> +            ((cell->ypos + cell->height) << 2) + mv_y >= plane->height    ||
> +            ((cell->xpos + cell->width)  << 2) + mv_x >= plane->width) {
> +            av_log(ctx->avctx, AV_LOG_ERROR, "Motion vectors point out of "
> +                   "the frame.\n");
> +            return AVERROR_INVALIDDATA;
> +        }

That's a complex expression to duplicate - maybe put it in a macro or
inline function?

The linebreak in the av_log would look better after the second parameter.

Feel free to ignore me and push.

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

Reply via email to