ensure pes buffer is set to avoid segv
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sun, 13 Sep 2009 20:08:47 +0000 (20:08 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sun, 13 Sep 2009 20:08:47 +0000 (20:08 +0000)
Originally committed as revision 19836 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/mpegts.c

index 90510de..92a29a3 100644 (file)
@@ -1027,7 +1027,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
             }
             break;
         case MPEGTS_PAYLOAD:
-            if (buf_size > 0) {
+            if (buf_size > 0 && pes->buffer) {
                 if (pes->data_index+buf_size > pes->total_size) {
                     new_pes_packet(pes, ts->pkt);
                     pes->total_size = MAX_PES_PAYLOAD;