avcodec/mjpegdec: respect side data preference

release/7.0
Niklas Haas 9 months ago committed by Anton Khirnov
parent 62f40d0e38
commit ed3cc8fc65
  1. 8
      libavcodec/mjpegdec.c

@ -2840,18 +2840,20 @@ the_end:
for (i = 0; i < s->iccnum; i++)
total_size += s->iccentries[i].length;
sd = av_frame_new_side_data(frame, AV_FRAME_DATA_ICC_PROFILE, total_size);
if (!sd) {
ret = ff_frame_new_side_data(avctx, frame, AV_FRAME_DATA_ICC_PROFILE, total_size, &sd);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side data\n");
return AVERROR(ENOMEM);
return ret;
}
if (sd) {
/* Reassemble the parts, which are now in-order. */
for (i = 0; i < s->iccnum; i++) {
memcpy(sd->data + offset, s->iccentries[i].data, s->iccentries[i].length);
offset += s->iccentries[i].length;
}
}
}
if (e = av_dict_get(s->exif_metadata, "Orientation", e, AV_DICT_IGNORE_SUFFIX)) {
char *value = e->value + strspn(e->value, " \n\t\r"), *endptr;

Loading…
Cancel
Save