diff --git a/libavformat/mov.c b/libavformat/mov.c index b3b800f898..230a7f95d0 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -4176,8 +4176,10 @@ static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom) break; *p = av_malloc(len + 1); - if (!*p) + if (!*p) { + ret = AVERROR(ENOMEM); break; + } ret = ffio_read_size(pb, *p, len); if (ret < 0) { av_freep(p);