diff --git a/libavformat/mov.c b/libavformat/mov.c index 0c354ab387..ab81ad64ae 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -3954,6 +3954,9 @@ static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom) } else break; + if (*p) + break; + *p = av_malloc(len + 1); if (!*p) break;