summaryrefslogtreecommitdiff
path: root/libavcodec/hq_hqa.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-07-10 15:52:00 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-07-17 01:49:42 +0100
commit0cf5588d69922aa3e063bac6304c09c543a9ef52 (patch)
treebe249ed12ebcd94e3e54465a89b2035a1f4abc1c /libavcodec/hq_hqa.c
parenta53540840d26beb57a5e53b7f488c23ddf86e193 (diff)
hq_hqa: Fix decoding when INFO section is absent
Diffstat (limited to 'libavcodec/hq_hqa.c')
-rw-r--r--libavcodec/hq_hqa.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/hq_hqa.c b/libavcodec/hq_hqa.c
index ae378e6524..4871c59c83 100644
--- a/libavcodec/hq_hqa.c
+++ b/libavcodec/hq_hqa.c
@@ -310,9 +310,11 @@ static int hq_hqa_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
- info_tag = bytestream2_get_le32(&ctx->gbc);
+ info_tag = bytestream2_peek_le32(&ctx->gbc);
if (info_tag == MKTAG('I', 'N', 'F', 'O')) {
- int info_size = bytestream2_get_le32(&ctx->gbc);
+ int info_size;
+ bytestream2_skip(&ctx->gbc, 4);
+ info_size = bytestream2_get_le32(&ctx->gbc);
if (bytestream2_get_bytes_left(&ctx->gbc) < info_size) {
av_log(avctx, AV_LOG_ERROR, "Invalid INFO size (%d).\n", info_size);
return AVERROR_INVALIDDATA;