Revision 57d63d43 libavformat/jvdec.c

View differences:

libavformat/jvdec.c
28 28
#include "libavutil/intreadwrite.h"
29 29
#include "avformat.h"
30 30

  
31
#define JV_PREAMBLE_SIZE 5
32

  
31 33
typedef struct {
32 34
    int audio_size;    /** audio packet size (bytes) */
33 35
    int video_size;    /** video packet size (bytes) */
......
154 156
            jv->state++;
155 157
            if (jvf->video_size || jvf->palette_size) {
156 158
                int size = jvf->video_size + jvf->palette_size;
157
                if (av_new_packet(pkt, size + 5))
159
                if (av_new_packet(pkt, size + JV_PREAMBLE_SIZE))
158 160
                    return AVERROR(ENOMEM);
159 161

  
160 162
                AV_WL32(pkt->data, jvf->video_size);
161 163
                pkt->data[4]      = jvf->video_type;
162
                if (avio_read(pb, pkt->data + 5, size) < 0)
164
                if (avio_read(pb, pkt->data + JV_PREAMBLE_SIZE, size) < 0)
163 165
                    return AVERROR(EIO);
164 166

  
165
                pkt->size         = size + 5;
167
                pkt->size         = size + JV_PREAMBLE_SIZE;
166 168
                pkt->stream_index = 1;
167 169
                pkt->pts          = jv->pts;
168 170
                if (jvf->video_type != 1)

Also available in: Unified diff