On 7 Jul 2025, at 17:32, Nicolas George wrote:
> Marvin Scholz (HE12025-07-04): >> If copying two strings fails here, it is highly unlikely any of the following >> code, needing much more memory, would have any chance of succeeding. > >> Yes it introducers two copies which could fail but the chance for that >> happening >> is so small that I dont think it justifies using hacks like this, which also >> introduce >> risk of turning into more serious issues when the AVDictionary code is >> changed and someone >> is unaware of this hack here. > > Please tell us: How unlikely do you think it needs to be for us to > dispense with the checks? 1/1000? 1/1E6? > > (Hint: the answer is 0.) I never said not to check for it… > >> We are talking about copying two option strings here, during setup, >> not per frame, not every few seconds. > > You already gave that argument, and I already explained to you that > efficiency was the tiniest of my arguments. But it is still an argument. > >> I disagree making this hack official. > > Well, I disagree making the current code more verbose for hypothetical > reasons. > How is making an APIs return value adhere to its documentation "hypothetical reasons"? It clearly states "The returned entry key or value must not be changed, or it will cause undefined behavior." so it would be quite logical to make its return const to make it harder for someone to shoot themselves in the foot using the API. > Regards, > > -- > Nicolas George > _______________________________________________ > 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".