You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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>
This commit is contained in:
@@ -555,9 +555,7 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
ret = av_read_frame(cat->avf, pkt);
|
ret = av_read_frame(cat->avf, pkt);
|
||||||
if (ret == AVERROR_EOF || packet_after_outpoint(cat, pkt)) {
|
if (ret == AVERROR_EOF) {
|
||||||
if (ret == 0)
|
|
||||||
av_packet_unref(pkt);
|
|
||||||
if ((ret = open_next_file(avf)) < 0)
|
if ((ret = open_next_file(avf)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
continue;
|
continue;
|
||||||
@@ -568,6 +566,12 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
|
|||||||
av_packet_unref(pkt);
|
av_packet_unref(pkt);
|
||||||
return ret;
|
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];
|
cs = &cat->cur_file->streams[pkt->stream_index];
|
||||||
if (cs->out_stream_index < 0) {
|
if (cs->out_stream_index < 0) {
|
||||||
av_packet_unref(pkt);
|
av_packet_unref(pkt);
|
||||||
|
Reference in New Issue
Block a user