lavf/nutenc: provide meaningful error message and error code in case of invalid pts
authorStefano Sabatini <stefasab@gmail.com>
Sun, 8 Jul 2012 11:43:47 +0000 (13:43 +0200)
committerStefano Sabatini <stefasab@gmail.com>
Sun, 8 Jul 2012 15:08:56 +0000 (17:08 +0200)
libavformat/nutenc.c

index bd10b29..fd7768a 100644 (file)
@@ -704,8 +704,10 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt){
     int store_sp=0;
     int ret;
 
-    if(pkt->pts < 0)
-        return -1;
+    if (pkt->pts < 0) {
+        av_log(s, AV_LOG_ERROR, "Invalid negative packet pts %"PRId64" in input\n", pkt->pts);
+        return AVERROR(EINVAL);
+    }
 
     if(1LL<<(20+3*nut->header_count) <= avio_tell(bc))
         write_headers(s, bc);