diff options
author | Vittorio Giovara | 2015-12-02 19:10:02 -0500 |
---|---|---|
committer | Vittorio Giovara | 2015-12-07 11:27:42 -0500 |
commit | c34df422628e6b7b657faee241fe7bb2629e0f57 (patch) | |
tree | aa04e33e785e1513661f14ee902b10fc9c016cd9 | |
parent | 16216b713f9a21865cc07993961cf5d0ece24916 (diff) |
sgienc: Make sure to initialize skipped header portions
Fix fate tests with asan. Introduced during bytestream2 porting
(in revision 62cc8f4d79dad119e8efeaae080a58a8dcb1e89d).
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
-rw-r--r-- | libavcodec/sgienc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/sgienc.c b/libavcodec/sgienc.c index 763de48123..07e224cb35 100644 --- a/libavcodec/sgienc.c +++ b/libavcodec/sgienc.c @@ -95,7 +95,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame * const p = frame; PutByteContext pbc; uint8_t *in_buf, *encode_buf; - int x, y, z, length, tablesize, ret; + int x, y, z, length, tablesize, ret, i; unsigned int width, height, depth, dimension; unsigned int bytes_per_channel, pixmax, put_be; @@ -188,13 +188,15 @@ FF_ENABLE_DEPRECATION_WARNINGS bytestream2_put_be32(&pbc, 0L); /* dummy */ /* name */ - bytestream2_skip_p(&pbc, 80); + for (i = 0; i < 80; i++) + bytestream2_put_byte(&pbc, 0L); /* colormap */ bytestream2_put_be32(&pbc, 0L); /* The rest of the 512 byte header is unused. */ - bytestream2_skip_p(&pbc, 404); + for (i = 0; i < 404; i++) + bytestream2_put_byte(&pbc, 0L); if (s->rle) { PutByteContext taboff_pcb, tablen_pcb; |