diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
index c8aa8bf..45f2f85 100644
|
a
|
b
|
typedef struct IpvideoContext {
|
| 68 | 68 | int line_inc; |
| 69 | 69 | int stride; |
| 70 | 70 | int upper_motion_limit_offset; |
| | 71 | int width, height; |
| 71 | 72 | |
| 72 | 73 | uint32_t pal[256]; |
| 73 | 74 | } IpvideoContext; |
| … |
… |
static void ipvideo_decode_opcodes(IpvideoContext *s)
|
| 975 | 976 | s->mv_end = s->buf + s->size; |
| 976 | 977 | } |
| 977 | 978 | s->line_inc = s->stride - 8; |
| 978 | | s->upper_motion_limit_offset = (s->avctx->height - 8) * s->current_frame.linesize[0] |
| 979 | | + (s->avctx->width - 8) * (1 + s->is_16bpp); |
| | 979 | s->upper_motion_limit_offset = (s->height - 8) * s->current_frame.linesize[0] |
| | 980 | + (s->width - 8) * (1 + s->is_16bpp); |
| 980 | 981 | |
| 981 | 982 | init_get_bits(&gb, s->decoding_map, s->decoding_map_size * 8); |
| 982 | | for (y = 0; y < s->avctx->height; y += 8) { |
| 983 | | for (x = 0; x < s->avctx->width; x += 8) { |
| | 983 | for (y = 0; y < s->height; y += 8) { |
| | 984 | for (x = 0; x < s->width; x += 8) { |
| 984 | 985 | opcode = get_bits(&gb, 4); |
| 985 | 986 | |
| 986 | 987 | av_dlog(NULL, " block @ (%3d, %3d): encoding 0x%X, data ptr @ %p\n", |
| … |
… |
static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
|
| 1019 | 1020 | |
| 1020 | 1021 | dsputil_init(&s->dsp, avctx); |
| 1021 | 1022 | |
| | 1023 | s->width = avctx->width; |
| | 1024 | s->height = avctx->height; |
| | 1025 | |
| 1022 | 1026 | /* decoding map contains 4 bits of information per 8x8 block */ |
| 1023 | 1027 | s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2); |
| 1024 | 1028 | |
| … |
… |
static int ipvideo_decode_frame(AVCodecContext *avctx,
|
| 1057 | 1061 | if (!s->is_16bpp) { |
| 1058 | 1062 | const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL); |
| 1059 | 1063 | if (pal) { |
| | 1064 | s->decoding_map_size = s->avctx->width * s->avctx->height / (8 * 8 * 2); |
| | 1065 | s->width = s->avctx->width; |
| | 1066 | s->height = s->avctx->height; |
| 1060 | 1067 | s->current_frame.palette_has_changed = 1; |
| 1061 | 1068 | memcpy(s->pal, pal, AVPALETTE_SIZE); |
| 1062 | 1069 | } |
diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index 562b19a..2fa8cb0 100644
|
a
|
b
|
static int ipmovie_read_packet(AVFormatContext *s,
|
| 601 | 601 | int ret; |
| 602 | 602 | |
| 603 | 603 | ret = process_ipmovie_chunk(ipmovie, pb, pkt); |
| | 604 | s->streams[0]->codec->width = ipmovie->video_width; |
| | 605 | s->streams[0]->codec->height = ipmovie->video_height; |
| | 606 | // s->streams[0]->codec->bits_per_coded_sample = ipmovie->video_bpp; |
| 604 | 607 | if (ret == CHUNK_BAD) |
| 605 | 608 | ret = AVERROR_INVALIDDATA; |
| 606 | 609 | else if (ret == CHUNK_EOF) |