Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-10-30 17:24:45 +0400
committerPaul B Mahol <onemda@gmail.com>2013-10-30 17:26:55 +0400
commit65988b991659fea72365be53e17d10953c0f8f78 (patch)
tree39fc4d6362d45ee3df557dc621f8150e4773cc3d /libavcodec/cook.c
parent387e76f9934cf3fa50b33bac3656915254be5180 (diff)
avcodec/cook: fix deadlock by using get_unary()
Fixes #3089. Reported-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/cook.c')
-rw-r--r--libavcodec/cook.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index 5b9f34a73e..402093c425 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -51,6 +51,7 @@
#include "fft.h"
#include "internal.h"
#include "sinewin.h"
+#include "unary.h"
#include "cookdata.h"
@@ -331,11 +332,7 @@ static void decode_gain_info(GetBitContext *gb, int *gaininfo)
{
int i, n;
- while (get_bits1(gb)) {
- /* NOTHING */
- }
-
- n = get_bits_count(gb) - 1; // amount of elements*2 to update
+ n = get_unary(gb, 0, get_bits_left(gb)); // amount of elements*2 to update
i = 0;
while (n--) {