nutenc: check for negative index rather than assert
authorVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 20 Oct 2014 13:11:20 +0000 (14:11 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Tue, 21 Oct 2014 13:37:48 +0000 (14:37 +0100)
CC: libav-stable@libav.org
Bug-Id: CID 703721

libavformat/nutenc.c

index b68e00e..08907ef 100644 (file)
@@ -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);