summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-07-16 00:00:52 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-07-16 00:00:52 +0000
commiteb5ec8fe6c2071d850c0fc4b45a4542b7412529d (patch)
tree5ec323fdbca348340f603ed2c5061036fd62f32a /ffmpeg.c
parentfbf33e4f7c18cad627a1efc48fdfb45a4df3eeb3 (diff)
segfault fix
Originally committed as revision 3322 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 16e1f8724b..3ccb21d3ab 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1067,7 +1067,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
uint8_t *data_buf;
int data_size, got_picture;
AVFrame picture;
- short samples[AVCODEC_MAX_AUDIO_FRAME_SIZE / 2];
+ short samples[pkt && pkt->size > AVCODEC_MAX_AUDIO_FRAME_SIZE/2 ? pkt->size : AVCODEC_MAX_AUDIO_FRAME_SIZE/2];
void *buffer_to_free;
if (pkt && pkt->dts != AV_NOPTS_VALUE) { //FIXME seems redundant, as libavformat does this too
@@ -1075,7 +1075,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
} else {
assert(ist->pts == ist->next_pts);
}
-
+
if (pkt == NULL) {
/* EOF handling */
ptr = NULL;