aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2016-05-29 16:51:57 +0200
committerMarton Balint <cus@passwd.hu>2016-05-31 00:35:16 +0200
commit15005701b590dfeed3d597444f1f5391ff1cfbb0 (patch)
treec07677f2260fbcaaf9029627dcad8c81fac445d6 /libavformat/movenc.c
parent37d201aad9f7e7f233955345aee1198421a68f5e (diff)
downloadffmpeg-15005701b590dfeed3d597444f1f5391ff1cfbb0.tar.gz
avformat/movenc: propagate shift_data errors properly
The second one is not explicitly needed, as res is not reset, but it is there for consistency. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 3a633a668a..f8bfcfe7cd 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5731,6 +5731,8 @@ static int mov_write_trailer(AVFormatContext *s)
if (mov->flags & FF_MOV_FLAG_FASTSTART) {
av_log(s, AV_LOG_INFO, "Starting second pass: moving the moov atom to the beginning of the file\n");
res = shift_data(s);
+ if (res < 0)
+ goto error;
if (res == 0) {
avio_seek(pb, mov->reserved_header_pos, SEEK_SET);
if ((res = mov_write_moov_tag(pb, mov, s)) < 0)
@@ -5762,6 +5764,8 @@ static int mov_write_trailer(AVFormatContext *s)
if (mov->flags & FF_MOV_FLAG_GLOBAL_SIDX) {
av_log(s, AV_LOG_INFO, "Starting second pass: inserting sidx atoms\n");
res = shift_data(s);
+ if (res < 0)
+ goto error;
if (res == 0) {
int64_t end = avio_tell(pb);
avio_seek(pb, mov->reserved_header_pos, SEEK_SET);