Mercurial > libavformat.hg
comparison mpegts.c @ 5175:1dbe578de8e6 libavformat
ensure pes buffer is set to avoid segv
author | bcoudurier |
---|---|
date | Sun, 13 Sep 2009 20:08:47 +0000 |
parents | 664c0b8ae082 |
children | a2289abc9e23 |
comparison
equal
deleted
inserted
replaced
5174:664c0b8ae082 | 5175:1dbe578de8e6 |
---|---|
1025 pes->state = MPEGTS_PAYLOAD; | 1025 pes->state = MPEGTS_PAYLOAD; |
1026 pes->data_index = 0; | 1026 pes->data_index = 0; |
1027 } | 1027 } |
1028 break; | 1028 break; |
1029 case MPEGTS_PAYLOAD: | 1029 case MPEGTS_PAYLOAD: |
1030 if (buf_size > 0) { | 1030 if (buf_size > 0 && pes->buffer) { |
1031 if (pes->data_index+buf_size > pes->total_size) { | 1031 if (pes->data_index+buf_size > pes->total_size) { |
1032 new_pes_packet(pes, ts->pkt); | 1032 new_pes_packet(pes, ts->pkt); |
1033 pes->total_size = MAX_PES_PAYLOAD; | 1033 pes->total_size = MAX_PES_PAYLOAD; |
1034 pes->buffer = av_malloc(pes->total_size+FF_INPUT_BUFFER_PADDING_SIZE); | 1034 pes->buffer = av_malloc(pes->total_size+FF_INPUT_BUFFER_PADDING_SIZE); |
1035 if (!pes->buffer) | 1035 if (!pes->buffer) |