[FFmpeg-devel] [PATCH] avformat/mxfenc: Ensure keyframe offset in valid range
Tomas Härdin
git at haerdin.se
Tue Jul 22 14:43:09 EEST 2025
ons 2025-07-16 klockan 11:57 +0800 skrev Zhao Zhili:
> From: Zhao Zhili <zhilizhao at tencent.com>
>
> Fix assert failure.
> Fix #11666.
Saw this ticket, but I was busy with other things and forgot about it
> @@ -2100,9 +2111,17 @@ static void
> mxf_write_index_table_segment(AVFormatContext *s)
> avio_w8(pb, temporal_offset);
Maybe check TemporalOffset while we're at it? Though it probably can't
be outside the permissible range if KeyFrameOffset isn't
> if ((mxf->index_entries[i].flags & 0x30) == 0x30) { //
> back and forward prediction
> + int offset = mxf->last_key_index - i;
> + err = mxf_check_keyframe_offset(s, offset);
> + if (err < 0)
> + return err;
> sc->b_picture_count = FFMAX(sc->b_picture_count, i -
> prev_non_b_picture);
> - avio_w8(pb, mxf->last_key_index - i);
> + avio_w8(pb, offset);
> } else {
> + int offset = key_index - i;
> + err = mxf_check_keyframe_offset(s, offset);
> + if (err < 0)
> + return err;
> avio_w8(pb, key_index - i); // key frame offset
Why not avio_w8(offset) here also?
/Tomas
More information about the ffmpeg-devel
mailing list