Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2015-11-28 15:05:30 +0300
committerMarton Balint <cus@passwd.hu>2016-01-10 16:13:16 +0300
commitfdb2d4b1084c92aa9bb1d2f948abdb86a361f219 (patch)
tree43d5ae67dd614e1a1747315aa92825195848b8b8 /libavformat
parenta43deea8614a901aae85d175b6580183aede20f9 (diff)
lavf/concatdec: do not access packet if av_read_frame returned error
Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/concatdec.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index d21805fe71..d226e1504e 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -555,9 +555,7 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
while (1) {
ret = av_read_frame(cat->avf, pkt);
- if (ret == AVERROR_EOF || packet_after_outpoint(cat, pkt)) {
- if (ret == 0)
- av_packet_unref(pkt);
+ if (ret == AVERROR_EOF) {
if ((ret = open_next_file(avf)) < 0)
return ret;
continue;
@@ -568,6 +566,12 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
av_packet_unref(pkt);
return ret;
}
+ if (packet_after_outpoint(cat, pkt)) {
+ av_packet_unref(pkt);
+ if ((ret = open_next_file(avf)) < 0)
+ return ret;
+ continue;
+ }
cs = &cat->cur_file->streams[pkt->stream_index];
if (cs->out_stream_index < 0) {
av_packet_unref(pkt);