diff options
author | Marth64 <marth64@proxyid.net> | 2024-10-07 18:04:58 -0500 |
---|---|---|
committer | Marth64 <marth64@proxyid.net> | 2024-11-16 14:40:51 -0600 |
commit | afc152f564fbeca4d2ff62195e3f0b6244e28cb3 (patch) | |
tree | d81d524bb47e1857ee9fb78dde78c4fdcb75d344 | |
parent | a1ae66c827370b7caa90f10068bdd913f4cf2f18 (diff) | |
download | ffmpeg-afc152f564fbeca4d2ff62195e3f0b6244e28cb3.tar.gz |
avformat/dvdvideodec: check the length of a NAV packet when reading titles
Some discs present titles with bogus NAV packets. We apply this check
for menus and for title MPEG blocks, but we should also apply it
for NAV packets during title demuxing.
Signed-off-by: Marth64 <marth64@proxyid.net>
-rw-r--r-- | libavformat/dvdvideodec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index 726c45601f..f7c7ba5a3b 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -740,6 +740,13 @@ static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState return AVERROR_EOF; } + if (nav_len != DVDVIDEO_BLOCK_SIZE) { + av_log(s, AV_LOG_ERROR, "Invalid NAV packet size (expected=%d actual=%d)\n", + DVDVIDEO_BLOCK_SIZE, nav_len); + + return AVERROR_INVALIDDATA; + } + e_pci = dvdnav_get_current_nav_pci(state->dvdnav); e_dsi = dvdnav_get_current_nav_dsi(state->dvdnav); |