[FFmpeg-devel] [PATCH 3/3] avutil/frame: Check at some random points that the AVFrame structure matches what it should be.

Timothy Gu timothygu99 at gmail.com
Wed Dec 18 22:24:06 CET 2013


On Tue, Dec 17, 2013 at 5:34 AM, Michael Niedermayer <michaelni at gmx.at> wrote:

> +static void check_frame_struct_version(const AVFrame *frame)
> +{
> +    if (frame->struct_version != LIBAVUTIL_VERSION_MAJOR + (sizeof(AVFrame)<<8) + ((uint64_t)MKTAG('A','V','F','r')<<32)) {
> +        static int warned;
> +        if (!warned)
> +            av_log(NULL, AV_LOG_FATAL,
> +                   "Corrupted AVFrame or wrong structure detected.\n"
> +                   "Check that you arent loading 2 different libavutil versions at the same time\n"

aren't

> +                   "And that you use av_frame_alloc() and not malloc or memset on an AVFrame\n");
> +        warned = 1;
> +        av_assert2(0);
> +        av_assert0(!frame->struct_version);
> +    }
> +}


More information about the ffmpeg-devel mailing list