Message ID | tencent_C2DBCF975561A76738E8160E4D6EA0194D07@qq.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,v2] avformat/hls: check IV size inside EXT-X-KEY | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
diff --git a/libavformat/hls.c b/libavformat/hls.c index 83ff4cc607..312294f0c7 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -810,7 +810,12 @@ static int parse_playlist(HLSContext *c, const char *url, if (!strcmp(info.method, "SAMPLE-AES")) key_type = KEY_SAMPLE_AES; if (!av_strncasecmp(info.iv, "0x", 2)) { - ff_hex_to_data(iv, info.iv + 2); + int n = ff_hex_to_data(iv, info.iv + 2); + if (n != 16) { + av_log(c->ctx, AV_LOG_ERROR, "Incomplete IV '%s'\n", info.iv); + ret = AVERROR_INVALIDDATA; + goto fail; + } has_iv = 1; } av_strlcpy(key, info.uri, sizeof(key));