[FFmpeg-cvslog] avcodec/libopenjpegdec: fix mixed declarations and code
James Almer
git at videolan.org
Fri Mar 25 04:06:47 CET 2016
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Mar 25 00:04:57 2016 -0300| [21cd0228beca6ad1d340536c7c90ceea6bc54bb4] | committer: James Almer
avcodec/libopenjpegdec: fix mixed declarations and code
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21cd0228beca6ad1d340536c7c90ceea6bc54bb4
---
libavcodec/libopenjpegdec.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
index cae3d20..65167e6 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;
}
More information about the ffmpeg-cvslog
mailing list