From 5d639b2b4a6d1f5710cfe247dea4d4c6debdfe0d Mon Sep 17 00:00:00 2001 From: Xi Wang Date: Sat, 9 Mar 2013 22:34:27 -0500 Subject: [PATCH 1/3] vf_pad: fix a & instead of && typo Avoid buffer overflow in buffer_needs_copy() Signed-off-by: Xi Wang Signed-off-by: Luca Barbato --- libavfilter/vf_pad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c index 1c969e59a9..4489817367 100644 --- a/libavfilter/vf_pad.c +++ b/libavfilter/vf_pad.c @@ -316,7 +316,7 @@ static int buffer_needs_copy(PadContext *s, AVFrame *frame, AVBufferRef *buf) return 1; #define SIGN(x) ((x) > 0 ? 1 : -1) - for (j = 0; j < FF_ARRAY_ELEMS(planes) & planes[j] >= 0; j++) { + for (j = 0; j < FF_ARRAY_ELEMS(planes) && planes[j] >= 0; j++) { int hsub1 = (planes[j] == 1 || planes[j] == 2) ? s->hsub : 0; uint8_t *start1 = frame->data[planes[j]]; uint8_t *end1 = start1 + (frame->height >> hsub1) * From e2c297412066e25358741a234a1d936cb55cf139 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 9 Mar 2013 18:38:27 +0100 Subject: [PATCH 2/3] vorbisdec: do not leak the first frame. --- libavcodec/vorbisdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index ebe7aa79dc..be2e38dfd5 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -1707,6 +1707,7 @@ static int vorbis_decode_frame(AVCodecContext *avctx, void *data, if (!vc->first_frame) { vc->first_frame = 1; *got_frame_ptr = 0; + av_frame_unref(frame); return buf_size; } From 98cec5c84feff34e04428de4a86836a83657ae5e Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 21 Sep 2011 21:47:16 +0200 Subject: [PATCH 3/3] ratecontrol: remove an unused variable --- libavcodec/ratecontrol.h | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/ratecontrol.h b/libavcodec/ratecontrol.h index c0e05ccf18..63ebeb2586 100644 --- a/libavcodec/ratecontrol.h +++ b/libavcodec/ratecontrol.h @@ -61,7 +61,6 @@ typedef struct RateControlEntry{ * rate control context. */ typedef struct RateControlContext{ - FILE *stats_file; int num_entries; ///< number of RateControlEntries RateControlEntry *entry; double buffer_index; ///< amount of bits in the video/audio buffer