[FFmpeg-cvslog] nutenc: check for negative index rather than assert

Vittorio Giovara git at videolan.org
Wed Oct 22 00:16:40 CEST 2014


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Mon Oct 20 14:11:20 2014 +0100| [b69183f65d0f6f4cd7a4e6c0deb57d59b0185aba] | committer: Vittorio Giovara

nutenc: check for negative index rather than assert

CC: libav-stable at libav.org
Bug-Id: CID 703721

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b69183f65d0f6f4cd7a4e6c0deb57d59b0185aba
---

 libavformat/nutenc.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index b68e00e..08907ef 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);



More information about the ffmpeg-cvslog mailing list