mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-28 18:32:22 +00: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:
commit
4ba35194a9
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user