diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-04-20 05:19:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-20 05:19:46 +0200 |
commit | fcca7671e29b67812d29af710ff90486944ee428 (patch) | |
tree | 8b67f16bdcbb9f1d2de5c35a527271c36ad2a25f /libavcodec/hqx.c | |
parent | f1db984288f21a1ecdff0b5702630456c089ce36 (diff) | |
parent | e6fb844f7b736e72da364032d251283bce9e63ad (diff) | |
download | ffmpeg-fcca7671e29b67812d29af710ff90486944ee428.tar.gz |
Merge commit 'e6fb844f7b736e72da364032d251283bce9e63ad'
* commit 'e6fb844f7b736e72da364032d251283bce9e63ad':
Implement shared parsing of INFO tag in Canopus family
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hqx.c')
-rw-r--r-- | libavcodec/hqx.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c index e6fb2fc6fb..9d3b1150d0 100644 --- a/libavcodec/hqx.c +++ b/libavcodec/hqx.c @@ -24,6 +24,7 @@ #include "libavutil/intreadwrite.h" #include "avcodec.h" +#include "canopus.h" #include "get_bits.h" #include "internal.h" @@ -405,29 +406,28 @@ static int hqx_decode_frame(AVCodecContext *avctx, void *data, { HQXContext *ctx = avctx->priv_data; uint8_t *src = avpkt->data; - uint32_t info_tag, info_offset; + uint32_t info_tag; int data_start; int i, ret; - if (avpkt->size < 8) + if (avpkt->size < 4 + 4) { + av_log(avctx, AV_LOG_ERROR, "Frame is too small %d.\n", avpkt->size); return AVERROR_INVALIDDATA; + } - /* Skip the INFO header if present */ - info_offset = 0; info_tag = AV_RL32(src); if (info_tag == MKTAG('I', 'N', 'F', 'O')) { - info_offset = AV_RL32(src + 4); + int info_offset = AV_RL32(src + 4); if (info_offset > UINT32_MAX - 8 || info_offset + 8 > avpkt->size) { av_log(avctx, AV_LOG_ERROR, "Invalid INFO header offset: 0x%08"PRIX32" is too large.\n", info_offset); return AVERROR_INVALIDDATA; } + ff_canopus_parse_info_tag(avctx, src + 8, info_offset); info_offset += 8; src += info_offset; - - av_log(avctx, AV_LOG_DEBUG, "Skipping INFO chunk.\n"); } data_start = src - avpkt->data; |