[FFmpeg-cvslog] auenc: do not write invalid file size

Paul B Mahol git at videolan.org
Fri Dec 28 17:33:29 CET 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Dec 28 13:21:36 2012 +0000| [507956824c642e44b0ab7af669a2700c9e57878a] | committer: Paul B Mahol

auenc: do not write invalid file size

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=507956824c642e44b0ab7af669a2700c9e57878a
---

 libavformat/au.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavformat/au.c b/libavformat/au.c
index 3648e89..4cf8966 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -174,12 +174,10 @@ static int au_write_packet(AVFormatContext *s, AVPacket *pkt)
 static int au_write_trailer(AVFormatContext *s)
 {
     AVIOContext *pb = s->pb;
-    int64_t file_size;
-
-    if (s->pb->seekable) {
+    int64_t file_size = avio_tell(pb);
 
+    if (s->pb->seekable && file_size < INT32_MAX) {
         /* update file size */
-        file_size = avio_tell(pb);
         avio_seek(pb, 8, SEEK_SET);
         avio_wb32(pb, (uint32_t)(file_size - AU_HEADER_SIZE));
         avio_seek(pb, file_size, SEEK_SET);



More information about the ffmpeg-cvslog mailing list