aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/au.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-12-28 13:21:36 +0000
committerPaul B Mahol <onemda@gmail.com>2012-12-28 16:29:22 +0000
commit507956824c642e44b0ab7af669a2700c9e57878a (patch)
treef2ccd22bcad17b2c59705f19ae7794416794abfa /libavformat/au.c
parent8afe168c784b3822ab36a673751ae3d992cedaf0 (diff)
downloadffmpeg-507956824c642e44b0ab7af669a2700c9e57878a.tar.gz
auenc: do not write invalid file size
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/au.c')
-rw-r--r--libavformat/au.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavformat/au.c b/libavformat/au.c
index 3648e89df3..4cf896688b 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);