Commit 891263ef authored by Baptiste Coudurier's avatar Baptiste Coudurier

Fix svq3 watermark log uncompress on 64bit, probably fixes issue 1263

Originally committed as revision 23620 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 0ade7bb6
...@@ -886,7 +886,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx) ...@@ -886,7 +886,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
int u2 = get_bits(&gb, 8); int u2 = get_bits(&gb, 8);
int u3 = get_bits(&gb, 2); int u3 = get_bits(&gb, 2);
int u4 = svq3_get_ue_golomb(&gb); int u4 = svq3_get_ue_golomb(&gb);
unsigned buf_len = watermark_width*watermark_height*4; unsigned long buf_len = watermark_width*watermark_height*4;
int offset = (get_bits_count(&gb)+7)>>3; int offset = (get_bits_count(&gb)+7)>>3;
uint8_t *buf; uint8_t *buf;
...@@ -896,7 +896,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx) ...@@ -896,7 +896,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
buf = av_malloc(buf_len); buf = av_malloc(buf_len);
av_log(avctx, AV_LOG_DEBUG, "watermark size: %dx%d\n", watermark_width, watermark_height); av_log(avctx, AV_LOG_DEBUG, "watermark size: %dx%d\n", watermark_width, watermark_height);
av_log(avctx, AV_LOG_DEBUG, "u1: %x u2: %x u3: %x compressed data size: %d offset: %d\n", u1, u2, u3, u4, offset); av_log(avctx, AV_LOG_DEBUG, "u1: %x u2: %x u3: %x compressed data size: %d offset: %d\n", u1, u2, u3, u4, offset);
if (uncompress(buf, (uLong*)&buf_len, extradata + 8 + offset, size - offset) != Z_OK) { if (uncompress(buf, &buf_len, extradata + 8 + offset, size - offset) != Z_OK) {
av_log(avctx, AV_LOG_ERROR, "could not uncompress watermark logo\n"); av_log(avctx, AV_LOG_ERROR, "could not uncompress watermark logo\n");
av_free(buf); av_free(buf);
return -1; return -1;
......
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