diff mbox

[FFmpeg-devel,FFmpeg-devel,2/2] avformat/mov: return correct value in mov_read_cmov

Message ID 1511752385-25288-1-git-send-email-bianpan2016@163.com
State Accepted
Commit f63450c8e4c9c1f7af07869c4a25543e4e4d2626
Headers show

Commit Message

Pan Bian Nov. 27, 2017, 3:13 a.m. UTC
On some failure paths, the error code is not correctly set.

Signed-off-by: Pan Bian <bianpan2016@163.com>
---
 libavformat/mov.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Michael Niedermayer Nov. 28, 2017, 8:35 p.m. UTC | #1
On Mon, Nov 27, 2017 at 11:13:05AM +0800, Pan Bian wrote:
> On some failure paths, the error code is not correctly set.
> 
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
>  libavformat/mov.c | 1 +
>  1 file changed, 1 insertion(+)

will apply

thanks

[...]
diff mbox

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index d25071b..bbf550f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4895,6 +4895,7 @@  static int mov_read_cmov(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     if (ret < 0)
         goto free_and_return;
 
+    ret = AVERROR_INVALIDDATA;
     if (uncompress (moov_data, (uLongf *) &moov_len, (const Bytef *)cmov_data, cmov_len) != Z_OK)
         goto free_and_return;
     if (ffio_init_context(&ctx, moov_data, moov_len, 0, NULL, NULL, NULL, NULL) != 0)