avformat/spdifenc: bound DTS core_size against the packet size in the HD path
Fixes: out of array read
Fixes: yBSax492UIB9
Fixes: 482d98f69b (spdifenc: IEC 61937 encapsulation of DTS-HD for HDMI)
Found-by: Pavel Kohout (Aisle Research)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
michaelni
parent
95a888b9ca
commit
6f80e27654
@@ -225,7 +225,7 @@ static int spdif_header_dts4(AVFormatContext *s, AVPacket *pkt, int core_size,
|
||||
* (dtshd_fallback == 0) */
|
||||
ctx->dtshd_skip = 1;
|
||||
}
|
||||
if (ctx->dtshd_skip && core_size) {
|
||||
if (ctx->dtshd_skip && core_size && core_size <= pkt->size) {
|
||||
pkt_size = core_size;
|
||||
if (ctx->dtshd_fallback >= 0)
|
||||
--ctx->dtshd_skip;
|
||||
|
||||
Reference in New Issue
Block a user