avformat/movenc: fix cleanup on insufficient reserved_moov_size
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 25 Jan 2015 13:28:43 +0000 (14:28 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 25 Jan 2015 13:28:43 +0000 (14:28 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/movenc.c

index 29535cd..8b06623 100644 (file)
@@ -5160,7 +5160,8 @@ static int mov_write_trailer(AVFormatContext *s)
             size = mov->reserved_moov_size - (avio_tell(pb) - mov->reserved_moov_pos);
             if (size < 8){
                 av_log(s, AV_LOG_ERROR, "reserved_moov_size is too small, needed %"PRId64" additional\n", 8-size);
-                return -1;
+                res = AVERROR(EINVAL);
+                goto error;
             }
             avio_wb32(pb, size);
             ffio_wfourcc(pb, "free");