diff options
author | Paul B Mahol <onemda@gmail.com> | 2018-12-06 22:19:48 +0300 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2018-12-07 21:44:57 +0300 |
commit | abb0306bf301f82e1f18a3a70c04261fb0daa1e8 (patch) | |
tree | bbbd43432d12db4296324c652d9fa5322a9ebd4c /libavcodec/dpx.c | |
parent | 0f8383005c97766e94440c20f63564d66730e0e6 (diff) |
avcodec/dpx: parse image creator
Diffstat (limited to 'libavcodec/dpx.c')
-rw-r--r-- | libavcodec/dpx.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index 0297287938..bc1115b6ba 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/avstring.h" #include "libavutil/intreadwrite.h" #include "libavutil/intfloat.h" #include "libavutil/imgutils.h" @@ -107,6 +108,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *const p = data; uint8_t *ptr[AV_NUM_DATA_POINTERS]; uint32_t header_version, version = 0; + char creator[101]; unsigned int offset; int magic_num, endian; @@ -360,6 +362,10 @@ static int decode_frame(AVCodecContext *avctx, if ((ret = ff_get_buffer(avctx, p, 0)) < 0) return ret; + av_strlcpy(creator, avpkt->data + 160, 100); + creator[100] = '\0'; + av_dict_set(&p->metadata, "Creator", creator, 0); + // Move pointer to offset from start of file buf = avpkt->data + offset; |