Jonathan Baudanza: > On Wed, Dec 30, 2020, at 10:34 AM, James Almer wrote: > >> Nothing should have done it at that point. The demuxer allocates the >> AVStream after all. But to be sure you can do >> av_freep(&st->codecpar->extradata) to ensure it's NULL before anything >> else is done. > > Thanks James. > > I've updated the patch to include av_freep. If there's no other feedback, I > think this is ready to go. >
It would be better if you used ff_alloc_extradata(): It also already frees the extradata that might be present. And it does only set the extradata_size after the allocation succeeded. But it is of course even better if you actually errored out in case of allocation failure. Furthermore, your patch will lead to "declaration after statement" (or something like that) warnings, because FFmpeg only allows variable declarations at the beginning of each block (this is a remnant from C90). - Andreas _______________________________________________ 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".