Commit 3f81259f authored by Pan Bian's avatar Pan Bian Committed by Michael Niedermayer

avformat/mov: set correct error code in mov_read_custom

In function mov_read_custom(), it returns 0 on the path that av_malloc()
returns a NULL pointer. 0 indicates success. An error code should be
assigned to ret.
Signed-off-by: 's avatarPan Bian <bianpan2016@163.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 62f7f40c
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment