diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index b68e00ebbc..08907ef489 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -906,7 +906,10 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt) frame_code = i; } } - assert(frame_code != -1); + + if (frame_code < 0) + return AVERROR_BUG; + fc = &nut->frame_code[frame_code]; flags = fc->flags; needed_flags = get_needed_flags(nut, nus, fc, pkt);