You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/mjpegdec: respect side data preference
This commit is contained in:
committed by
Anton Khirnov
parent
62f40d0e38
commit
ed3cc8fc65
@@ -2840,16 +2840,18 @@ the_end:
|
|||||||
for (i = 0; i < s->iccnum; i++)
|
for (i = 0; i < s->iccnum; i++)
|
||||||
total_size += s->iccentries[i].length;
|
total_size += s->iccentries[i].length;
|
||||||
|
|
||||||
sd = av_frame_new_side_data(frame, AV_FRAME_DATA_ICC_PROFILE, total_size);
|
ret = ff_frame_new_side_data(avctx, frame, AV_FRAME_DATA_ICC_PROFILE, total_size, &sd);
|
||||||
if (!sd) {
|
if (ret < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side data\n");
|
av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side data\n");
|
||||||
return AVERROR(ENOMEM);
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reassemble the parts, which are now in-order. */
|
if (sd) {
|
||||||
for (i = 0; i < s->iccnum; i++) {
|
/* Reassemble the parts, which are now in-order. */
|
||||||
memcpy(sd->data + offset, s->iccentries[i].data, s->iccentries[i].length);
|
for (i = 0; i < s->iccnum; i++) {
|
||||||
offset += s->iccentries[i].length;
|
memcpy(sd->data + offset, s->iccentries[i].data, s->iccentries[i].length);
|
||||||
|
offset += s->iccentries[i].length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user