aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2017-11-27 11:12:56 +0800
committerMichael Niedermayer <michael@niedermayer.cc>2017-11-28 21:42:48 +0100
commit3f81259f337ba57ab1a722566c8d8122dc705823 (patch)
treeb3cc13fb2981dd9d32036959bacdd055f04d821c /libavformat
parent62f7f40caa70212cd017a66d514fc64f24a3adbc (diff)
downloadffmpeg-3f81259f337ba57ab1a722566c8d8122dc705823.tar.gz
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: Pan Bian <bianpan2016@163.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c4
1 files changed, 3 insertions, 1 deletions
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);