-
-
Save rcombs/c4a7a17b7c05a07a216c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c | |
index 3b525ad..37d9caa 100644 | |
--- a/libavformat/matroskaenc.c | |
+++ b/libavformat/matroskaenc.c | |
@@ -1568,7 +1568,8 @@ static void mkv_write_block(AVFormatContext *s, AVIOContext *pb, | |
avio_tell(pb), pkt->size, pkt->pts, pkt->dts, pkt->duration, | |
keyframe != 0); | |
if (codec->codec_id == AV_CODEC_ID_H264 && codec->extradata_size > 0 && | |
- (AV_RB24(codec->extradata) == 1 || AV_RB32(codec->extradata) == 1)) | |
+ (AV_RB24(codec->extradata) == 1 || AV_RB32(codec->extradata) == 1) && | |
+ pkt->data) | |
ff_avc_parse_nal_units_buf(pkt->data, &data, &size); | |
else if (codec->codec_id == AV_CODEC_ID_HEVC && codec->extradata_size > 6 && | |
(AV_RB24(codec->extradata) == 1 || AV_RB32(codec->extradata) == 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment