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.
Unified · Split
| @@ -740,6 +740,13 @@ static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState · 739 unmodified lines | ||
| 740 | 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 | 750 | e_pci = dvdnav_get_current_nav_pci(state->dvdnav); |
| 744 | 751 | e_dsi = dvdnav_get_current_nav_dsi(state->dvdnav); |
| 745 | 752 | |