diff --git a/libavformat/mov.c b/libavformat/mov.c index da26b489a5..5d2f5d0e16 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -4389,6 +4389,9 @@ static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom) } else break; + if (*p) + break; + *p = av_malloc(len + 1); if (!*p) { ret = AVERROR(ENOMEM);