--- a/libavformat/mpegenc.c	2025-05-11 15:05:24.437490237 -0600
+++ b/libavformat/mpegenc.c	2025-05-11 14:46:46.661934073 -0600
@@ -989,9 +989,9 @@
         PacketDesc *pkt_desc;
 
         while ((pkt_desc = stream->predecode_packet) &&
+               pkt_desc != stream->premux_packet &&
                scr > pkt_desc->dts) { // FIXME: > vs >=
-            if (stream->buffer_index < pkt_desc->size ||
-                stream->predecode_packet == stream->premux_packet) {
+            if (stream->buffer_index < pkt_desc->size) {
                 av_log(ctx, AV_LOG_ERROR,
                        "buffer underflow st=%d bufi=%d size=%d\n",
                        i, stream->buffer_index, pkt_desc->size);
