aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2016-03-25 00:04:57 -0300
committerJames Almer <jamrial@gmail.com>2016-03-25 00:04:57 -0300
commit21cd0228beca6ad1d340536c7c90ceea6bc54bb4 (patch)
treee5462133576ea6866ea0f3456ed037bb45b39b18 /libavcodec
parent0cd9ff4e3aa23318a855c21d60b1c9035b2b99d2 (diff)
downloadffmpeg-21cd0228beca6ad1d340536c7c90ceea6bc54bb4.tar.gz
avcodec/libopenjpegdec: fix mixed declarations and code
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/libopenjpegdec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
index cae3d20986..65167e6aee 100644
--- a/libavcodec/libopenjpegdec.c
+++ b/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;
}