Replace invocations of av_fifo_realloc(), which is going to be
[ffmpeg.git] / libavformat / mpegenc.c
index a67eeee80c89f39d97b884a60ad2703063c60896..a72f1998937be5fe7c6df0a6e2d27f744b789b0e 100644 (file)
@@ -1170,7 +1170,8 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
         stream->predecode_packet= pkt_desc;
     stream->next_packet= &pkt_desc->next;
 
-    av_fifo_realloc(&stream->fifo, av_fifo_size(&stream->fifo) + size);
+    if (av_fifo_realloc2(&stream->fifo, av_fifo_size(&stream->fifo) + size) < 0)
+        return -1;
 
     if (s->is_dvd){
         if (is_iframe && (s->packet_number == 0 || (pts - stream->vobu_start_pts >= 36000))) { // min VOBU length 0.4 seconds (mpucoder)