On 3/23/2021 4:11 PM, Nicolas George wrote:
Nicolas George (12021-03-23):
And it is exactly what we are doing when we let users access fields
directly.

I mean:

        AVStream **streams = ctx->streams;
        av_read_frame(ctx, &packet);
        AVStream *stream = streams[packet.stream_index];

That should work, right?

No, avformat_new_stream() will reallocate that array, so if av_read_frame() can allocate new streams (I think AVFMT_NOHEADER formats do that) then that may just crash.

You should always use ctx->streams directly.


Regards,


_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to