avcodec/libopenjpegdec: fix mixed declarations and code

Signed-off-by: James Almer <jamrial@gmail.com>
pull/192/head
James Almer 9 years ago
parent 0cd9ff4e3a
commit 21cd0228be
  1. 8
      libavcodec/libopenjpegdec.c

@ -126,10 +126,12 @@ typedef struct BufferReader {
static OPJ_SIZE_T stream_read(void *out_buffer, OPJ_SIZE_T nb_bytes, void *user_data)
{
BufferReader *reader = user_data;
int remaining;
if (reader->pos == reader->size) {
return (OPJ_SIZE_T)-1;
}
int remaining = reader->size - reader->pos;
remaining = reader->size - reader->pos;
if (nb_bytes > remaining) {
nb_bytes = remaining;
}
@ -149,10 +151,12 @@ static OPJ_OFF_T stream_skip(OPJ_OFF_T nb_bytes, void *user_data)
nb_bytes = -reader->pos;
}
} else {
int remaining;
if (reader->pos == reader->size) {
return (OPJ_SIZE_T)-1;
}
int remaining = reader->size - reader->pos;
remaining = reader->size - reader->pos;
if (nb_bytes > remaining) {
nb_bytes = remaining;
}

Loading…
Cancel
Save