diff --git a/libavformat/mov.c b/libavformat/mov.c index c9740bfa2b..eaa7a4d26d 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -3844,6 +3844,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;