Revision 2b3c8f8a libavcodec/mjpegdec.c

View differences:

libavcodec/mjpegdec.c
1073 1073

  
1074 1074
/* return the 8 bit start code value and update the search
1075 1075
   state. Return -1 if no start code found */
1076
static int find_marker(uint8_t **pbuf_ptr, uint8_t *buf_end)
1076
static int find_marker(const uint8_t **pbuf_ptr, const uint8_t *buf_end)
1077 1077
{
1078
    uint8_t *buf_ptr;
1078
    const uint8_t *buf_ptr;
1079 1079
    unsigned int v, v2;
1080 1080
    int val;
1081 1081
#ifdef DEBUG
......
1105 1105

  
1106 1106
int ff_mjpeg_decode_frame(AVCodecContext *avctx,
1107 1107
                              void *data, int *data_size,
1108
                              uint8_t *buf, int buf_size)
1108
                              const uint8_t *buf, int buf_size)
1109 1109
{
1110 1110
    MJpegDecodeContext *s = avctx->priv_data;
1111
    uint8_t *buf_end, *buf_ptr;
1111
    const uint8_t *buf_end, *buf_ptr;
1112 1112
    int start_code;
1113 1113
    AVFrame *picture = data;
1114 1114

  
......
1136 1136
                /* unescape buffer of SOS, use special treatment for JPEG-LS */
1137 1137
                if (start_code == SOS && !s->ls)
1138 1138
                {
1139
                    uint8_t *src = buf_ptr;
1139
                    const uint8_t *src = buf_ptr;
1140 1140
                    uint8_t *dst = s->buffer;
1141 1141

  
1142 1142
                    while (src<buf_end)
......
1163 1163
                           (buf_end - buf_ptr) - (dst - s->buffer));
1164 1164
                }
1165 1165
                else if(start_code == SOS && s->ls){
1166
                    uint8_t *src = buf_ptr;
1166
                    const uint8_t *src = buf_ptr;
1167 1167
                    uint8_t *dst = s->buffer;
1168 1168
                    int bit_count = 0;
1169 1169
                    int t = 0, b = 0;

Also available in: Unified diff