diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-03-23 18:17:20 +0300 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-05-11 11:37:17 +0300 |
commit | c954cf1e1b766a0d1992d5be0a8be0055a8e1a6a (patch) | |
tree | 244b9eb3d088011dc6ae1878eb2319a6050826b9 /libavcodec/svq1enc.c | |
parent | a4ce3706595edd9b537861f0e5447e31babf2100 (diff) |
lavc/encode: add an encoder-specific get_buffer() variant
Several encoders (roqvideo, svq1, snow, and the mpegvideo family)
currently call ff_get_buffer(). However this function is written
assuming it is called by a decoder. Though nothing has been obviously
broken by this until now, that may change in the future.
To avoid potential future issues, introduce a simple encode-specific
wrapper around avcodec_default_get_buffer2() and enforce its use in
encoders.
Diffstat (limited to 'libavcodec/svq1enc.c')
-rw-r--r-- | libavcodec/svq1enc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index 3d9452c543..b4e61e4517 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -595,12 +595,12 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt, } if (!s->current_picture->data[0]) { - if ((ret = ff_get_buffer(avctx, s->current_picture, 0)) < 0) { + if ((ret = ff_encode_alloc_frame(avctx, s->current_picture)) < 0) { return ret; } } if (!s->last_picture->data[0]) { - ret = ff_get_buffer(avctx, s->last_picture, 0); + ret = ff_encode_alloc_frame(avctx, s->last_picture); if (ret < 0) return ret; } |