Commit 4ba35194 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'f935aca4'

* commit 'f935aca4':
  av_memcpy_backptr: avoid an infinite loop for back = 0
  4xm: check the return value of read_huffman_tables().

Conflicts:
	libavcodec/4xm.c
	libavutil/mem.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents ccc7bcc4 f935aca4
......@@ -757,8 +757,10 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
}
prestream = read_huffman_tables(f, prestream, buf + length - prestream);
if (!prestream)
return -1;
if (!prestream) {
av_log(f->avctx, AV_LOG_ERROR, "Error reading Huffman tables.\n");
return AVERROR_INVALIDDATA;
}
av_assert0(prestream <= buf + length);
......
......@@ -323,7 +323,10 @@ static void fill32(uint8_t *dst, int len)
void av_memcpy_backptr(uint8_t *dst, int back, int cnt)
{
const uint8_t *src = &dst[-back];
if (back <= 1) {
if (!back)
return;
if (back == 1) {
memset(dst, *src, cnt);
} else if (back == 2) {
fill16(dst, cnt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment