projects
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
44fe711
)
Fix (rewrite) find_group3_syncmarker().
author
Michael Niedermayer
<michaelni@gmx.at>
Fri, 26 Dec 2008 13:46:11 +0000
(13:46 +0000)
committer
Michael Niedermayer
<michaelni@gmx.at>
Fri, 26 Dec 2008 13:46:11 +0000
(13:46 +0000)
Originally committed as revision 16325 to svn://svn.ffmpeg.org/ffmpeg/trunk
libavcodec/faxcompr.c
patch
|
blob
|
blame
|
history
diff --git
a/libavcodec/faxcompr.c
b/libavcodec/faxcompr.c
index
9404446
..
9f1da4d
100644
(file)
--- a/
libavcodec/faxcompr.c
+++ b/
libavcodec/faxcompr.c
@@
-251,14
+251,14
@@
static void put_line(uint8_t *dst, int size, int width, const int *runs)
static int find_group3_syncmarker(GetBitContext *gb, int srcsize)
{
-
int state = get_bits(gb, 12)
;
-
int rem = srcsize -
get_bits_count(gb);
- while(
(state & 0xFFF) != 1
){
- state
= (state << 1) |
get_bits1(gb);
- if(
--rem <= 0
)
- return
-1
;
+
unsigned int state = -1
;
+
srcsize -=
get_bits_count(gb);
+ while(
srcsize-- > 0
){
+ state
+= state +
get_bits1(gb);
+ if(
(state & 0xFFF) != 1
)
+ return
0
;
}
- return
0
;
+ return
-1
;
}
int ff_ccitt_unpack_1d(AVCodecContext *avctx,