summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2024-02-19 12:52:48 +0100
committerAnton Khirnov <anton@khirnov.net>2024-03-04 14:03:17 +0100
commit6bfe3de6012af8718cbe8788a2ee8b58f4be0790 (patch)
tree49ba7979cdf69b6bad2f4e6845b8c1c47fa52987
parenta06218869a51a19ce03b8e9b9b73bfbace921f3d (diff)
avcodec/snowdec: use ff_frame_new_side_data
For consistency, even though this cannot be overriden at the packet level.
-rw-r--r--libavcodec/snowdec.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index 70fbab9a49..97aea748b6 100644
--- a/libavcodec/snowdec.c
+++ b/libavcodec/snowdec.c
@@ -787,11 +787,10 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
res = av_frame_ref(picture, s->mconly_picture);
if (res >= 0 && s->avmv_index) {
AVFrameSideData *sd;
-
- sd = av_frame_new_side_data(picture, AV_FRAME_DATA_MOTION_VECTORS, s->avmv_index * sizeof(AVMotionVector));
- if (!sd)
- return AVERROR(ENOMEM);
- memcpy(sd->data, s->avmv, s->avmv_index * sizeof(AVMotionVector));
+ res = ff_frame_new_side_data(s->avctx, picture, AV_FRAME_DATA_MOTION_VECTORS,
+ s->avmv_index * sizeof(AVMotionVector), &sd);
+ if (sd)
+ memcpy(sd->data, s->avmv, s->avmv_index * sizeof(AVMotionVector));
}
if (res < 0)