summaryrefslogtreecommitdiff
path: root/libavcodec/ituh263dec.c
diff options
context:
space:
mode:
authorAnuj Mittal <am.devel@gmail.com>2012-10-09 18:22:26 +0530
committerMichael Niedermayer <michaelni@gmx.at>2012-10-09 16:48:43 +0200
commitce19aec15b4291dc48e791d89a1f940babc22cdc (patch)
tree64934508269c66716e93646136a7cc75d9ca2477 /libavcodec/ituh263dec.c
parentef9fe5bedd1993700818a0ba1c195cd6f6668afe (diff)
Check resync marker only when enabled.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ituh263dec.c')
-rw-r--r--libavcodec/ituh263dec.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index 68dee70f6f..a7d8d202cc 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -207,16 +207,18 @@ static int h263_decode_gob_header(MpegEncContext *s)
* @param end pointer to the end of the buffer
* @return pointer to the next resync_marker, or end if none was found
*/
-const uint8_t *ff_h263_find_resync_marker(const uint8_t *av_restrict p, const uint8_t *av_restrict end)
+const uint8_t *ff_h263_find_resync_marker(MpegEncContext *s, const uint8_t *av_restrict p, const uint8_t *av_restrict end)
{
av_assert2(p < end);
end-=2;
p++;
- for(;p<end; p+=2){
- if(!*p){
- if (!p[-1] && p[1]) return p - 1;
- else if(!p[ 1] && p[2]) return p;
+ if(s->resync_marker){
+ for(;p<end; p+=2){
+ if(!*p){
+ if (!p[-1] && p[1]) return p - 1;
+ else if(!p[ 1] && p[2]) return p;
+ }
}
}
return end+2;