Before the patch, an implicit padding on the right is applied for
incomplete IV in manifest. No padding is allowed for IV inside
EXT-X-KEY.
---
 libavformat/hls.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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));
-- 
2.31.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to