Commit 12ceaf0f authored by Aman Gupta's avatar Aman Gupta

ffprobe: fix SEGV when new streams are added

Signed-off-by: 's avatarAman Gupta <aman@tmm1.net>
parent a19bac8f
......@@ -2371,11 +2371,11 @@ static int read_interval_packets(WriterContext *w, InputFile *ifile,
goto end;
}
while (!av_read_frame(fmt_ctx, &pkt)) {
if (ifile->nb_streams > nb_streams) {
if (fmt_ctx->nb_streams > nb_streams) {
REALLOCZ_ARRAY_STREAM(nb_streams_frames, nb_streams, fmt_ctx->nb_streams);
REALLOCZ_ARRAY_STREAM(nb_streams_packets, nb_streams, fmt_ctx->nb_streams);
REALLOCZ_ARRAY_STREAM(selected_streams, nb_streams, fmt_ctx->nb_streams);
nb_streams = ifile->nb_streams;
nb_streams = fmt_ctx->nb_streams;
}
if (selected_streams[pkt.stream_index]) {
AVRational tb = ifile->streams[pkt.stream_index].st->time_base;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment