ffv1enc: write f->flt to extradata

The parser has been reading f->flt for combined_version >= 0x40004
since commit c1b330bf24 (avcodec/ffv1: Basic float16 support), but
ff_ffv1_write_extradata() never had a matching put_symbol().
The result was that the parsed f->flt was whatever the next symbol's
worth of rangecoded bits happened to decode to — often 0, but for a
yuv420p16le -level 4 -strict experimental stream produced locally it
parses as 1.  The software decoder doesn't notice because the YUV
pixfmt-selection branches never check f->flt, but anything else that
trusts it gets garbage.

Sponsored-by: Sovereign Tech Fund
This commit is contained in:
Lynne
2026-05-31 20:04:02 +09:00
parent 0678077143
commit 49a77d37be
+2
View File
@@ -506,6 +506,8 @@ av_cold int ff_ffv1_write_extradata(AVCodecContext *avctx)
if (f->version > 2) {
put_symbol(&c, state, f->ec, 0);
put_symbol(&c, state, f->intra = (f->avctx->gop_size < 2), 0);
if (f->combined_version >= 0x40004)
put_symbol(&c, state, f->flt, 0);
}
f->avctx->extradata_size = ff_rac_terminate(&c, 0);