-
-
Save rcombs/cc357b39e5dad4eb7cb45e987736185e 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/mux.c b/libavformat/mux.c | |
index 9848899..9bdf52d 100644 | |
--- a/libavformat/mux.c | |
+++ b/libavformat/mux.c | |
@@ -1090,6 +1090,16 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt) | |
} | |
} | |
+ if (!st->internal->avctx->extradata && st->codecpar->extradata) { | |
+ int size = st->codecpar->extradata_size; | |
+ if (size < 0 || size >= INT32_MAX - AV_INPUT_BUFFER_PADDING_SIZE) | |
+ return AVERROR(EINVAL); | |
+ st->internal->avctx->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE); | |
+ if (!st->internal->avctx->extradata) | |
+ return AVERROR(ENOMEM); | |
+ st->internal->avctx->extradata_size = size; | |
+ memcpy(st->internal->avctx->extradata, st->codecpar->extradata, size); | |
+ } | |
av_apply_bitstream_filters(st->internal->avctx, pkt, st->internal->bsfc); | |
if (pkt->size == 0 && pkt->side_data_elems == 0) | |
return 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment