1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

mpegts: only emit new packets if data buffer exists

I don't think this can acutally happen in the current code, but better safe
than sorry.

Fixes Coverity CID 732217.

Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Marton Balint 2014-05-02 01:44:19 +02:00
parent a82e87618f
commit 9ba8debce9

View File

@ -1125,8 +1125,6 @@ skip:
} }
memcpy(pes->buffer->data + pes->data_index, p, buf_size); memcpy(pes->buffer->data + pes->data_index, p, buf_size);
pes->data_index += buf_size; pes->data_index += buf_size;
}
buf_size = 0;
/* emit complete packets with known packet size /* emit complete packets with known packet size
* decreases demuxer delay for infrequent packets like subtitles from * decreases demuxer delay for infrequent packets like subtitles from
* a couple of seconds to milliseconds for properly muxed files. * a couple of seconds to milliseconds for properly muxed files.
@ -1137,6 +1135,8 @@ skip:
ts->stop_parse = 1; ts->stop_parse = 1;
new_pes_packet(pes, ts->pkt); new_pes_packet(pes, ts->pkt);
} }
}
buf_size = 0;
break; break;
case MPEGTS_SKIP: case MPEGTS_SKIP:
buf_size = 0; buf_size = 0;