X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Faiffdec.c;h=a42987c15f7e1153883dc019df7c1d79a6a52465;hb=99d78e4f424918c6584b358cd98cfc6165c5d158;hp=7c701e0c700769d5e47b990f463393f9aca153e1;hpb=23ce57af3ad684363881cdd66d5724f40963a65c;p=ffmpeg diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index 7c701e0c700..a42987c15f7 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -29,6 +29,7 @@ #include "isom.h" #include "id3v2.h" #include "mov_chan.h" +#include "replaygain.h" #define AIFF 0 #define AIFF_C_VERSION1 0xA2805140 @@ -189,7 +190,7 @@ static int get_aiff_header(AVFormatContext *s, int size, return num_frames; } -static int aiff_probe(AVProbeData *p) +static int aiff_probe(const AVProbeData *p) { /* check file header */ if (p->buf[0] == 'F' && p->buf[1] == 'O' && @@ -242,7 +243,10 @@ static int aiff_read_header(AVFormatContext *s) if (size < 0) return size; - filesize -= size + 8; + if (size >= 0x7fffffff - 8) + filesize = 0; + else + filesize -= size + 8; switch (tag) { case MKTAG('C', 'O', 'M', 'M'): /* Common chunk */ @@ -348,6 +352,10 @@ static int aiff_read_header(AVFormatContext *s) } } + ret = ff_replaygain_export(st, s->metadata); + if (ret < 0) + return ret; + got_sound: if (!st->codecpar->block_align && st->codecpar->codec_id == AV_CODEC_ID_QCELP) { av_log(s, AV_LOG_WARNING, "qcelp without wave chunk, assuming full rate\n");