History

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.

Marth64 committed 2 years ago

Commit afc152f1 parent a1ae66c1 file · +7 −0Browse files

Unified · Split

libavformat/dvdvideodec.c+7−0
@@ -740,6 +740,13 @@ static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState · 739 unmodified lines
740 return AVERROR_EOF;740 return AVERROR_EOF;
741 }741 }
742 742
743 if (nav_len != DVDVIDEO_BLOCK_SIZE) {
744 av_log(s, AV_LOG_ERROR, "Invalid NAV packet size (expected=%d actual=%d)\n",
745 DVDVIDEO_BLOCK_SIZE, nav_len);
746
747 return AVERROR_INVALIDDATA;
748 }
749
743 e_pci = dvdnav_get_current_nav_pci(state->dvdnav);750 e_pci = dvdnav_get_current_nav_pci(state->dvdnav);
744 e_dsi = dvdnav_get_current_nav_dsi(state->dvdnav);751 e_dsi = dvdnav_get_current_nav_dsi(state->dvdnav);
745 752

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t