[FFmpeg-cvslog] lavf/nutenc: provide meaningful error message and error code in case of invalid pts

Stefano Sabatini git at videolan.org
Sun Jul 8 17:10:06 CEST 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Sun Jul  8 13:43:47 2012 +0200| [b010d9b58651379883b42e58494aaefbab4df648] | committer: Stefano Sabatini

lavf/nutenc: provide meaningful error message and error code in case of invalid pts

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

 libavformat/nutenc.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index bd10b29..fd7768a 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -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);



More information about the ffmpeg-cvslog mailing list