X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fspdifenc.c;h=9514ff8e10e3518ef736a90ad675dde9fc9c0614;hb=0ed678a97abddef6b287b8cb93c24fba662f54a3;hp=3a50aebbefd42e0f3254852827066f60e51c71e2;hpb=c00579ab32aa620116c97dbc52c4c31418bc7fbb;p=ffmpeg diff --git a/libavformat/spdifenc.c b/libavformat/spdifenc.c index 3a50aebbefd..9514ff8e10e 100644 --- a/libavformat/spdifenc.c +++ b/libavformat/spdifenc.c @@ -118,7 +118,8 @@ static int spdif_header_eac3(AVFormatContext *s, AVPacket *pkt) static const uint8_t eac3_repeat[4] = {6, 3, 2, 1}; int repeat = 1; - if ((pkt->data[4] & 0xc0) != 0xc0) /* fscod */ + int bsid = pkt->data[5] >> 3; + if (bsid > 10 && (pkt->data[4] & 0xc0) != 0xc0) /* fscod */ repeat = eac3_repeat[(pkt->data[4] & 0x30) >> 4]; /* numblkscod */ ctx->hd_buf = av_fast_realloc(ctx->hd_buf, &ctx->hd_buf_size, ctx->hd_buf_filled + pkt->size);