summaryrefslogtreecommitdiff
path: root/libavcodec/avcodec.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-03-27 01:56:38 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-03-28 03:59:15 +0100
commitc52ec0367de10f86ceb5a06d25c0f948a5897740 (patch)
treed4ec69264f36cd064583c976fc4b047ee5116de2 /libavcodec/avcodec.h
parente621f2b6cd95a69db637d0ed979cf9e614b58cac (diff)
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>
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r--libavcodec/avcodec.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index f918d20a61..8fc0ad92c9 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -4651,7 +4651,8 @@ void av_packet_free_side_data(AVPacket *pkt);
* @param dst Destination packet. Will be completely overwritten.
* @param src Source packet
*
- * @return 0 on success, a negative AVERROR on error.
+ * @return 0 on success, a negative AVERROR on error. On error, dst
+ * will be blank (as if returned by av_packet_alloc()).
*/
int av_packet_ref(AVPacket *dst, const AVPacket *src);