summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2016-11-21 18:54:29 -0500
committerVittorio Giovara <vittorio.giovara@gmail.com>2016-11-23 10:37:36 -0500
commit1893495e1d023365b4aa24e5e1bd1b24ad5d34fd (patch)
treec5b2549667ead7e2d0a4c0927ad023aeb1a1111b /libavformat
parent79ff9935ae4ae90a4dd485bd9a3a440281d866b2 (diff)
mov: Use av_stream_add_side_data() for displaymatrix side data
Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index df29f2a605..28adce76c3 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3545,20 +3545,12 @@ static int mov_read_header(AVFormatContext *s)
break;
case AVMEDIA_TYPE_VIDEO:
if (sc->display_matrix) {
- AVPacketSideData *sd, *tmp;
-
- tmp = av_realloc_array(st->side_data,
- st->nb_side_data + 1, sizeof(*tmp));
- if (!tmp)
- return AVERROR(ENOMEM);
-
- st->side_data = tmp;
- st->nb_side_data++;
+ err = av_stream_add_side_data(st, AV_PKT_DATA_DISPLAYMATRIX,
+ (uint8_t *)sc->display_matrix,
+ sizeof(int32_t) * 9);
+ if (err < 0)
+ return err;
- sd = &st->side_data[st->nb_side_data - 1];
- sd->type = AV_PKT_DATA_DISPLAYMATRIX;
- sd->size = sizeof(int32_t) * 9;
- sd->data = (uint8_t*)sc->display_matrix;
sc->display_matrix = NULL;
}
break;