summaryrefslogtreecommitdiff
path: root/libavdevice
diff options
context:
space:
mode:
authorrogerdpack <rogerpack2005@gmail.com>2012-08-16 10:43:40 -0600
committerMichael Niedermayer <michaelni@gmx.at>2012-08-19 18:36:26 +0200
commita93c221ccd7a036de052e79659fe5b082f586279 (patch)
tree1a411bc6343b05173aaebfb3f1b84eb8977ba0e7 /libavdevice
parent42dbf06df0130456692fae8a008ddcebaa74d2e3 (diff)
downloadffmpeg-a93c221ccd7a036de052e79659fe5b082f586279.tar.gz
dshow: protect access to curbufsize
Signed-off-by: rogerdpack <rogerpack2005@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/dshow.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 3a2d6e1821..ac207b8b15 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -920,6 +920,7 @@ static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt)
*pkt = pktl->pkt;
ctx->pktl = ctx->pktl->next;
av_free(pktl);
+ ctx->curbufsize -= pkt->size;
}
ResetEvent(ctx->event);
ReleaseMutex(ctx->mutex);
@@ -932,8 +933,6 @@ static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt)
}
}
- ctx->curbufsize -= pkt->size;
-
return pkt->size;
}