aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/roqvideoenc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-03-23 16:17:20 +0100
committerAnton Khirnov <anton@khirnov.net>2022-05-11 10:37:17 +0200
commitc954cf1e1b766a0d1992d5be0a8be0055a8e1a6a (patch)
tree244b9eb3d088011dc6ae1878eb2319a6050826b9 /libavcodec/roqvideoenc.c
parenta4ce3706595edd9b537861f0e5447e31babf2100 (diff)
downloadffmpeg-c954cf1e1b766a0d1992d5be0a8be0055a8e1a6a.tar.gz
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/roqvideoenc.c')
-rw-r--r--libavcodec/roqvideoenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c
index 8cdc9f389c..c0c67dbed9 100644
--- a/libavcodec/roqvideoenc.c
+++ b/libavcodec/roqvideoenc.c
@@ -1081,8 +1081,8 @@ static int roq_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if (enc->first_frame) {
/* Alloc memory for the reconstruction data (we must know the stride
for that) */
- if ((ret = ff_get_buffer(avctx, roq->current_frame, 0)) < 0 ||
- (ret = ff_get_buffer(avctx, roq->last_frame, 0)) < 0)
+ if ((ret = ff_encode_alloc_frame(avctx, roq->current_frame)) < 0 ||
+ (ret = ff_encode_alloc_frame(avctx, roq->last_frame )) < 0)
return ret;
/* Before the first video frame, write a "video info" chunk */