]> git.sesse.net Git - ffmpeg/commit
avcodec/avcodec, avpacket: Return blank packet on av_packet_ref() failure
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 27 Mar 2020 00:56:38 +0000 (01:56 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 28 Mar 2020 02:59:15 +0000 (03:59 +0100)
commitc52ec0367de10f86ceb5a06d25c0f948a5897740
treed4ec69264f36cd064583c976fc4b047ee5116de2
parente621f2b6cd95a69db637d0ed979cf9e614b58cac
avcodec/avcodec, avpacket: Return blank packet on av_packet_ref() failure

Up until now, it was completely unspecified what the content of the
destination packet dst was on error. Depending upon where the error
happened calling av_packet_unref() on dst might be dangerous.

This commit changes this by making sure that dst is blank on error, so
unreferencing it again is safe (and still pointless). This behaviour is
documented.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
doc/APIchanges
libavcodec/avcodec.h
libavcodec/avpacket.c
libavcodec/version.h