Commit 792a48710e for ffmpeg
commit 792a48710eb09b4823907551bfd3536805bd2a51
Author: Romain Beauxis <romain.beauxis@gmail.com>
Date: Tue Nov 17 08:43:21 2026 -0600
avformat/hevc: accept hvcC records with configurationVersion 0
Older muxers wrote 0 there. libavcodec reads such records, but the hvcC
writer rejected them: remuxing to Matroska failed, and mp4 and FLV,
which ignore the error, wrote an empty hvcC box. The record written out
always carries configurationVersion 1.
diff --git a/libavformat/hevc.c b/libavformat/hevc.c
index 678a9e2206..a98422103e 100644
--- a/libavformat/hevc.c
+++ b/libavformat/hevc.c
@@ -1300,15 +1300,12 @@ static int write_configuration_record(void *logctx, AVIOContext *pb, const uint8
if (size < 6) {
/* We can't write a valid hvcC from the provided data */
return AVERROR_INVALIDDATA;
- } else if (*data == 1) {
+ } else if (ff_hevc_is_hvcc(data, size)) {
/* Data is already hvcC-formatted. Parse the arrays to skip any NALU
with nuh_layer_id > 0 */
GetBitContext gbc;
int num_arrays;
- if (size < 23)
- return AVERROR_INVALIDDATA;
-
ret = init_get_bits8(&gbc, data, size);
if (ret < 0)
return ret;