History

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

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

James Almer committed 1 year ago

Commit e0a971a1 parent 7cc24ce1 file · +6 −6Browse files

Unified · Split

libavcodec/mjpegdec.c+6−6
@@ -2875,15 +2875,15 @@ the_end: · 2874 unmodified lines
28752875 AVFrameSideData *sd = NULL;
28762876
28772877 if (orientation >= 2 && orientation <= 8) {
2878− int32_t *matrix;
2879−
2880− sd = av_frame_new_side_data(frame, AV_FRAME_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9);
2881− if (!sd) {
2878+ ret = ff_frame_new_side_data(avctx, frame, AV_FRAME_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9, &sd);
2879+ if (ret < 0) {
28822880 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side data\n");
2883− return AVERROR(ENOMEM);
2881+ return ret;
28842882 }
2883+ }
28852884
2886− matrix = (int32_t *)sd->data;
2885+ if (sd) {
2886+ int32_t *matrix = (int32_t *)sd->data;
28872887
28882888 switch (orientation) {
28892889 case 2:

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