mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
demux_mkv: improve robustness against broken libavcodec parsers
The VP9 codec parser has a bug: it doesn't set the data/size pointers passed to it. As I understand, it must always do this, and in fact, if it doesn't some libavcodec generic code would be in trouble too. This helps with #1448, but is not the full fix for it. The codec parser must be fixed in libavcodec itself.
This commit is contained in:
@@ -2272,8 +2272,8 @@ static bool mkv_parse_packet(mkv_track_t *track, bstr *raw, bstr *out)
|
||||
}
|
||||
if (track->av_parser && track->av_parser_codec) {
|
||||
while (raw->len) {
|
||||
uint8_t *data;
|
||||
int size;
|
||||
uint8_t *data = NULL;
|
||||
int size = 0;
|
||||
int len = av_parser_parse2(track->av_parser, track->av_parser_codec,
|
||||
&data, &size, raw->start, raw->len,
|
||||
AV_NOPTS_VALUE, AV_NOPTS_VALUE, 0);
|
||||
|
||||
Reference in New Issue
Block a user