1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

libavcodec/tests/motion: Add check for avcodec_alloc_context3()

Add check for the return value of avcodec_alloc_context3() to avoid potential NULL pointer dereference.

Fixes: 5d48e4eafa ("Merge commit 'a6a750c7ef240b72ce01e9653343a0ddf247d196'")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Jiasheng Jiang
2025-08-03 20:32:23 +00:00
committed by Michael Niedermayer
parent 9ca58424de
commit 55d234b433

View File

@ -129,6 +129,10 @@ int main(int argc, char **argv)
printf("ffmpeg motion test\n");
ctx = avcodec_alloc_context3(NULL);
if (!ctx) {
return 1;
}
ctx->flags |= AV_CODEC_FLAG_BITEXACT;
av_force_cpu_flags(0);
ff_me_cmp_init(&cctx, ctx);