History

avcodec/mjpegdec: respect side data preference

Niklas Haas committed 2 years ago

Commit ed3cc8f1 parent 62f40d01 file · +9 −7Browse files

Unified · Split

libavcodec/mjpegdec.c+9−7
@@ -2840,16 +2840,18 @@ the_end: · 2839 unmodified lines
2840 for (i = 0; i < s->iccnum; i++)2840 for (i = 0; i < s->iccnum; i++)
2841 total_size += s->iccentries[i].length;2841 total_size += s->iccentries[i].length;
2842 2842
2843 sd = av_frame_new_side_data(frame, AV_FRAME_DATA_ICC_PROFILE, total_size);2843 ret = ff_frame_new_side_data(avctx, frame, AV_FRAME_DATA_ICC_PROFILE, total_size, &sd);
2844 if (!sd) {2844 if (ret < 0) {
2845 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side data\n");2845 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side data\n");
2846 return AVERROR(ENOMEM);2846 return ret;
2847 }2847 }
2848 2848
2849 /* Reassemble the parts, which are now in-order. */2849 if (sd) {
2850 for (i = 0; i < s->iccnum; i++) {2850 /* Reassemble the parts, which are now in-order. */
2851 memcpy(sd->data + offset, s->iccentries[i].data, s->iccentries[i].length);2851 for (i = 0; i < s->iccnum; i++) {
2852 offset += s->iccentries[i].length;2852 memcpy(sd->data + offset, s->iccentries[i].data, s->iccentries[i].length);
2853 offset += s->iccentries[i].length;
2854 }
2853 }2855 }
2854 }2856 }
2855 2857

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t