avcodec/mjpegdec: use ff_frame_new_side_data() to export display matrix

Otherwise, the user requested priority of packet side data will be ignored.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2025-09-10 09:31:48 -03:00
parent 7cc24cee16
commit e0a971a8fa

View File

@@ -2875,15 +2875,15 @@ the_end:
AVFrameSideData *sd = NULL;
if (orientation >= 2 && orientation <= 8) {
int32_t *matrix;
sd = av_frame_new_side_data(frame, AV_FRAME_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9);
if (!sd) {
ret = ff_frame_new_side_data(avctx, frame, AV_FRAME_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9, &sd);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side data\n");
return AVERROR(ENOMEM);
return ret;
}
}
matrix = (int32_t *)sd->data;
if (sd) {
int32_t *matrix = (int32_t *)sd->data;
switch (orientation) {
case 2: