1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

Merge commit 'f935aca44c674d30e3ed940ef73bbad1228a5855'

* commit 'f935aca44c674d30e3ed940ef73bbad1228a5855':
  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: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2013-02-24 12:22:51 +01:00
2 changed files with 8 additions and 3 deletions

View File

@@ -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); prestream = read_huffman_tables(f, prestream, buf + length - prestream);
if (!prestream) if (!prestream) {
return -1; av_log(f->avctx, AV_LOG_ERROR, "Error reading Huffman tables.\n");
return AVERROR_INVALIDDATA;
}
av_assert0(prestream <= buf + length); av_assert0(prestream <= buf + length);

View File

@@ -323,7 +323,10 @@ static void fill32(uint8_t *dst, int len)
void av_memcpy_backptr(uint8_t *dst, int back, int cnt) void av_memcpy_backptr(uint8_t *dst, int back, int cnt)
{ {
const uint8_t *src = &dst[-back]; const uint8_t *src = &dst[-back];
if (back <= 1) { if (!back)
return;
if (back == 1) {
memset(dst, *src, cnt); memset(dst, *src, cnt);
} else if (back == 2) { } else if (back == 2) {
fill16(dst, cnt); fill16(dst, cnt);