aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/framecrcenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-30 11:44:13 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-30 13:35:14 +0200
commit147a45fca4d8c918714b550048786a9d27e40e43 (patch)
treece6d96b490c0166b4aed8c8681f988e29b933132 /libavformat/framecrcenc.c
parenta0adeb1f9f9bd28138edda4929753e8ea0aa7da0 (diff)
downloadffmpeg-147a45fca4d8c918714b550048786a9d27e40e43.tar.gz
framecrcenc: workaround design flaw in sidedata palette
This should be reverted once palettes are dealt with in a endian independant way in packets Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/framecrcenc.c')
-rw-r--r--libavformat/framecrcenc.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/libavformat/framecrcenc.c b/libavformat/framecrcenc.c
index f63113b06e..dbe49b5ba1 100644
--- a/libavformat/framecrcenc.c
+++ b/libavformat/framecrcenc.c
@@ -34,13 +34,22 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
if (pkt->flags != AV_PKT_FLAG_KEY)
av_strlcatf(buf, sizeof(buf), ", F=0x%0X", pkt->flags);
if (pkt->side_data_elems) {
- int i;
+ int i, j;
av_strlcatf(buf, sizeof(buf), ", S=%d", pkt->side_data_elems);
for (i=0; i<pkt->side_data_elems; i++) {
- uint32_t side_data_crc = av_adler32_update(0,
- pkt->side_data[i].data,
- pkt->side_data[i].size);
+ uint32_t side_data_crc = 0;
+ if (HAVE_BIGENDIAN && AV_PKT_DATA_PALETTE == pkt->side_data[i].type) {
+ for (j=0; j<pkt->side_data[i].size; j++) {
+ side_data_crc = av_adler32_update(side_data_crc,
+ pkt->side_data[i].data + (j^3),
+ 1);
+ }
+ } else {
+ side_data_crc = av_adler32_update(0,
+ pkt->side_data[i].data,
+ pkt->side_data[i].size);
+ }
av_strlcatf(buf, sizeof(buf), ", %8d, 0x%08x", pkt->side_data[i].size, side_data_crc);
}
}