Mercurial > libavformat.hg
changeset 300:6ee1b02f9b2a libavformat
* fixes for broken builds on Solaris, OS2 and all bingendian
systems out there.
author | romansh |
---|---|
date | Tue, 04 Nov 2003 19:35:43 +0000 |
parents | 5ee1aa8cc0ea |
children | 4513d5ab9eb5 |
files | asf.c avidec.c |
diffstat | 2 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/asf.c Tue Nov 04 12:55:26 2003 +0000 +++ b/asf.c Tue Nov 04 19:35:43 2003 +0000 @@ -915,8 +915,8 @@ if (st->codec.extradata_size && (st->codec.bits_per_sample <= 8)) { st->codec.palctrl = av_mallocz(sizeof(AVPaletteControl)); #ifdef WORDS_BIGENDIAN - for (i = 0; i < FFMIN(st->codec.extradata_size / 4, 256); i++) - st->codec.palctrl->palette[i] = bswap_32(st->codec.extradata)[i * 4]); + for (i = 0; i < FFMIN(st->codec.extradata_size, AVPALETTE_SIZE)/4; i++) + st->codec.palctrl->palette[i] = bswap_32(((uint32_t*)st->codec.extradata)[i]); #else memcpy(st->codec.palctrl->palette, st->codec.extradata, FFMIN(st->codec.extradata_size, AVPALETTE_SIZE));
--- a/avidec.c Tue Nov 04 12:55:26 2003 +0000 +++ b/avidec.c Tue Nov 04 19:35:43 2003 +0000 @@ -249,8 +249,8 @@ if (st->codec.extradata_size && (st->codec.bits_per_sample <= 8)) { st->codec.palctrl = av_mallocz(sizeof(AVPaletteControl)); #ifdef WORDS_BIGENDIAN - for (i = 0; i < FFMIN(st->codec.extradata_size / 4, 256); i++) - st->codec.palctrl->palette[i] = bswap_32(st->codec.extradata)[i * 4]); + for (i = 0; i < FFMIN(st->codec.extradata_size, AVPALETTE_SIZE)/4; i++) + st->codec.palctrl->palette[i] = bswap_32(((uint32_t*)st->codec.extradata)[i]); #else memcpy(st->codec.palctrl->palette, st->codec.extradata, FFMIN(st->codec.extradata_size, AVPALETTE_SIZE));